409 lines
9.8 KiB
YAML
409 lines
9.8 KiB
YAML
- id: tv_turned_on
|
|
alias: TV turned on
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: media_player.tv
|
|
to: 'on'
|
|
actions:
|
|
- action: media_player.turn_on
|
|
entity_id: media_player.yamaha
|
|
- action: media_player.select_source
|
|
data:
|
|
entity_id: media_player.yamaha
|
|
source: Optical
|
|
- action: rest_command.yamaha_set_speaker
|
|
data:
|
|
speaker: A
|
|
enable: 'true'
|
|
- action: rest_command.yamaha_set_speaker
|
|
data:
|
|
speaker: B
|
|
enable: 'false'
|
|
- choose:
|
|
- conditions:
|
|
- condition: time
|
|
after: '10:00:00'
|
|
before: '12:00:00'
|
|
sequence:
|
|
- device_id: ec2fe7d396cef72ecca9b83e7419847e
|
|
domain: cover
|
|
entity_id: cover.blind2
|
|
type: set_position
|
|
position: 0
|
|
enabled: false
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 2
|
|
milliseconds: 0
|
|
- choose:
|
|
- conditions:
|
|
- condition: numeric_state
|
|
entity_id: media_player.yamaha
|
|
attribute: volume_level
|
|
below: 0.5
|
|
sequence:
|
|
- action: media_player.volume_set
|
|
data:
|
|
entity_id: media_player.yamaha
|
|
volume_level: 0.5
|
|
initial_state: 'on'
|
|
mode: single
|
|
- id: tv_turned_off
|
|
alias: TV turned off
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: media_player.tv
|
|
to: 'off'
|
|
actions:
|
|
- action: media_player.select_source
|
|
data:
|
|
entity_id: media_player.yamaha
|
|
source: Spotify
|
|
- condition: time
|
|
after: '11:00'
|
|
before: '13:00'
|
|
- device_id: ec2fe7d396cef72ecca9b83e7419847e
|
|
domain: cover
|
|
entity_id: cover.blind2
|
|
type: set_position
|
|
position: 100
|
|
initial_state: 'on'
|
|
mode: single
|
|
- alias: Lights on in the evening
|
|
id: lights_on_in_the_evening
|
|
triggers:
|
|
- trigger: sun
|
|
event: sunset
|
|
offset: -00:10:00
|
|
conditions:
|
|
- condition: state
|
|
entity_id: person.martin
|
|
state: home
|
|
actions:
|
|
- action: scene.turn_on
|
|
target:
|
|
entity_id: scene.normal
|
|
data:
|
|
transition: 1200
|
|
- action: light.turn_on
|
|
data:
|
|
transition: 600
|
|
brightness_pct: 68
|
|
target:
|
|
area_id: bedroom
|
|
- id: lights_on_arrival
|
|
alias: Lights On Arrival
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: person.martin
|
|
to: home
|
|
conditions:
|
|
- condition: sun
|
|
after: sunset
|
|
after_offset: -00:10:00
|
|
before: sunrise
|
|
actions:
|
|
- action: light.turn_on
|
|
entity_id: light.hall
|
|
- action: scene.turn_on
|
|
target:
|
|
entity_id: scene.normal
|
|
- action: light.turn_on
|
|
data:
|
|
brightness_pct: 68
|
|
target:
|
|
area_id: bedroom
|
|
- id: sound_controller_volume_down
|
|
alias: Sound Controller Volume Down
|
|
triggers:
|
|
trigger: event
|
|
event_type: deconz_event
|
|
event_data:
|
|
id: sound_controller
|
|
event: 3001
|
|
actions:
|
|
- action: script.turn_on
|
|
data:
|
|
entity_id: script.volume_down_loop
|
|
- id: sound_controller_volume_up
|
|
alias: Sound Controller Volume Up
|
|
triggers:
|
|
trigger: event
|
|
event_type: deconz_event
|
|
event_data:
|
|
id: sound_controller
|
|
event: 2001
|
|
actions:
|
|
- action: script.turn_on
|
|
data:
|
|
entity_id: script.volume_up_loop
|
|
- id: sound_controller_volume_stop
|
|
alias: Sound Controller Volume Stop
|
|
triggers:
|
|
trigger: event
|
|
event_type: deconz_event
|
|
event_data:
|
|
id: sound_controller
|
|
condition: '{{ trigger.event.data.event not in [3001, 2001] }}'
|
|
actions:
|
|
- action: script.turn_off
|
|
data:
|
|
entity_id: script.volume_up_loop
|
|
- action: script.turn_off
|
|
data:
|
|
entity_id: script.volume_down_loop
|
|
- id: sound_controller_switch_yamaha
|
|
alias: Sound Controller Turn On
|
|
triggers:
|
|
- trigger: event
|
|
event_type: deconz_event
|
|
event_data:
|
|
id: sound_controller
|
|
event: 1002
|
|
conditions:
|
|
- condition: state
|
|
entity_id: media_player.yamaha
|
|
state: 'off'
|
|
actions:
|
|
- action: media_player.turn_on
|
|
data:
|
|
entity_id: media_player.yamaha
|
|
mode: single
|
|
- id: lights_off
|
|
alias: Lights off
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: person.martin
|
|
to: not_home
|
|
- trigger: time
|
|
at: '4:00:00'
|
|
actions:
|
|
- action: light.turn_off
|
|
entity_id: all
|
|
- id: freezer_open_alert
|
|
alias: Freezer Open Alert
|
|
triggers:
|
|
trigger: state
|
|
entity_id: binary_sensor.freezer_door
|
|
to: 'on'
|
|
for: 00:10:00
|
|
actions:
|
|
- action: persistent_notification.create
|
|
data:
|
|
title: Freezer open for over 10 minutes
|
|
message: Freezer open for over 10 minutes.
|
|
notification_id: freezer_open_alert
|
|
- action: notify.email
|
|
data:
|
|
title: Freezer open for over 10 minutes
|
|
message: Freezer open for over 10 minutes.
|
|
- id: '1607179755688'
|
|
alias: Turn off heating
|
|
description: ''
|
|
triggers:
|
|
- trigger: time
|
|
at: input_datetime.heating_off_time
|
|
condition: []
|
|
actions:
|
|
- action: climate.turn_off
|
|
data: {}
|
|
entity_id: climate.heating
|
|
mode: single
|
|
- id: '1607525870870'
|
|
alias: Sound Controller Pause/Resume Spotify
|
|
triggers:
|
|
- trigger: event
|
|
event_type: deconz_event
|
|
event_data:
|
|
id: sound_controller
|
|
event: 1002
|
|
condition: '{{ is_state_attr(''media_player.yamaha'', ''source'', ''Spotify'') }}'
|
|
actions:
|
|
- action: media_player.media_play_pause
|
|
data:
|
|
entity_id: media_player.yamaha
|
|
mode: single
|
|
- id: '1607526213723'
|
|
alias: Sound Controller Mute/Unmute
|
|
triggers:
|
|
- trigger: event
|
|
event_type: deconz_event
|
|
event_data:
|
|
id: sound_controller
|
|
event: 1002
|
|
condition: '{{ not is_state(''media_player.yamaha'', ''off'') and not is_state_attr(''media_player.yamaha'',
|
|
''source'', ''Spotify'') }}'
|
|
actions:
|
|
- action: media_player.volume_mute
|
|
data:
|
|
entity_id: media_player.yamaha
|
|
is_volume_muted: '{{ is_state_attr(''media_player.yamaha'', ''is_volume_muted'',
|
|
false) }}'
|
|
mode: single
|
|
- id: nightstand_switch_all_off
|
|
alias: Nightstand Switch Off
|
|
triggers:
|
|
- trigger: event
|
|
event_type: deconz_event
|
|
event_data:
|
|
id: bedroom_nightstand_switch
|
|
event: 2002
|
|
conditions:
|
|
- condition: state
|
|
entity_id: light.bedroom_lights
|
|
state: 'off'
|
|
for:
|
|
seconds: 1
|
|
actions:
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ states[''light''] | selectattr(''state'',''eq'', ''on'')
|
|
| list | count > 0 }}'
|
|
sequence:
|
|
- action: light.turn_off
|
|
entity_id: all
|
|
- conditions:
|
|
- condition: time
|
|
after: 05:30:00
|
|
before: '12:00:00'
|
|
sequence:
|
|
- action: cover.open_cover
|
|
entity_id: cover.all_blinds
|
|
- action: light.turn_on
|
|
data:
|
|
entity_id: light.kitchen_unit
|
|
brightness_pct: 70
|
|
color_temp_kelvin: 2700
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.heat_in_the_morning
|
|
state: 'on'
|
|
sequence:
|
|
- action: climate.turn_on
|
|
data:
|
|
entity_id: climate.heating
|
|
- action: media_player.turn_on
|
|
entity_id: media_player.yamaha
|
|
- action: media_player.select_source
|
|
data:
|
|
entity_id: media_player.yamaha
|
|
source: Server
|
|
- action: rest_command.yamaha_set_speaker
|
|
data:
|
|
speaker: A
|
|
enable: 'true'
|
|
- action: rest_command.yamaha_set_speaker
|
|
data:
|
|
speaker: B
|
|
enable: 'true'
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 8
|
|
milliseconds: 0
|
|
- action: media_player.volume_set
|
|
data:
|
|
entity_id: media_player.yamaha
|
|
volume_level: 0.5
|
|
- action: weather.get_forecasts
|
|
target:
|
|
entity_id: weather.forecast
|
|
data:
|
|
type: daily
|
|
response_variable: daily
|
|
- action: tts.google_say
|
|
data:
|
|
entity_id: media_player.yamaha
|
|
message: '"Good morning Martin!" "It''s currently {{states(''sensor.outside_temperature'')}}
|
|
outside" "and {{states(''sensor.living_room_temperature'')}} inside."
|
|
"Today''s high will be {{ daily[''weather.forecast''].forecast[0].temperature
|
|
}} degrees." '
|
|
mode: single
|
|
- id: nightstand_switch_on
|
|
alias: Nightstand Switch On
|
|
triggers:
|
|
- trigger: event
|
|
event_type: deconz_event
|
|
event_data:
|
|
id: bedroom_nightstand_switch
|
|
event: 1002
|
|
conditions:
|
|
- condition: state
|
|
entity_id: light.bedroom_lights
|
|
state: 'on'
|
|
for:
|
|
seconds: 1
|
|
actions:
|
|
- action: light.turn_off
|
|
target:
|
|
area_id: '{{ area_id(''Living Room'') }}'
|
|
- action: light.turn_on
|
|
data:
|
|
entity_id: light.bedroom_lights
|
|
brightness: 24
|
|
- id: tasmota_on
|
|
alias: Tasmota On
|
|
initial_state: false
|
|
triggers:
|
|
trigger: event
|
|
event_type: deconz_event
|
|
event_data:
|
|
id: bedroom_nightstand_switch
|
|
event: 2001
|
|
actions:
|
|
- action: mqtt.publish
|
|
data:
|
|
topic: cmnd/tasmota1/POWER
|
|
payload: true
|
|
- id: tasmota_off
|
|
alias: Tasmota Off
|
|
initial_state: false
|
|
triggers:
|
|
trigger: event
|
|
event_type: deconz_event
|
|
event_data:
|
|
id: bedroom_nightstand_switch
|
|
event: 2003
|
|
actions:
|
|
- action: mqtt.publish
|
|
data:
|
|
topic: cmnd/tasmota1/POWER
|
|
payload: false
|
|
- id: tasmota_on_off
|
|
alias: Tasmota On Off
|
|
initial_state: false
|
|
triggers:
|
|
trigger: event
|
|
event_type: deconz_event
|
|
event_data:
|
|
id: bedroom_nightstand_switch
|
|
event: 2002
|
|
actions:
|
|
- action: mqtt.publish
|
|
data:
|
|
topic: cmnd/tasmota1/POWER
|
|
payload: true
|
|
- delay:
|
|
seconds: 2
|
|
- action: mqtt.publish
|
|
data:
|
|
topic: cmnd/tasmota1/POWER
|
|
payload: false
|
|
- id: airplay_turned_off
|
|
alias: Airplay Turned Off
|
|
initial_state: true
|
|
triggers:
|
|
- trigger: template
|
|
value_template: '{{ not is_state_attr(''media_player.apple_tv'', ''app_id'', ''com.apple.TVAirPlay'')
|
|
}}'
|
|
actions:
|
|
- condition: time
|
|
after: '11:00'
|
|
before: '13:00'
|
|
- action: script.turn_on
|
|
data:
|
|
entity_id: script.apple_tv_sleep
|