esphome-state-machine icon indicating copy to clipboard operation
esphome-state-machine copied to clipboard

Ability to set initial_state dynamically

Open muxa opened this issue 3 years ago • 2 comments

When controlling, for instance, light wit a state machine, the light state will be restored from HA, but the state machine won't be. We need a way to restore state machine initial state somehow.

muxa avatar Aug 30 '21 09:08 muxa

Looks like this can be achieved by making initial_state templatable.

muxa avatar Sep 24 '21 00:09 muxa

It can also be perserved in the rtc memory, like in light component for example: https://github.com/esphome/esphome/blob/6919930aaa230f0437d0975d902e98cc7dbbf11f/esphome/components/light/light_state.cpp#L59

majkrzak avatar Jan 27 '23 17:01 majkrzak