I’ve implemented a custom component and I needed to change the state from automation.
It is possible to change the state using the API (set_state) and debug console but this state is changed when the API self.async_schedule_update_ha_state() is called (it seems somthing else is changed and when this API is called the old internal state is updated back to the GUI)
So I’ve implemented a service API for that and it works (the code to update the state using service is here)
My questions:
- Is it possible to have a way to change the internal state without service API?
- In which case the set_state is used is it change only UI state
thanks