Force update sensor from HA
-
Hi,
I've got a sketch with Button+Relay which can operate independently from the HA (falling edge of button -> toggles relay). The HA can also trigger the change and it is correctly reflected (by switching on/off -> changes relay to on/off). I am also able to read the HA state when the sketch launches so that the state of relay is correctly brought back on sketch startup.
However I am not sure how should I force update of relay status from HA when it misses some events or HA is off while the sketch is still doing its job. In such case until there's a change triggered by Button or from the HA there is a discrepancy of states (actual vs. shown in HA).
Is there a way to check these states when HA is starting up. Also I would like to check it periodically to ensure I am in sync.
Cheers,
Bart
-
Mysensors devices push their updates to home assistant. You can push an update to home assistant at a regular interval. If the state is the same as before in home assistant, a state change won't happen, so it should be harmless.
For sensors, ie not actuators or binary sensors, I will soon implement forced updates, which mean an update from a sensor device will always force a state change, even if new state is the same as old state. This will enhance recording of sensor values eg when the same value is reported consecutively.
Regarding syncing state at home assistant start, I think this can be solved for non sleeping devices by using discovery, I_DISCOVER, messages. This is on my todo.
Suggested Topics
-
Forum Theme Problems
Announcements • 8 Apr 2014, 07:05 • hek 8 Apr 2014, 07:05 -
Home Assistant update changed USB port name
Home Assistant • 14 Jan 2024, 17:25 • therik 15 Jan 2024, 10:26 -
Node 2 is unknown warning in Homeassistant.
Home Assistant • 10 Mar 2019, 19:27 • badisensors 15 Oct 2024, 20:33 -
Gateway on my PI when i run HA
Home Assistant • 31 Aug 2024, 21:51 • diltech 5 Oct 2024, 10:31 -
Hi,
Home Assistant • 1 Sept 2024, 20:57 • diltech 1 Sept 2024, 20:57