Hi folks, looking for some assistance with the HA state machine.
I am the author of the BHyve integration which provides a switch entity. The integration connects to the service provider API with a websocket, and on certain events the switch’s state may change. My current logic simply sets the value of the property self._is_on
based on the event data received, for example:
if event == "device_idle" or event == "watering_complete":
self._is_on = False
Separately, I have an automation which notifies me whenever this switch’s state changes. The notification payload looks like:
data_template:
message: >
{{ trigger.to_state.name }} changed ({{ trigger.from_state.state }} : {{ trigger.to_state.state }})
I often receive notifications with the following payload: Switch changed (False : False), which indicates that the Switch’s state has changed value, but to the same value. My integration does not override the force_update
prop.
I’m not clear if this is an error in my Integration or Automation. Is anybody able to give me any tips at what might be going wrong?
Thanks!