home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.6k stars 29.92k forks source link

History_graph strange behaviour #14814

Closed Pharizna closed 5 years ago

Pharizna commented 6 years ago

Home Assistant release with the issue:

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.): RASPBIAN 0.70.1

Component/platform: history_graph

Description of problem:

I'm trying to see 4 temperatures in one graph using the code:

  gr69:
    name: Sigfox
    entities:
      - sensor.temperature_158d0001b95205
      - sensor.temperature_158d0001ddaee4
      - sensor.tempext
      - sensor.sigfox_temp
    hours_to_show: 720
    refresh: 1200

The two ones came from Xiaomi Platform, the third from MQTT and the last one through a template for Sigfox. Of course, all variables has the same "ºC" as unit of measurement.

Restarting HA, it appears two figures: One with the sensor.sigfox_temp (temperatura) and the second one with the anothers temperatures.

image

The most strange is that one hour later (more or less) ... appears the "temperature" line with the another three previous temp ... and it doesn't dissapeared form the first line :(

image

image

"Refreshing" the page... it dissapears the "new temperature line" in the four temp graph :(

Traceback (if applicable):

Additional information:

OttoWinter commented 6 years ago

From your screenshot the degree symbols ° look a bit different. On of them is a bit bigger. Maybe that's the cause?

(The graph fusion happens by a simple character by character compare - if the units are exactly the same, they're merged)

Pharizna commented 6 years ago

I don't know why but the fonts are not exactly the same :)

But reading the attributes: sensor.sigfox_temp { "unit_of_measurement": "°C", "friendly_name": "Temperatura", "icon": "mdi:thermometer" }

and for sensor.temperature_158d0001ddaee4 { "unit_of_measurement": "°C", "friendly_name": "Temperatura (Xiaomi)", "battery_level": 33, "hidden": false, "device_class": "temperature" }

Also: How can you explain that sometimes appears 4 lines and in another cases only 3+1 lines?

OttoWinter commented 6 years ago

Try manually adding device_class: temperature in the customize section for sensir.sigfox_temp. The device class could theoretically change the unit of measurement.

Pharizna commented 6 years ago

Very good idea... but the problem remains :(

sensor.sigfox_temp { "device_class": "temperature", "icon": "mdi:thermometer", "friendly_name": "Temperatura", "unit_of_measurement": "°C" }

(I changed it in the configuration.yaml and restart HA)

Pharizna commented 6 years ago

Also. I've just deleted the "unit_of_measurement"... but the problem remains :(

Pharizna commented 6 years ago

As you can see the "degree" size of the same variable is different from the numeric card vs history_graph :)

image

Pharizna commented 6 years ago

Thank you @OttoWinter It was the problem. I don't know why ... but the "degree" symbol was the problem.

Trying to change units doesn't solve it. I tried to copy units from other temperature but the problem remains. As you can see in the last figure it seems tha the "size" of the symbol is different in the "card" from the "graph" :(

I solve it creating a new tag with the correct degree symbol. Why is not possible to change units in a sensor? It's a pity :(

image

balloobbot commented 6 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

balloobbot commented 5 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍