home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.08k stars 2.79k forks source link

History Graph - State mismatch #1251

Closed dgomes closed 3 years ago

dgomes commented 6 years ago

Home Assistant release with the issue: 0.70

Last working Home Assistant release (if known): NA

Browser and Operating System: All

Description of problem:

This is hard to replicate, but unfortunately common. A binary sensor that has been in a given state for >24h will show the history graph in an incorrect state.

screen shot 2018-06-02 at 23 52 02

The screenshot show's such case, but another binary sensor in the same conditions shows up correctly...

Javascript errors shown in the web inspector (if applicable): None

Additional information:

c727 commented 6 years ago

the problem is that we don't update the history on state change. reopening the dialog shows the update

dgomes commented 6 years ago

No

I can reopen the dialog as many times and still the state is wrong

kunago commented 6 years ago

I am experiencing very similar issues with some sensors. While the sensor status is corrent, the history graph does not correspond with it no matter what I try.

status (Doma stands for Home and Pryč for Away)

quazzie commented 6 years ago

Maby there is a query for states < 24h to render the history. But if a sensor has been in the same state for > 24h it would return nothing.

cgarwood commented 6 years ago

Can anyone test and verify if this is still an issue as of 0.80?

dgomes commented 6 years ago

still an issue

stale[bot] commented 4 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 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

dgomes commented 4 years ago

still an issue...

zsarnett commented 4 years ago

@dgomes Would you be able to provide more detail on this issue? Lovelace Config? What card are you using to click to show the graph popup? Can you confirm what version of HomeAssistant you are on

dgomes commented 4 years ago

@zsarnett this has been like this since pre-lovelace

The bug is clearly associated with history graph generation.

zsarnett commented 4 years ago

@dgomes out of all of those I asked the only thing you answered was it wasn't lovelace....

We use the same history graph. If you are using states UI then that is okay. But if you could attach a gif of the issue and confirm the version of Home Assistant you are on. This is clearly not happening to a lot of people so trying to get more info is the only way to help you...

dgomes commented 4 years ago

I'm currently using lovelace, but the issue existed before lovelace (read my initial issue report!). You have the image of the error in my original issue submission too.

But here is another screenshot I just took from my 0.104 version (using lovelace):

Screenshot 2020-02-05 at 21 42 48

This is an mqtt.switch auto-discovered:

homeassistant/switch/dafang/rtsp_h264_server/config 

{"name": "dafang h264 rtsp server", "unique_id": "34ce00aebdff-h264-rtsp-server", "device": {"identifiers": "34ce00aebdff", "connections": [["mac", "34:ce:00:ae:bd:ff"]], "manufacturer": "Xiaomi", "model": "Dafang", "name": "Xiaomi Dafang", "sw_version": "Dafang Hacks"}, "icon": "mdi:cctv", "state_topic": "devices/dafang/rtsp_h264_server", "command_topic": "devices/dafang/rtsp_h264_server/set"}

The switch has been on since forever (I never turn off the rtsp server)

Many other switch/binary sensors in my setup, but this only happens to those who have been in the same state for >24h (as I reported in previous comment)

zsarnett commented 4 years ago

Is this still an issue? Also, I am going to politely tag @bdraco to see if he has any insight. We pull the data from the backend for the history graph I am wondering if maybe the data is coming back incorrectly?

dgomes commented 4 years ago

Still an issue (running 0.114) Screenshot 2020-09-19 at 17 49 33

But this only happens in very few situations, I had to check +10 binary sensors before finding this one with the bug...

I can't even make any sense of when does this happen :(

Look at similar sensor:

Screenshot 2020-09-19 at 17 52 19

These two sensors are auto-discovered from zigbee2mqtt

bdraco commented 4 years ago

Probably the initial state request returns nothing because its already been purged from the database because we haven't restarted since the data was purged so we need to assume the current state in that case

github-actions[bot] commented 3 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 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

dgomes commented 3 years ago

still happens :(

but I think @bdraco comment is a good hypothesis.

github-actions[bot] commented 3 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 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

dgomes commented 3 years ago

No... still happens...

github-actions[bot] commented 3 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 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.