mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-09 10:14:41 +00:00
Add basic automation for bathroom switch
This commit is contained in:
@@ -287,6 +287,8 @@ cards:
|
|||||||
entity: sensor.desk_switch_power
|
entity: sensor.desk_switch_power
|
||||||
- type: custom:battery-entity
|
- type: custom:battery-entity
|
||||||
entity: sensor.master_bedroom_bedside_switch_power
|
entity: sensor.master_bedroom_bedside_switch_power
|
||||||
|
- type: custom:battery-entity
|
||||||
|
entity: sensor.bathroom_switch_power
|
||||||
- type: divider
|
- type: divider
|
||||||
- type: custom:battery-entity
|
- type: custom:battery-entity
|
||||||
entity: sensor.motion_1_power
|
entity: sensor.motion_1_power
|
||||||
|
|||||||
@@ -102,6 +102,26 @@ automation:
|
|||||||
push:
|
push:
|
||||||
thread-id: "sonos"
|
thread-id: "sonos"
|
||||||
|
|
||||||
|
- alias: Media · Sonos · Volume up on bathroom switch click
|
||||||
|
trigger:
|
||||||
|
platform: event
|
||||||
|
event_type: zha_event
|
||||||
|
event_data:
|
||||||
|
device_ieee: !secret bathroom_switch_ieee
|
||||||
|
command: single
|
||||||
|
action:
|
||||||
|
- service: media_player.volume_set
|
||||||
|
entity_id: media_player.bathroom
|
||||||
|
data_template:
|
||||||
|
volume_level: >-
|
||||||
|
|
||||||
|
{% if state_attr('media_player.bathroom', 'volume_level')|float > 0.5 %}
|
||||||
|
0.2
|
||||||
|
{% else %}
|
||||||
|
0.55
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
homeassistant:
|
homeassistant:
|
||||||
customize:
|
customize:
|
||||||
media_player.master_bedroom:
|
media_player.master_bedroom:
|
||||||
|
|||||||
@@ -91,3 +91,17 @@ automation:
|
|||||||
- service: script.say
|
- service: script.say
|
||||||
data:
|
data:
|
||||||
message: "Just wanted to let you know - a new PDS is available!"
|
message: "Just wanted to let you know - a new PDS is available!"
|
||||||
|
|
||||||
|
- alias: Youtube · play latest pds on bathroom switch dobule click
|
||||||
|
trigger:
|
||||||
|
platform: event
|
||||||
|
event_type: zha_event
|
||||||
|
event_data:
|
||||||
|
device_ieee: !secret bathroom_switch_ieee
|
||||||
|
command: double
|
||||||
|
action:
|
||||||
|
- service: media_player.volume_set
|
||||||
|
entity_id: media_player.bathroom
|
||||||
|
data:
|
||||||
|
volume_level: 0.55
|
||||||
|
- service: script.youtube_play_latest_pds
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ platinum_password: pass
|
|||||||
master_bedroom_bedside_switch_ieee: 00:00:00:00:00:00:00:00
|
master_bedroom_bedside_switch_ieee: 00:00:00:00:00:00:00:00
|
||||||
master_bedroom_switch_ieee: 00:00:00:00:00:00:00:00
|
master_bedroom_switch_ieee: 00:00:00:00:00:00:00:00
|
||||||
desk_switch_ieee: 00:00:00:00:00:00:00:00
|
desk_switch_ieee: 00:00:00:00:00:00:00:00
|
||||||
|
bathroom_switch_ieee: 00:00:00:00:00:00:00:00
|
||||||
magic_cube_ieee: 00:00:00:00:00:00:00:00
|
magic_cube_ieee: 00:00:00:00:00:00:00:00
|
||||||
|
|
||||||
sonos_hosts:
|
sonos_hosts:
|
||||||
|
|||||||
Reference in New Issue
Block a user