Yep, maybe that’s the way to do it, but it seems a little clunky to have to call the external API from inside HA I was hoping there was a service that could be used to simply set the state.
The problem is this:
- Lamp is off. Lamp state in HA is off. Wall remote in HA shows is off.
- I press “on” on the wall remote.
- The lamp is switched on by the wall remote.
- HA picks up the wall remote switch and the state changes to on.
Unless I do something here, the lamp state in HA still shows as off - no longer in sync with actual status. I then tried to add an automation rule based on the wall remote state change, something like:
- alias: WallRemoteSync trigger: platform: state entity_id: switch.remote_kitchen_1 from: 'off' to: 'on' action: service: homeassistant.turn_on entity_id: switch.kitchen_lamp
This works, but the side effect is that the homeassistant.turn_on service actually sends the turn on command to the lamp. This is fine, except in the case of a dimmer, where the second “on” signal causes the dimmer cycle to start.