Skip to content

Wrong icon displayed in case of "state_map" use #484

Description

@ildar170975

Wrong icon displayed in case of "state_map" use.
There is a binary sensor of "connectivity" device_class.
I am using a "state_map" to display a graph for this sensor.

A wrong icon (for temperature) is displayed for the sensor:
изображение

In other cards (as well as in "Configuration" -> "Entities") the icon is displayed properly:
изображение

Card's definition:

type: 'custom:mini-graph-card'
entities:
  - entity: binary_sensor.net_is_available_internet
    show_points: false
    show_state: true
hours_to_show: 4
update_interval: 0
points_per_hour: 60
show:
  graph: line
  icon: true
  state: true
  labels: true
  points: false
line_width: 2
state_map:
  - value: 'off'
    label: Disconnected
  - value: 'on'
    label: Connected

Sensors' declaration in configuration.yaml is provided below.
The sensor is "Connected" if there is a ping either to "google.com" or "ya.ru".

binary_sensor:
  # Internet availability
  - platform: ping
    host: google.com
    count: 2
    scan_interval: 60
    name: net_is_available_google
  - platform: ping
    host: ya.ru
    count: 2
    scan_interval: 60
    name: net_is_available_yandex
  - platform: template
    sensors:
      net_is_available_internet:
        value_template: "{{ states('binary_sensor.net_is_available_google') == 'on' or states ('binary_sensor.net_is_available_yandex') == 'on' }}"
        device_class: connectivity

These actions did not help:

  • restarting the browser (Firefox);
  • clearing the browser's cache;
  • restarting HA.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions