Replies: 1 comment 1 reply
-
Hello, yes I remember I have tried this (there should be some piece of code around this) but this was not working on my environment. Maybe it depends on the brand/model or techno (Zigbee / mqtt / wifi / ...). I have implemented the same thing with a last_seen info if you have it. You can provide an entity that gives the last_seen datetime value. You can also map the last_seen to the reported value if it works on your home. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's probably because my sensors are pretty lazy, and/or because the temperature in my house is pretty stable, but my thermostats keep going into safety mode.
I went through the code rather quickly and noticed that the component uses
last_changed
andlast_updated
to determine if the sensor is still providing a temperature reading. I took a look at the docs of the state object and understood the following:last_changed
changes only if the state changes, i.e. if the temperature changes, in this caselast_updated
changes if the state or any attributes change, which in the case of my temperature sensors is the same aslast_changed
as they don't really have any other attributes that changeThe most interesting thing I noticed while reading the docs, though, is that there is now a
last_reported
timestamp on the state object, which changes when an integration sets the state of an entity, regardless of any change to the state or a state attribute. This was added around March of this year apparently.I checked some of my sensors, and indeed,
last_reported
is significantly different from the other values. For example:I didn't go into the code in enough detail to determine what changes are needed, but what do you think about using
last_reported
as the value used to determine temperature "freshness"? Maybe withlast_changed
as a fallback iflast_reported
is not available (old HA version)?Beta Was this translation helpful? Give feedback.
All reactions