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

Add watchdog to set sensor state to unavailable on missing telegrams #11

Open
shurli opened this issue Nov 19, 2024 · 1 comment
Open

Comments

@shurli
Copy link

shurli commented Nov 19, 2024

Hi @farmio,
This is a feature suggest.

Sometimes KNX devices fail or their connection get lost due to environmental issues. e.g. weather station, animals, ... or are badly designed and gets stuck. In these cases no more WriteTelegrams wether value-changed-triggered or cyclic will be received.
For now the sensor entity state will stay on its last value forever or at least till a HA restart when it gets "unknown" due to a failing initial read.

I would like to see a "watchdog" or "timeout" config option to set a duration in which a telegram needs to get received otherwise the entity state will change to "unavailable".
This state change could then be used to trigger problem notifications or bring systems in fail-safe-modes.

I think the code to implement the feature is pretty the same like in the sync_state: expire function.
There is also a timer listening to the WriteTelegrams and in case fires the ReadTelegram.

Like to here your response on this idea.
Lg shurli

@shurli shurli changed the title Add watchdog to set sensor value to unavailable on missing telegrams Add watchdog to set sensor state to unavailable on missing telegrams Nov 19, 2024
@shurli
Copy link
Author

shurli commented Nov 21, 2024

For users who are interested in knx sensor watchdog:

Here is a common script for a watchdog in HA on entity level:
https://community.home-assistant.io/t/watchdog-automation-script-for-checking-on-sensors/174628/1

With the latly introduced "last_reported" attribute, this should be very usable.
https://developers.home-assistant.io/blog/2024/03/20/state_reported_timestamp/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants