You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@state_trigger(("float(sensor.master_temperature) <= float(climate.hvac_up.temperature)"" and input_select.master_mode == 'sleep'"))defturn_on_heater():
log.info('Turning on Heater')
switch.turn_on(entity_id="switch.master_heater")
The issue is, I'd also like that same check to be performed at startup (i.e. when the trigger is registered). I can't just use @time_trigger('startup') because the conditions in the state_trigger won't be checked. I can't just change @state_trigger to @state_active because then it'll ONLY trigger at startup. So, instead, to accomplish what I want, I have to have a state_trigger, a time_trigger, and a state_active.
Adding state_check_now to @state_trigger would allow me to keep the code short and reduce redundancy.
The text was updated successfully, but these errors were encountered:
I use this pattern often:
The issue is, I'd also like that same check to be performed at startup (i.e. when the trigger is registered). I can't just use
@time_trigger('startup')
because the conditions in thestate_trigger
won't be checked. I can't just change@state_trigger
to@state_active
because then it'll ONLY trigger at startup. So, instead, to accomplish what I want, I have to have a state_trigger, a time_trigger, and a state_active.Adding
state_check_now
to@state_trigger
would allow me to keep the code short and reduce redundancy.The text was updated successfully, but these errors were encountered: