1
0
ansible-home-assistant/roles/automations/files/bathroom-shower-motion.yaml

70 lines
2.1 KiB
YAML
Raw Permalink Normal View History

- id: bathroom_shower_motion_on
2021-01-07 00:48:14 +00:00
alias: '[Bathroom] Shower Motion On'
2021-01-01 02:59:21 +00:00
mode: restart
trigger:
- platform: state
2023-06-07 16:17:45 +00:00
entity_id: binary_sensor.bathroom_shower_sensor_motion
2021-01-01 02:59:21 +00:00
from: 'off'
to: 'on'
action:
- service: script.bathroom_shower_lights_on
- choose:
- conditions:
- condition: state
entity_id: media_player.bathroom
state: playing
- condition: numeric_state
entity_id: media_player.bedroom
attribute: volume_level
below: 0.65
sequence:
- service: media_player.volume_set
data:
volume_level: 0.65
target:
entity_id: media_player.bathroom
2021-05-10 10:24:31 +00:00
- id: bathroom_shower_motion_off
alias: '[Bathroom] Shower Motion Off'
2021-01-01 02:59:21 +00:00
mode: restart
trigger:
- platform: state
2023-06-07 16:17:45 +00:00
entity_id: binary_sensor.bathroom_shower_sensor_motion
for: '0:02:00'
2021-01-01 02:59:21 +00:00
from: 'on'
to: 'off'
- platform: state
entity_id: binary_sensor.bathroom_motion_occupancy
for: '0:05:00'
from: 'on'
to: 'off'
condition:
- condition: state
2023-06-07 16:17:45 +00:00
entity_id: binary_sensor.bathroom_shower_sensor_motion
for: '0:02:00'
state: 'off'
2021-01-01 02:59:21 +00:00
action:
- service: script.bathroom_shower_lights_off
- choose:
- conditions:
- condition: state
entity_id: media_player.bathroom
state: playing
sequence:
2022-04-29 19:24:36 +00:00
- repeat:
until:
- condition: numeric_state
2022-04-29 19:24:36 +00:00
entity_id: media_player.bathroom
attribute: volume_level
below: '0.45'
2022-04-29 19:24:36 +00:00
sequence:
- service: media_player.volume_down
target:
entity_id: media_player.bathroom
- delay:
seconds: 10
- service: media_player.volume_set
data:
volume_level: 0.45
target:
entity_id: media_player.bathroom