922 lines
23 KiB
YAML
922 lines
23 KiB
YAML
- alias: Set pc_mike_lock based on session lock state
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pc_mike_session
|
|
condition: []
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.pc_mike_session
|
|
state: Unlocked
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.pc_mike_lock
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ is_state(''sensor.pc_mike_session'', ''Unavailable'')
|
|
or is_state(''sensor.pc_mike_session'', ''Locked'') }}
|
|
|
|
'
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.pc_mike_lock
|
|
id: 66e5e1bbc8e94369a8886b91a5630cae
|
|
- id: '1727017828258'
|
|
alias: Set pc_mike_lock and active based on session lock state
|
|
description: ''
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pc_mike_session
|
|
condition: []
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.pc_mike_session
|
|
state: Unlocked
|
|
sequence:
|
|
- target:
|
|
entity_id: input_boolean.pc_mike_lock
|
|
action: input_boolean.turn_on
|
|
data: {}
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ is_state(''sensor.pc_mike_session'', ''Unavailable'')
|
|
or is_state(''sensor.pc_mike_session'', ''Locked'') }}
|
|
|
|
'
|
|
sequence:
|
|
- target:
|
|
entity_id: input_boolean.pc_mike_lock
|
|
action: input_boolean.turn_off
|
|
data: {}
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.pc_mike
|
|
mode: single
|
|
- id: '1728806979894'
|
|
alias: Lampen aan, bij bezetting en zonsondergang
|
|
description: ''
|
|
triggers:
|
|
- entity_id: binary_sensor.presence_detector_wc_presence
|
|
to: 'on'
|
|
trigger: state
|
|
conditions:
|
|
- condition: or
|
|
conditions:
|
|
- condition: numeric_state
|
|
entity_id: sensor.presence_detector_wc_illuminance_lux
|
|
below: 750
|
|
- condition: state
|
|
entity_id: sun.sun
|
|
state: below_horizon
|
|
actions:
|
|
- target:
|
|
entity_id: light.all_lights
|
|
action: light.turn_on
|
|
data: {}
|
|
mode: single
|
|
- id: '1730031942190'
|
|
alias: HUE dimmer keuken
|
|
description: ''
|
|
use_blueprint:
|
|
path: CrazyCoder/zigbee2mqtt_hue_dimmer_v2.yaml
|
|
input:
|
|
action_sensor: sensor.hue_schakelaar_keuken_action
|
|
helper_last_controller_event: input_text.hue_dimmer_keuken
|
|
on_press:
|
|
- action: light.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: light.keuken
|
|
up_press:
|
|
- action: light.turn_on
|
|
target:
|
|
entity_id: light.keuken
|
|
data:
|
|
brightness_step_pct: 10
|
|
up_hold:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: 5
|
|
target:
|
|
entity_id: light.keuken
|
|
down_press:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: -10
|
|
target:
|
|
entity_id: light.keuken
|
|
down_hold:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: -5
|
|
target:
|
|
entity_id: light.keuken
|
|
- id: '1730305912339'
|
|
alias: Hue dimmer slaapkamer
|
|
description: ''
|
|
use_blueprint:
|
|
path: CrazyCoder/zigbee2mqtt_hue_dimmer_v2.yaml
|
|
input:
|
|
action_sensor: sensor.hue_schakelaar_slaapkamer_action
|
|
helper_last_controller_event: input_text.hue_button_slaapkamer_text_helper
|
|
on_press:
|
|
- action: light.toggle
|
|
target:
|
|
entity_id:
|
|
- light.slaapkamer
|
|
data: {}
|
|
up_press:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: 10
|
|
target:
|
|
entity_id: light.slaapkamer
|
|
up_hold:
|
|
- action: light.turn_on
|
|
target:
|
|
entity_id: light.slaapkamer
|
|
data:
|
|
brightness_step_pct: 5
|
|
down_press:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: -10
|
|
target:
|
|
entity_id: light.slaapkamer
|
|
down_hold:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: -5
|
|
target:
|
|
entity_id: light.slaapkamer
|
|
- id: '1730307935329'
|
|
alias: HUE dimmer toilet
|
|
description: ''
|
|
use_blueprint:
|
|
path: CrazyCoder/zigbee2mqtt_hue_dimmer_v2.yaml
|
|
input:
|
|
action_sensor: sensor.hue_schakelaar_toilet_action
|
|
helper_last_controller_event: input_text.hue_dimmer_toilet
|
|
on_press:
|
|
- action: light.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: light.toilet
|
|
up_press:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: 10
|
|
target:
|
|
entity_id: light.toilet
|
|
up_hold:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: 5
|
|
target:
|
|
entity_id: light.toilet
|
|
down_press:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: -10
|
|
target:
|
|
entity_id: light.toilet
|
|
down_hold:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: -5
|
|
target:
|
|
entity_id: light.toilet
|
|
- id: '1730312823062'
|
|
alias: HUE dimmer kantoor
|
|
description: ''
|
|
use_blueprint:
|
|
path: CrazyCoder/zigbee2mqtt_hue_dimmer_v2.yaml
|
|
input:
|
|
action_sensor: sensor.hue_schakelaar_kantoor_action
|
|
helper_last_controller_event: input_text.hue_dimmer_kantoor
|
|
on_press:
|
|
- action: light.toggle
|
|
target:
|
|
entity_id: light.kantoor
|
|
data: {}
|
|
up_press:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: 10
|
|
target:
|
|
entity_id: light.kantoor
|
|
up_hold:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: 5
|
|
target:
|
|
entity_id: light.kantoor
|
|
down_press:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_step_pct: -10
|
|
target:
|
|
entity_id: light.kantoor
|
|
down_hold:
|
|
- action: light.turn_on
|
|
target:
|
|
entity_id: light.kantoor
|
|
data:
|
|
brightness_step_pct: -5
|
|
- alias: Daily Backup at 2 AM
|
|
mode: single
|
|
triggers:
|
|
- trigger: time
|
|
at: 02:00:00
|
|
conditions: []
|
|
actions:
|
|
- action: auto_backup.backup
|
|
data:
|
|
name: Automatic Backup {{ now().strftime('%Y-%m-%d') }}
|
|
keep_days: 2
|
|
- action: hassio.addon_restart
|
|
data:
|
|
addon: 19a172aa_rclone_backup
|
|
- alias: Turn off pc_mike when session is unavailable
|
|
trigger:
|
|
- platform: time_pattern
|
|
minutes: '*'
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ states(''sensor.pc_mike_session'') == ''unavailable'' }}'
|
|
action:
|
|
- action: switch.turn_off
|
|
target:
|
|
entity_id: switch.pc_mike_wol
|
|
- alias: Set lock on boot
|
|
trigger:
|
|
- platform: time_pattern
|
|
minutes: '*'
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ states(''sensor.pc_mike_session'') == ''unlocked'' }}'
|
|
action:
|
|
- action: switch.turn_on
|
|
target:
|
|
entity_id: input_boolean.pc_mike_lock
|
|
- alias: Set pc_mike_lock and active based on session lock state and turn on PC when
|
|
sensor information is in.
|
|
description: ''
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pc_mike_session
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.pc_mike_session
|
|
state: Unlocked
|
|
sequence:
|
|
- target:
|
|
entity_id: input_boolean.pc_mike_lock
|
|
action: input_boolean.turn_on
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ is_state(''sensor.pc_mike_session'', ''unavailable'')
|
|
or is_state(''sensor.pc_mike_session'', ''unknown'') or is_state(''sensor.pc_mike_session'',
|
|
''locked'') }}'
|
|
sequence:
|
|
- target:
|
|
entity_id: input_boolean.pc_mike_lock
|
|
action: input_boolean.turn_off
|
|
- action: switch.turn_on
|
|
target:
|
|
entity_id: switch.pc_mike_wol
|
|
mode: single
|
|
- alias: Dim lights weekdays after 23:00
|
|
mode: single
|
|
triggers:
|
|
- trigger: time
|
|
at: '23:00:00'
|
|
conditions:
|
|
- condition: time
|
|
weekday:
|
|
- mon
|
|
- tue
|
|
- wed
|
|
- thu
|
|
- sun
|
|
actions:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_pct: 5
|
|
target:
|
|
device_id:
|
|
- 2174e320c3d355e2ec34162a89c6a842
|
|
- 02fffc146db35f9170df1998a6812199
|
|
- action: light.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
device_id:
|
|
- 2174e320c3d355e2ec34162a89c6a842
|
|
- 02fffc146db35f9170df1998a6812199
|
|
- alias: Undim lights weekdays after 06:40
|
|
mode: single
|
|
triggers:
|
|
- trigger: time
|
|
at: 06:40:00
|
|
conditions:
|
|
- condition: time
|
|
weekday:
|
|
- mon
|
|
- tue
|
|
- wed
|
|
- thu
|
|
- fri
|
|
actions:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_pct: 70
|
|
target:
|
|
device_id:
|
|
- 2174e320c3d355e2ec34162a89c6a842
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_pct: 50
|
|
target:
|
|
device_id: 02fffc146db35f9170df1998a6812199
|
|
- action: light.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
device_id:
|
|
- 2174e320c3d355e2ec34162a89c6a842
|
|
- 02fffc146db35f9170df1998a6812199
|
|
- alias: Dim lights weekends after 24:00
|
|
mode: single
|
|
triggers:
|
|
- trigger: time
|
|
at: 00:00:00
|
|
conditions:
|
|
- condition: time
|
|
weekday:
|
|
- fri
|
|
- sat
|
|
actions:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_pct: 5
|
|
target:
|
|
device_id:
|
|
- 2174e320c3d355e2ec34162a89c6a842
|
|
- 02fffc146db35f9170df1998a6812199
|
|
- action: light.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
device_id:
|
|
- 2174e320c3d355e2ec34162a89c6a842
|
|
- 02fffc146db35f9170df1998a6812199
|
|
- alias: Undim lights weekends after 08:00
|
|
mode: single
|
|
triggers:
|
|
- trigger: time
|
|
at: 08:00:00
|
|
conditions:
|
|
- condition: time
|
|
weekday:
|
|
- sat
|
|
- sun
|
|
actions:
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_pct: 70
|
|
target:
|
|
device_id:
|
|
- 2174e320c3d355e2ec34162a89c6a842
|
|
- action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_pct: 70
|
|
target:
|
|
device_id: 02fffc146db35f9170df1998a6812199
|
|
- action: light.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
device_id:
|
|
- 2174e320c3d355e2ec34162a89c6a842
|
|
- 02fffc146db35f9170df1998a6812199
|
|
- alias: Update Moving Average Daily Power Usage
|
|
mode: single
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- sensor.p1_meter_energy_import
|
|
conditions: []
|
|
actions:
|
|
- action: homeassistant.update_entity
|
|
metadata: {}
|
|
data:
|
|
entity_id:
|
|
- sensor.gemiddeld_vebruik_per_dag
|
|
- alias: Hal aan, bij bezetting
|
|
mode: single
|
|
triggers:
|
|
- type: occupied
|
|
device_id: 2d02a851db74e4ec11ff3ae22e450821
|
|
entity_id: 5b2d8aa75dc98370228e34e3f24ba0f0
|
|
domain: binary_sensor
|
|
trigger: device
|
|
- type: occupied
|
|
device_id: e2ef60d6f1f976dfe0c364719b5b79a8
|
|
entity_id: d5b47dc01767e563447c9dc9186ccd8b
|
|
domain: binary_sensor
|
|
trigger: device
|
|
conditions:
|
|
- condition: or
|
|
conditions:
|
|
- type: is_illuminance
|
|
condition: device
|
|
device_id: e2ef60d6f1f976dfe0c364719b5b79a8
|
|
entity_id: d22554a54b78d98ebdefb3868985c414
|
|
domain: sensor
|
|
below: 1200
|
|
- type: is_illuminance
|
|
condition: device
|
|
device_id: 2d02a851db74e4ec11ff3ae22e450821
|
|
entity_id: bbed1d39984abbf24b5008d8a96e37f0
|
|
domain: sensor
|
|
below: 10
|
|
actions:
|
|
- action: light.turn_on
|
|
target:
|
|
entity_id: light.hal
|
|
- alias: Hal uit, zonder bezetting
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- binary_sensor.motion_hal_occupancy
|
|
- binary_sensor.motion_kapstok_occupancy
|
|
to: 'off'
|
|
condition:
|
|
- condition: state
|
|
entity_id: light.hal
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: binary_sensor.motion_hal_occupancy
|
|
state: 'off'
|
|
- condition: state
|
|
entity_id: binary_sensor.motion_kapstok_occupancy
|
|
state: 'off'
|
|
actions:
|
|
- action: light.turn_off
|
|
target:
|
|
entity_id: light.hal
|
|
- alias: Kantoor aan, bij beweging
|
|
mode: single
|
|
triggers:
|
|
- type: occupied
|
|
device_id: 668ef345afec87b1f1aec4ddd46187e3
|
|
entity_id: 5a360ab6b47bd6ab824c3d2f358ebca3
|
|
domain: binary_sensor
|
|
trigger: device
|
|
conditions:
|
|
- type: is_illuminance
|
|
condition: device
|
|
device_id: 668ef345afec87b1f1aec4ddd46187e3
|
|
entity_id: 89fb1f48db5b3b5330e443c3b19c5124
|
|
domain: sensor
|
|
below: 1200
|
|
- condition: device
|
|
type: is_off
|
|
device_id: f9a01f0ec04b3b6cbcc5aefdce7ae76c
|
|
entity_id: ceab16e01605389230a9da19817409d5
|
|
domain: light
|
|
actions:
|
|
- action: light.turn_on
|
|
target:
|
|
entity_id: light.kantoor
|
|
- alias: Kantoor aan lamp, donker
|
|
mode: single
|
|
triggers:
|
|
- type: illuminance
|
|
device_id: 668ef345afec87b1f1aec4ddd46187e3
|
|
entity_id: 89fb1f48db5b3b5330e443c3b19c5124
|
|
domain: sensor
|
|
trigger: device
|
|
below: 1200
|
|
conditions:
|
|
- condition: or
|
|
conditions:
|
|
- condition: not
|
|
conditions:
|
|
- condition: device
|
|
device_id: 9d29e8a29d0e305aaa42131571850594
|
|
domain: media_player
|
|
entity_id: a65b8647d257fce5cf20eb79392a1cfa
|
|
type: is_off
|
|
- condition: not
|
|
conditions:
|
|
- condition: device
|
|
device_id: 9d29e8a29d0e305aaa42131571850594
|
|
domain: media_player
|
|
entity_id: a65b8647d257fce5cf20eb79392a1cfa
|
|
type: is_idle
|
|
actions:
|
|
- action: light.turn_on
|
|
target:
|
|
entity_id: light.kantoor
|
|
- alias: Kantoor uit, geen beweging en monitor uit.
|
|
mode: single
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- binary_sensor.motion_kantoor_occupancy
|
|
to: 'off'
|
|
conditions:
|
|
- condition: state
|
|
entity_id: light.kantoor
|
|
state: 'on'
|
|
- condition: or
|
|
conditions:
|
|
- condition: state
|
|
entity_id: media_player.32_odyssey_oled_g8
|
|
state: 'off'
|
|
- condition: state
|
|
entity_id: media_player.32_odyssey_oled_g8
|
|
state: standby
|
|
actions:
|
|
- action: light.turn_off
|
|
target:
|
|
entity_id: light.kantoor
|
|
- alias: Kantoor uit, monitor uit en geen beweging.
|
|
mode: single
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- media_player.32_odyssey_oled_g8
|
|
to: 'off'
|
|
- trigger: state
|
|
entity_id:
|
|
- media_player.32_odyssey_oled_g8
|
|
to: idle
|
|
conditions:
|
|
- condition: state
|
|
entity_id: light.kantoor
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: binary_sensor.motion_kantoor_occupancy
|
|
state: 'off'
|
|
actions:
|
|
- action: light.turn_off
|
|
target:
|
|
entity_id: light.kantoor
|
|
- alias: Turn on NAS 09:00 on weekends.
|
|
description: ''
|
|
mode: single
|
|
triggers:
|
|
- trigger: time
|
|
at: 09:30:00
|
|
conditions:
|
|
- condition: time
|
|
weekday:
|
|
- sat
|
|
- sun
|
|
actions:
|
|
- action: wake_on_lan.send_magic_packet
|
|
data:
|
|
mac: secret nasmac
|
|
broadcast_address: secret nasbroadcast
|
|
- delay: 00:00:10
|
|
- action: shell_command.nas_cpu
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_cpu
|
|
- action: shell_command.nas_ram
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_ram
|
|
- action: shell_command.nas_container_count
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_container_count
|
|
- action: shell_command.nas_container_stopped
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_container_stopped
|
|
- action: shell_command.nas_container_paused
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_container_paused
|
|
- action: shell_command.nas_avg_disk_temp
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_avg_disk_temp
|
|
- action: shell_command.nas_uptime
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_uptime
|
|
- alias: Turn on NAS 16:00 on weekdays.
|
|
mode: single
|
|
triggers:
|
|
- trigger: time
|
|
at: '16:00:00'
|
|
conditions:
|
|
- condition: time
|
|
weekday:
|
|
- mon
|
|
- tue
|
|
- wed
|
|
- thu
|
|
- fri
|
|
actions:
|
|
- action: wake_on_lan.send_magic_packet
|
|
data:
|
|
mac: secret nasmac
|
|
broadcast_address: secret nasbroadcast
|
|
- delay: 00:00:10
|
|
- action: shell_command.nas_cpu
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_cpu
|
|
- action: shell_command.nas_ram
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_ram
|
|
- action: shell_command.nas_container_count
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_container_count
|
|
- action: shell_command.nas_container_stopped
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_container_stopped
|
|
- action: shell_command.nas_container_paused
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_container_paused
|
|
- action: shell_command.nas_avg_disk_temp
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_avg_disk_temp
|
|
- action: shell_command.nas_uptime
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_uptime
|
|
- alias: Turn off NAS during the night.
|
|
mode: single
|
|
triggers:
|
|
- trigger: time
|
|
at: 00:10:00
|
|
actions:
|
|
- action: shell_command.nas_off
|
|
- alias: Run NAS Commands Daily at 16:30
|
|
trigger:
|
|
- platform: time
|
|
at: '16:30:00'
|
|
action:
|
|
- action: shell_command.nas_cpu
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_cpu
|
|
- action: shell_command.nas_ram
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_ram
|
|
- action: shell_command.nas_container_count
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_container_count
|
|
- action: shell_command.nas_container_stopped
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_container_stopped
|
|
- action: shell_command.nas_container_paused
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_container_paused
|
|
- action: shell_command.nas_avg_disk_temp
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_avg_disk_temp
|
|
- action: shell_command.nas_uptime
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.nas_uptime
|
|
- alias: Fetch Random JPEG Data Every minute
|
|
trigger:
|
|
- platform: time_pattern
|
|
seconds: /10
|
|
action:
|
|
- action: shell_command.random_immich_photo_json
|
|
- action: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.random_immich_photo_json
|
|
- alias: person_home
|
|
id: '8423590985012'
|
|
mode: parallel
|
|
trigger:
|
|
platform: state
|
|
entity_id:
|
|
- person.mike
|
|
- person.anna
|
|
from:
|
|
- home
|
|
- not_home
|
|
to:
|
|
- home
|
|
- not_home
|
|
action:
|
|
action: mqtt.publish
|
|
data:
|
|
topic: 'homeassistant/persistence/{{ trigger.to_state.name | lower }}
|
|
|
|
'
|
|
payload: '{{ now() }}
|
|
|
|
'
|
|
retain: true
|
|
- alias: WC aan, bij bezetting
|
|
description: Turn on WC light when occupied
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presence_wc_presence
|
|
to: 'on'
|
|
action:
|
|
- service: light.turn_on
|
|
target:
|
|
entity_id: light.toilet
|
|
- alias: WC uit, zonder bezetting
|
|
description: Turn off WC light when unoccupied
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presence_wc_presence
|
|
to: 'off'
|
|
condition:
|
|
- condition: state
|
|
entity_id: light.toilet
|
|
state: 'on'
|
|
action:
|
|
- service: light.turn_off
|
|
target:
|
|
entity_id: light.toilet
|
|
- alias: Douche aan, bij bezetting
|
|
description: Turn on shower light when occupied
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presence_douche_presence
|
|
to: 'on'
|
|
action:
|
|
- service: light.turn_on
|
|
target:
|
|
entity_id: light.badkamer
|
|
- alias: Douche uit, zonder bezetting
|
|
description: Turn off shower light when unoccupied
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presence_douche_presence
|
|
to: 'off'
|
|
condition:
|
|
- condition: state
|
|
entity_id: light.badkamer
|
|
state: 'on'
|
|
action:
|
|
- service: light.turn_off
|
|
target:
|
|
entity_id: light.badkamer
|
|
- alias: Washok aan, bij bezetting
|
|
description: Turn on shower light when occupied
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presence_washok_presence
|
|
to: 'on'
|
|
action:
|
|
- service: light.turn_on
|
|
target:
|
|
entity_id: light.washok
|
|
- alias: Washok uit, zonder bezetting
|
|
description: Turn off shower light when unoccupied
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presence_washok_presence
|
|
to: 'off'
|
|
condition:
|
|
- condition: state
|
|
entity_id: light.washok
|
|
state: 'on'
|
|
action:
|
|
- service: light.turn_off
|
|
target:
|
|
entity_id: light.washok
|
|
- alias: Set active spotify player when spotify state changes
|
|
mode: single
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- media_player.spotify
|
|
- media_player.spotify_anna
|
|
conditions: []
|
|
actions:
|
|
- action: script.select_active_spotify_player
|
|
- alias: Switch to Anna's Account if Spotify Source Changes
|
|
mode: single
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- media_player.spotify
|
|
attribute: source
|
|
from: '[LG] webOS TV OLED55C46LA'
|
|
to: iPhone
|
|
- trigger: state
|
|
entity_id:
|
|
- media_player.spotify
|
|
attribute: source
|
|
from: '[LG] webOS TV OLED55C46LA'
|
|
to: DESKTOP-VQI6KC7
|
|
conditions:
|
|
- condition: or
|
|
conditions:
|
|
- condition: state
|
|
entity_id: media_player.spotify_anna
|
|
state: 'off'
|
|
- condition: state
|
|
entity_id: media_player.spotify_anna
|
|
state: idle
|
|
- condition: state
|
|
entity_id: media_player.spotify_anna
|
|
state: standby
|
|
- condition: state
|
|
entity_id: media_player.spotify_anna
|
|
state: paused
|
|
actions:
|
|
- action: spotcast.start
|
|
data:
|
|
account: anna
|
|
entity_id: media_player.lg_webos_tv_oled55c46la
|
|
shuffle: true
|
|
random_song: true
|
|
force_playback: true
|
|
- alias: Switch to Mike's Account if Anna's Spotify Source Changes
|
|
mode: single
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- media_player.spotify_anna
|
|
attribute: Source
|
|
from: '[LG] webOS TV OLED55C46LA'
|
|
to: iPhone
|
|
conditions:
|
|
- condition: or
|
|
conditions:
|
|
- condition: state
|
|
entity_id: media_player.spotify
|
|
state: 'off'
|
|
- condition: state
|
|
entity_id: media_player.spotify
|
|
state: idle
|
|
- condition: state
|
|
entity_id: media_player.spotify
|
|
state: standby
|
|
- condition: state
|
|
entity_id: media_player.spotify
|
|
state: paused
|
|
actions:
|
|
- action: spotcast.start
|
|
data:
|
|
account: mike
|
|
entity_id: media_player.lg_webos_tv_oled55c46la
|
|
shuffle: true
|
|
random_song: true
|
|
force_playback: true
|