Add basic automation for bathroom switch

This commit is contained in:
2020-05-13 21:23:51 +03:00
parent 296f2e3169
commit 351ac94c08
4 changed files with 37 additions and 0 deletions
@@ -287,6 +287,8 @@ cards:
entity: sensor.desk_switch_power
- type: custom:battery-entity
entity: sensor.master_bedroom_bedside_switch_power
- type: custom:battery-entity
entity: sensor.bathroom_switch_power
- type: divider
- type: custom:battery-entity
entity: sensor.motion_1_power
+20
View File
@@ -102,6 +102,26 @@ automation:
push:
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:
customize:
media_player.master_bedroom:
@@ -91,3 +91,17 @@ automation:
- service: script.say
data:
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
+1
View File
@@ -51,6 +51,7 @@ platinum_password: pass
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
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
sonos_hosts: