--- - alias: '[Garage] Lights Auto On' initial_state: 'true' trigger: platform: state entity_id: - binary_sensor.presence_garage_sensor_1 from: 'off' to: 'on' condition: condition: and conditions: - condition: state entity_id: light.garage_ceiling_01 state: 'off' - condition: or conditions: - condition: state entity_id: sun.sun state: 'below_horizon' - condition: template value_template: '{{ ( states.sensor.presence_garage_light_level.state | int ) < ( states.input_number.app_light_light_lux_mininum.state | int ) }}' action: - service: light.turn_on entity_id: - light.garage_ceiling_01 - alias: '[Garage] Lights Auto Off' initial_state: 'true' trigger: platform: state entity_id: - binary_sensor.presence_garage_sensor_1 from: 'on' to: 'off' action: - service: light.turn_off entity_id: - light.garage_ceiling_01