automation: - alias: Lighting · Kitchen · Day mode · Motion · Turn lights on after sunset trigger: platform: state entity_id: binary_sensor.motion_1_ias_zone to: "on" condition: condition: and conditions: - condition: state entity_id: input_select.house_mode state: 'day' - condition: state entity_id: sun.sun state: 'below_horizon' action: - service: light.turn_on entity_id: light.tuya_kitchen_all_lights - alias: Lighting · Kitchen · Day mode · Motion · Turn lights off trigger: platform: state entity_id: binary_sensor.motion_1_ias_zone to: "off" for: minutes: 30 condition: condition: state entity_id: input_select.house_mode state: 'day' action: - service: light.turn_off entity_id: light.tuya_kitchen_all_lights - alias: Lighting · Kitchen · Night mode · Motion · Turn lights on trigger: platform: state entity_id: binary_sensor.motion_1_ias_zone to: "on" condition: condition: template value_template: "{{ not is_state('input_select.house_mode', 'day') }}" action: - service: light.turn_on entity_id: light.light_le_12 data: brightness_pct: 13 # this is the lowest it'll go ¯\_(ツ)_/¯ - alias: Lighting · Kitchen · Night mode · Motion · Turn lights off trigger: platform: state entity_id: binary_sensor.motion_1_ias_zone to: "off" for: minutes: 5 condition: condition: template value_template: "{{ not is_state('input_select.house_mode', 'day') }}" action: - service: light.turn_on entity_id: light.light_le_12 data: brightness_pct: 100 - service: light.turn_off entity_id: light.light_le_12