Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support last-updated for unchanging sensor values #93

Open
Gonioul opened this issue May 19, 2022 · 8 comments
Open

Support last-updated for unchanging sensor values #93

Gonioul opened this issue May 19, 2022 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@Gonioul
Copy link

Gonioul commented May 19, 2022

Hi,

Looks like the last-updated value of the entity isn't updated if the sensor value doesn't change (temperature for example).

The only way to know the entity is not dead is to look for the utc value of the device.

Regards,

@deviantintegral
Copy link
Collaborator

Good thought! My sensors all update fairly frequently with different values. Can you check to see if rtl_433 is sending the value to mqtt?

My first guess is we may want to set force_update, which defaults to false. If that's the case, we should change this upstream first at https://github.com/merbanan/rtl_433/blob/master/examples/rtl_433_mqtt_hass.py.

@abstractvector
Copy link

I just ran into this same situation with a humidity sensor. It was raining outside and relative humidity was at 100% for an extended period (several hours). I confirmed that the MQTT messages were being published but the last_updated and last_changed dates for the entity weren't being updated as each new message arrived.

I confirmed on the Home Assistant Discord that setting force_update: true would fix this, but it's unclear to me if / how this is supported using this Add On with the Auto Discovery Add On too.

My plan at the moment is to manually configure those MQTT sensors in Home Assistant.

It's worth noting this is reproducible with lots of different sensors whose value doesn't change for several hours - e.g. UV index sensor overnight, fridge / freezer temperature sensor, rainfall sensor, etc.

@deviantintegral
Copy link
Collaborator

I confirmed on the Home Assistant Discord that setting force_update: true would fix this, but it's unclear to me if / how this is supported using this Add On with the Auto Discovery Add On too.

It is! There is a force_update setting in the autodiscovery configuration:
Screen Shot 2022-06-12 at 3 00 16 PM

Does that work for you? If so, I think we need to mention it in the readme as it's not there currently.

@deviantintegral deviantintegral added the question Further information is requested label Jun 12, 2022
@deviantintegral deviantintegral added this to the Next Release milestone Jun 12, 2022
@deviantintegral
Copy link
Collaborator

There's open discussions about this at merbanan/rtl_433#2102 and home-assistant/home-assistant.io#23900.

@deviantintegral deviantintegral added enhancement New feature or request and removed question Further information is requested labels Aug 26, 2022
@deviantintegral deviantintegral changed the title Last-updated Support last-updated for unchanging sensor values Aug 26, 2022
@rct
Copy link

rct commented Aug 28, 2022

Looking into this, I still need to get a better understanding of updated, changed, availability…

first comment, it seems like force update for all 433 auto discovered devices is a pretty blunt control. Does this wind up generating state updates in hass / recorder every time a message is received?

@deviantintegral
Copy link
Collaborator

first comment, it seems like force update for all 433 auto discovered devices is a pretty blunt control. Does this wind up generating state updates in hass / recorder every time a message is received?

Yes, that's exactly the issue. It's suggested here that removing force_update entirely may be a better solution.

@Gonioul , it turns out that "Last updated" doesn't actually mean what it looks like in the UI. I've filed a discussion in the Home Assistant front-end repository at home-assistant/frontend#13687.

To solve the original case of "The only way to know the entity is not dead is to look for the utc value of the device.", I think we'd need to write something that marks an entity as unavailable if a given period of time has passed.

@deviantintegral
Copy link
Collaborator

@kohkohwastaken
Copy link

Registering my interest in this!

@deviantintegral deviantintegral added the help wanted Extra attention is needed label Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants