home_automations.py 645 B

123456789101112131415161718
  1. # This state is set every midnight by the ext_lights_control-script
  2. state.persist('pyscript.home_auto_lights_off_has_been_night','false')
  3. @state_trigger("int(sensor.lux_outside_the_garage) > 1000", state_hold_false=0)
  4. def automate_home_auto_lights_off():
  5. if( pyscript.home_auto_lights_off_has_been_night == 'true' ):
  6. pyscript.home_auto_lights_off_has_been_night = 'false'
  7. pyscript.state_goto_all_off();
  8. # Activate morning lights when Thomas gets up
  9. @time_trigger("once(06:20:00)")
  10. def morning_lights_thomas():
  11. if switch.eng_heat_a == 'on' or switch.eng_heat_b == 'on':
  12. pyscript.state_goto_morning();