mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-05 08:44:24 +00:00
191 lines
5.2 KiB
YAML
191 lines
5.2 KiB
YAML
automation:
|
|
- alias: Lighting · Turn on ceiling lights after sunset
|
|
trigger:
|
|
platform: sun
|
|
event: sunset
|
|
offset: "-00:30:00"
|
|
condition:
|
|
- condition: state
|
|
entity_id: binary_sensor.georgi_home
|
|
state: "on"
|
|
action:
|
|
- service: light.turn_on
|
|
entity_id: light.on_after_dark
|
|
data:
|
|
brightness_pct: 100
|
|
|
|
- alias: Lighting · Turn off all lights after sunrise
|
|
trigger:
|
|
platform: sun
|
|
event: sunrise
|
|
offset: "+00:00:00"
|
|
action:
|
|
- service: light.turn_off
|
|
entity_id: light.all_lights
|
|
|
|
- alias: Lighting · Master bedroom · Toggle lights on bedside switch single click
|
|
trigger:
|
|
platform: event
|
|
event_type: zha_event
|
|
event_data:
|
|
device_ieee: !secret master_bedroom_bedside_switch_ieee
|
|
command: single
|
|
action:
|
|
- service: light.toggle
|
|
data_template:
|
|
entity_id: >-
|
|
|
|
{% if is_state('input_select.house_mode', 'day') %}
|
|
light.master_bedroom_main_lights
|
|
{% elif is_state('input_select.house_mode', 'bed') %}
|
|
light.bedside_light, light.bed_led
|
|
{% elif is_state('input_select.house_mode', 'night') %}
|
|
light.bed_led
|
|
{% endif %}
|
|
brightness_pct: >-
|
|
|
|
{% if is_state('input_select.house_mode', 'night') %}
|
|
40
|
|
{% else %}
|
|
100
|
|
{% endif %}
|
|
|
|
- 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
|
|
|
|
- alias: Lighting · Hallway · Day mode · Motion · Turn lights on
|
|
trigger:
|
|
platform: state
|
|
entity_id: binary_sensor.motion_2_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.hallway_all_lights
|
|
|
|
- alias: Lighting · Hallway · Day mode · Motion · Turn lights off
|
|
trigger:
|
|
platform: state
|
|
entity_id: binary_sensor.motion_2_ias_zone
|
|
to: "off"
|
|
for:
|
|
minutes: 5
|
|
condition:
|
|
condition: state
|
|
entity_id: input_select.house_mode
|
|
state: 'day'
|
|
action:
|
|
- service: light.turn_off
|
|
entity_id: light.hallway_all_lights
|
|
|
|
- alias: Lighting · Hallway · Night mode · Motion · Turn lights on
|
|
trigger:
|
|
platform: state
|
|
entity_id: binary_sensor.motion_2_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_lohas_6
|
|
data:
|
|
brightness_pct: 30
|
|
- service: light.turn_on
|
|
entity_id: light.light_le_8
|
|
data:
|
|
brightness_pct: 13
|
|
|
|
- alias: Lighting · Hallway · Night mode · Motion · Turn lights off
|
|
trigger:
|
|
platform: state
|
|
entity_id: binary_sensor.motion_2_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_8
|
|
- light.light_lohas_6
|
|
data:
|
|
brightness_pct: 100
|
|
- service: light.turn_off
|
|
entity_id:
|
|
- light.light_lohas_6
|
|
- light.light_le_8
|