mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-09-06 01:48:44 +00:00
Implement switches as automations
This commit is contained in:
+2
-2
@@ -6,14 +6,14 @@ source "$(dirname $0)/utils.sh"
|
|||||||
log "[upload] deleting old folders..."
|
log "[upload] deleting old folders..."
|
||||||
|
|
||||||
ssh $REMOTE_HOST -p $REMOTE_PORT \
|
ssh $REMOTE_HOST -p $REMOTE_PORT \
|
||||||
"rm -rf $REMOTE_REPO_PATH/config/{custom_scripts,lovelace,packages,templates}"
|
"rm -rf $REMOTE_REPO_PATH/config/{blueprints,custom_scripts,lovelace,packages,templates}"
|
||||||
|
|
||||||
log "[upload] ${LIGHT_GREEN}delete done${NO_FORMAT}"
|
log "[upload] ${LIGHT_GREEN}delete done${NO_FORMAT}"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
log "[upload] reuploading..."
|
log "[upload] reuploading..."
|
||||||
scp -P $REMOTE_PORT \
|
scp -P $REMOTE_PORT \
|
||||||
-r config/{custom_scripts,lovelace,packages,templates,themes,*.yaml} \
|
-r config/{blueprints,custom_scripts,lovelace,packages,templates,themes,*.yaml} \
|
||||||
"${REMOTE_HOST}:${REMOTE_REPO_PATH}/config" > /dev/null
|
"${REMOTE_HOST}:${REMOTE_REPO_PATH}/config" > /dev/null
|
||||||
|
|
||||||
log "[upload] ${LIGHT_GREEN}reupload done${NO_FORMAT}"
|
log "[upload] ${LIGHT_GREEN}reupload done${NO_FORMAT}"
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
blueprint:
|
||||||
|
name: Aqara single switch
|
||||||
|
domain: automation
|
||||||
|
input:
|
||||||
|
z2m_topic:
|
||||||
|
click:
|
||||||
|
default: []
|
||||||
|
double_click:
|
||||||
|
default: []
|
||||||
|
hold:
|
||||||
|
default: []
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
platform: mqtt
|
||||||
|
topic: !input z2m_topic
|
||||||
|
|
||||||
|
action:
|
||||||
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ trigger.payload_json.click == 'single' }}"
|
||||||
|
sequence: !input click
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ trigger.payload_json.click == 'double' }}"
|
||||||
|
sequence: !input double_click
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ trigger.payload_json.action == 'hold' }}"
|
||||||
|
sequence: !input hold
|
||||||
@@ -0,0 +1,204 @@
|
|||||||
|
blueprint:
|
||||||
|
name: Oppo 6 button switch controls
|
||||||
|
domain: automation
|
||||||
|
input:
|
||||||
|
opple_z2m_name:
|
||||||
|
action_sensor:
|
||||||
|
button_1_single:
|
||||||
|
default: []
|
||||||
|
button_1_double:
|
||||||
|
default: []
|
||||||
|
button_1_triple:
|
||||||
|
default: []
|
||||||
|
button_1_release:
|
||||||
|
default: []
|
||||||
|
button_2_single:
|
||||||
|
default: []
|
||||||
|
button_2_double:
|
||||||
|
default: []
|
||||||
|
button_2_triple:
|
||||||
|
default: []
|
||||||
|
button_2_release:
|
||||||
|
default: []
|
||||||
|
button_3_single:
|
||||||
|
default: []
|
||||||
|
button_3_double:
|
||||||
|
default: []
|
||||||
|
button_3_triple:
|
||||||
|
default: []
|
||||||
|
button_3_release:
|
||||||
|
default: []
|
||||||
|
button_4_single:
|
||||||
|
default: []
|
||||||
|
button_4_double:
|
||||||
|
default: []
|
||||||
|
button_4_triple:
|
||||||
|
default: []
|
||||||
|
button_4_release:
|
||||||
|
default: []
|
||||||
|
button_5_single:
|
||||||
|
default: []
|
||||||
|
button_5_double:
|
||||||
|
default: []
|
||||||
|
button_5_triple:
|
||||||
|
default: []
|
||||||
|
button_5_release:
|
||||||
|
default: []
|
||||||
|
button_6_single:
|
||||||
|
default: []
|
||||||
|
button_6_double:
|
||||||
|
default: []
|
||||||
|
button_6_triple:
|
||||||
|
default: []
|
||||||
|
button_6_release:
|
||||||
|
default: []
|
||||||
|
|
||||||
|
mode: queued
|
||||||
|
trigger:
|
||||||
|
platform: mqtt
|
||||||
|
topic: !input opple_z2m_name
|
||||||
|
action:
|
||||||
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_1_single'
|
||||||
|
sequence: !input button_1_single
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_1_double'
|
||||||
|
sequence: !input button_1_double
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_1_triple'
|
||||||
|
sequence: !input button_1_triple
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_1_release'
|
||||||
|
sequence: !input button_1_release
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_2_single'
|
||||||
|
sequence: !input button_2_single
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_2_double'
|
||||||
|
sequence: !input button_2_double
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_2_triple'
|
||||||
|
sequence: !input button_2_triple
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_2_release'
|
||||||
|
sequence: !input button_2_release
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_3_single'
|
||||||
|
sequence: !input button_3_single
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_3_double'
|
||||||
|
sequence: !input button_3_double
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_3_triple'
|
||||||
|
sequence: !input button_3_triple
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_3_release'
|
||||||
|
sequence: !input button_3_release
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_4_single'
|
||||||
|
sequence: !input button_4_single
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_4_double'
|
||||||
|
sequence: !input button_4_double
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_4_triple'
|
||||||
|
sequence: !input button_4_triple
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_4_release'
|
||||||
|
sequence: !input button_4_release
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_5_single'
|
||||||
|
sequence: !input button_5_single
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_5_double'
|
||||||
|
sequence: !input button_5_double
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_5_triple'
|
||||||
|
sequence: !input button_5_triple
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_5_release'
|
||||||
|
sequence: !input button_5_release
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_6_single'
|
||||||
|
sequence: !input button_6_single
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_6_double'
|
||||||
|
sequence: !input button_6_double
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_6_triple'
|
||||||
|
sequence: !input button_6_triple
|
||||||
|
|
||||||
|
- conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: !input action_sensor
|
||||||
|
state: 'button_6_release'
|
||||||
|
sequence: !input button_6_release
|
||||||
@@ -32,8 +32,6 @@ cards:
|
|||||||
service: automation.reload
|
service: automation.reload
|
||||||
- entity: sensor.automations_count
|
- entity: sensor.automations_count
|
||||||
icon: mdi:pound
|
icon: mdi:pound
|
||||||
- automation.living_room_opple
|
|
||||||
- automation.bedroom_opple
|
|
||||||
- automation.titanium_turn_off_when_idle
|
- automation.titanium_turn_off_when_idle
|
||||||
- automation.titanium_notify_on_vibration_sensor_move
|
- automation.titanium_notify_on_vibration_sensor_move
|
||||||
- automation.speech_enable_when_meeting_is_over
|
- automation.speech_enable_when_meeting_is_over
|
||||||
@@ -51,6 +49,17 @@ cards:
|
|||||||
- automation.routine_coming_home_left_work
|
- automation.routine_coming_home_left_work
|
||||||
- automation.presence_leaving_work
|
- automation.presence_leaving_work
|
||||||
|
|
||||||
|
- type: entities
|
||||||
|
title: Switches
|
||||||
|
show_header_toggle: false
|
||||||
|
icon: mdi:switch
|
||||||
|
entities:
|
||||||
|
- automation.living_room_opple
|
||||||
|
- automation.living_room_desk_switch
|
||||||
|
- automation.bedroom_opple
|
||||||
|
- automation.bedroom_bedside_switch
|
||||||
|
- automation.bathroom_switch
|
||||||
|
|
||||||
- type: entities
|
- type: entities
|
||||||
title: Lighting
|
title: Lighting
|
||||||
show_header_toggle: false
|
show_header_toggle: false
|
||||||
@@ -62,13 +71,8 @@ cards:
|
|||||||
- automation.lighting_temperature_adjust_on_start
|
- automation.lighting_temperature_adjust_on_start
|
||||||
- automation.lighting_temperature_adjust_based_on_time
|
- automation.lighting_temperature_adjust_based_on_time
|
||||||
- type: divider
|
- type: divider
|
||||||
- automation.lighting_living_room_toggle_ceiling_lights_on_desk_switch_single_click
|
|
||||||
- automation.lighting_living_room_toggle_ambient_lights_on_desk_switch_double_click
|
|
||||||
- type: divider
|
|
||||||
- automation.lighting_master_bedroom_toggle_lights_on_switch_single_click
|
- automation.lighting_master_bedroom_toggle_lights_on_switch_single_click
|
||||||
- automation.lighting_master_bedroom_toggle_ambient_lights_on_switch_double_click
|
- automation.lighting_master_bedroom_toggle_ambient_lights_on_switch_double_click
|
||||||
- automation.lighting_master_bedroom_toggle_lights_on_bedside_switch_single_click
|
|
||||||
- automation.lighting_master_bedroom_toggle_ambient_lights_on_bedside_switch_double_click
|
|
||||||
- type: divider
|
- type: divider
|
||||||
- automation.lighting_kitchen_motion_on
|
- automation.lighting_kitchen_motion_on
|
||||||
- automation.lighting_kitchen_motion_off
|
- automation.lighting_kitchen_motion_off
|
||||||
@@ -97,12 +101,9 @@ cards:
|
|||||||
- automation.tv_plex_setup_house_for_plex
|
- automation.tv_plex_setup_house_for_plex
|
||||||
- automation.tv_plex_restore_house_after_plex
|
- automation.tv_plex_restore_house_after_plex
|
||||||
- automation.youtube_download_latest_pds
|
- automation.youtube_download_latest_pds
|
||||||
- automation.youtube_play_latest_pds_on_bathroom_switch_dobule_click
|
|
||||||
- automation.media_sonos_put_beam_in_night_mode
|
- automation.media_sonos_put_beam_in_night_mode
|
||||||
- automation.media_sonos_put_beam_in_day_mode
|
- automation.media_sonos_put_beam_in_day_mode
|
||||||
- automation.media_sonos_volume_up_on_bathroom_switch_click
|
|
||||||
- type: divider
|
- type: divider
|
||||||
- automation.music_living_room_play_pause_on_desk_switch_hold
|
|
||||||
- automation.music_master_bedroom_play_pause_on_switch_hold
|
- automation.music_master_bedroom_play_pause_on_switch_hold
|
||||||
|
|
||||||
- type: entities
|
- type: entities
|
||||||
@@ -120,7 +121,6 @@ cards:
|
|||||||
- automation.house_mode_set_to_day
|
- automation.house_mode_set_to_day
|
||||||
- automation.house_mode_set_to_bed
|
- automation.house_mode_set_to_bed
|
||||||
- automation.house_mode_set_to_night
|
- automation.house_mode_set_to_night
|
||||||
- automation.house_mode_toggle_on_bedside_switch_hold
|
|
||||||
- automation.house_mode_set_to_day_if_bedroom_door_was_opened
|
- automation.house_mode_set_to_day_if_bedroom_door_was_opened
|
||||||
|
|
||||||
- type: entities
|
- type: entities
|
||||||
|
|||||||
@@ -8,12 +8,6 @@ input_number:
|
|||||||
icon: mdi:speaker
|
icon: mdi:speaker
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- platform: mqtt
|
|
||||||
name: "Bathroom switch click"
|
|
||||||
state_topic: "z2m_deconz/bathroom_switch"
|
|
||||||
availability_topic: "z2m_deconz/bridge/state"
|
|
||||||
icon: "mdi:toggle-switch"
|
|
||||||
value_template: "{{ value_json.click }}"
|
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
name: "Bathroom switch battery"
|
name: "Bathroom switch battery"
|
||||||
state_topic: "z2m_deconz/bathroom_switch"
|
state_topic: "z2m_deconz/bathroom_switch"
|
||||||
@@ -21,12 +15,6 @@ sensor:
|
|||||||
unit_of_measurement: "%"
|
unit_of_measurement: "%"
|
||||||
device_class: "battery"
|
device_class: "battery"
|
||||||
value_template: "{{ value_json.battery }}"
|
value_template: "{{ value_json.battery }}"
|
||||||
- platform: mqtt
|
|
||||||
name: "Bathroom switch action"
|
|
||||||
state_topic: "z2m_deconz/bathroom_switch"
|
|
||||||
availability_topic: "z2m_deconz/bridge/state"
|
|
||||||
icon: "mdi:gesture-double-tap"
|
|
||||||
value_template: "{{ value_json.action }}"
|
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
name: "Bathroom switch LQI"
|
name: "Bathroom switch LQI"
|
||||||
state_topic: "z2m_deconz/bathroom_switch"
|
state_topic: "z2m_deconz/bathroom_switch"
|
||||||
@@ -36,15 +24,12 @@ sensor:
|
|||||||
value_template: "{{ value_json.linkquality }}"
|
value_template: "{{ value_json.linkquality }}"
|
||||||
|
|
||||||
automation:
|
automation:
|
||||||
- alias: Media · Sonos · Volume up on bathroom switch click
|
- alias: Bathroom · Switch
|
||||||
trigger:
|
use_blueprint:
|
||||||
platform: mqtt
|
path: aqara_switch.yaml
|
||||||
topic: "z2m_deconz/bathroom_switch"
|
input:
|
||||||
condition:
|
z2m_topic: "z2m_deconz/bathroom_switch"
|
||||||
- condition: state
|
click:
|
||||||
entity_id: sensor.bathroom_switch_click
|
|
||||||
state: 'single'
|
|
||||||
action:
|
|
||||||
- service: media_player.volume_set
|
- service: media_player.volume_set
|
||||||
entity_id: media_player.bathroom
|
entity_id: media_player.bathroom
|
||||||
data_template:
|
data_template:
|
||||||
@@ -56,15 +41,7 @@ automation:
|
|||||||
{{ states('input_number.bathroom_high_volume')|float }}
|
{{ states('input_number.bathroom_high_volume')|float }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- alias: Youtube · play latest pds on bathroom switch dobule click
|
double_click:
|
||||||
trigger:
|
|
||||||
platform: mqtt
|
|
||||||
topic: "z2m_deconz/bathroom_switch"
|
|
||||||
condition:
|
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bathroom_switch_click
|
|
||||||
state: 'double'
|
|
||||||
action:
|
|
||||||
- service: media_player.volume_set
|
- service: media_player.volume_set
|
||||||
entity_id: media_player.bathroom
|
entity_id: media_player.bathroom
|
||||||
data_template:
|
data_template:
|
||||||
|
|||||||
@@ -22,25 +22,17 @@ sensor:
|
|||||||
|
|
||||||
automation:
|
automation:
|
||||||
- alias: Bedroom · Opple
|
- alias: Bedroom · Opple
|
||||||
mode: queued
|
use_blueprint:
|
||||||
trigger:
|
path: oppo_6_btn_switch.yaml
|
||||||
platform: mqtt
|
input:
|
||||||
topic: "z2m_deconz/opple_1"
|
opple_z2m_name: "z2m_deconz/opple_1"
|
||||||
action:
|
action_sensor: sensor.bedroom_opple_action
|
||||||
- choose:
|
|
||||||
- conditions:
|
button_1_single:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_1_single'
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_off
|
- service: light.turn_off
|
||||||
entity_id: light.master_bedroom
|
entity_id: light.master_bedroom
|
||||||
|
|
||||||
- conditions:
|
button_2_single:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_2_single'
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_on
|
- service: light.turn_on
|
||||||
data_template:
|
data_template:
|
||||||
entity_id: light.master_bedroom
|
entity_id: light.master_bedroom
|
||||||
@@ -52,19 +44,11 @@ automation:
|
|||||||
100
|
100
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- conditions:
|
button_1_double:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_1_double'
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_off
|
- service: light.turn_off
|
||||||
entity_id: light.master_bedroom_main
|
entity_id: light.master_bedroom_main
|
||||||
|
|
||||||
- conditions:
|
button_2_double:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_2_double'
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_on
|
- service: light.turn_on
|
||||||
data_template:
|
data_template:
|
||||||
entity_id: light.master_bedroom_main
|
entity_id: light.master_bedroom_main
|
||||||
@@ -76,21 +60,13 @@ automation:
|
|||||||
100
|
100
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- conditions:
|
button_1_triple:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_1_triple'
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_off
|
- service: light.turn_off
|
||||||
entity_id:
|
entity_id:
|
||||||
- light.bedside
|
- light.bedside
|
||||||
- light.bed_led
|
- light.bed_led
|
||||||
|
|
||||||
- conditions:
|
button_2_triple:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_2_triple'
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_on
|
- service: light.turn_on
|
||||||
data_template:
|
data_template:
|
||||||
entity_id:
|
entity_id:
|
||||||
@@ -104,73 +80,37 @@ automation:
|
|||||||
100
|
100
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- conditions:
|
button_3_single:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_3_single'
|
|
||||||
sequence:
|
|
||||||
- service: media_player.media_play_pause
|
- service: media_player.media_play_pause
|
||||||
entity_id: media_player.master_bedroom
|
entity_id: media_player.master_bedroom
|
||||||
|
|
||||||
- conditions:
|
button_3_double:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_3_double'
|
|
||||||
sequence:
|
|
||||||
- service: script.sonos_join_tv
|
- service: script.sonos_join_tv
|
||||||
|
|
||||||
- conditions:
|
button_3_triple:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_3_triple'
|
|
||||||
sequence:
|
|
||||||
- service: script.sonos_join_bedroom
|
- service: script.sonos_join_bedroom
|
||||||
|
|
||||||
- conditions:
|
button_3_release:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_3_release'
|
|
||||||
sequence:
|
|
||||||
- service: media_player.play_next
|
- service: media_player.play_next
|
||||||
entity_id: media_player.master_bedroom
|
entity_id: media_player.master_bedroom
|
||||||
|
|
||||||
- conditions:
|
button_4_single:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_4_single'
|
|
||||||
sequence:
|
|
||||||
- service: script.music_play
|
- service: script.music_play
|
||||||
|
|
||||||
- conditions:
|
button_4_double:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_4_double'
|
|
||||||
sequence:
|
|
||||||
- service: script.music_play
|
- service: script.music_play
|
||||||
data:
|
data:
|
||||||
playlist: 'Starred'
|
playlist: 'Starred'
|
||||||
|
|
||||||
- conditions:
|
button_4_triple:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_4_triple'
|
|
||||||
sequence:
|
|
||||||
- service: script.music_play
|
- service: script.music_play
|
||||||
data:
|
data:
|
||||||
playlist: 'Retro'
|
playlist: 'Retro'
|
||||||
|
|
||||||
- conditions:
|
button_5_single:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_5_single'
|
|
||||||
sequence:
|
|
||||||
- service: fan.turn_off
|
- service: fan.turn_off
|
||||||
entity_id: fan.philips_airpurifier
|
entity_id: fan.philips_airpurifier
|
||||||
|
|
||||||
- conditions:
|
button_6_single:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedroom_opple_action
|
|
||||||
state: 'button_6_single'
|
|
||||||
sequence:
|
|
||||||
- service: fan.turn_on
|
- service: fan.turn_on
|
||||||
entity_id: fan.philips_airpurifier
|
entity_id: fan.philips_airpurifier
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
sensor:
|
sensor:
|
||||||
- platform: mqtt
|
|
||||||
name: "Bedside switch click"
|
|
||||||
state_topic: "z2m_deconz/bedside_switch"
|
|
||||||
availability_topic: "z2m_deconz/bridge/state"
|
|
||||||
icon: "mdi:toggle-switch"
|
|
||||||
value_template: "{{ value_json.click }}"
|
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
name: "Bedside switch battery"
|
name: "Bedside switch battery"
|
||||||
state_topic: "z2m_deconz/bedside_switch"
|
state_topic: "z2m_deconz/bedside_switch"
|
||||||
@@ -12,12 +6,6 @@ sensor:
|
|||||||
unit_of_measurement: "%"
|
unit_of_measurement: "%"
|
||||||
device_class: "battery"
|
device_class: "battery"
|
||||||
value_template: "{{ value_json.battery }}"
|
value_template: "{{ value_json.battery }}"
|
||||||
- platform: mqtt
|
|
||||||
name: "Bedside switch action"
|
|
||||||
state_topic: "z2m_deconz/bedside_switch"
|
|
||||||
availability_topic: "z2m_deconz/bridge/state"
|
|
||||||
icon: "mdi:gesture-double-tap"
|
|
||||||
value_template: "{{ value_json.action }}"
|
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
name: "Bedside switch LQI"
|
name: "Bedside switch LQI"
|
||||||
state_topic: "z2m_deconz/bedside_switch"
|
state_topic: "z2m_deconz/bedside_switch"
|
||||||
@@ -27,15 +15,12 @@ sensor:
|
|||||||
value_template: "{{ value_json.linkquality }}"
|
value_template: "{{ value_json.linkquality }}"
|
||||||
|
|
||||||
automation:
|
automation:
|
||||||
- alias: Lighting · Master bedroom · Toggle lights on bedside switch single click
|
- alias: Bedroom · Bedside Switch
|
||||||
trigger:
|
use_blueprint:
|
||||||
platform: mqtt
|
path: aqara_switch.yaml
|
||||||
topic: "z2m_deconz/bedside_switch"
|
input:
|
||||||
condition:
|
z2m_topic: "z2m_deconz/bedside_switch"
|
||||||
- condition: state
|
click:
|
||||||
entity_id: sensor.bedside_switch_click
|
|
||||||
state: 'single'
|
|
||||||
action:
|
|
||||||
- service: light.toggle
|
- service: light.toggle
|
||||||
data_template:
|
data_template:
|
||||||
entity_id: >-
|
entity_id: >-
|
||||||
@@ -55,15 +40,7 @@ automation:
|
|||||||
100
|
100
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- alias: Lighting · Master bedroom · Toggle ambient lights on bedside switch double click
|
double_click:
|
||||||
trigger:
|
|
||||||
platform: mqtt
|
|
||||||
topic: "z2m_deconz/bedside_switch"
|
|
||||||
condition:
|
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.bedside_switch_click
|
|
||||||
state: 'double'
|
|
||||||
action:
|
|
||||||
- service: light.toggle
|
- service: light.toggle
|
||||||
data_template:
|
data_template:
|
||||||
entity_id:
|
entity_id:
|
||||||
@@ -71,11 +48,6 @@ automation:
|
|||||||
- light.bed_led
|
- light.bed_led
|
||||||
brightness_pct: 100
|
brightness_pct: 100
|
||||||
|
|
||||||
- alias: House mode · Toggle on bedside switch hold
|
hold:
|
||||||
trigger:
|
|
||||||
platform: state
|
|
||||||
entity_id: sensor.bedside_switch_action
|
|
||||||
to: 'hold'
|
|
||||||
action:
|
|
||||||
- service: input_select.select_next
|
- service: input_select.select_next
|
||||||
entity_id: input_select.house_mode
|
entity_id: input_select.house_mode
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
sensor:
|
sensor:
|
||||||
- platform: mqtt
|
|
||||||
name: "Desk switch click"
|
|
||||||
state_topic: "z2m_deconz/desk_switch"
|
|
||||||
availability_topic: "z2m_deconz/bridge/state"
|
|
||||||
icon: "mdi:toggle-switch"
|
|
||||||
value_template: "{{ value_json.click }}"
|
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
name: "Desk switch battery"
|
name: "Desk switch battery"
|
||||||
state_topic: "z2m_deconz/desk_switch"
|
state_topic: "z2m_deconz/desk_switch"
|
||||||
@@ -12,12 +6,6 @@ sensor:
|
|||||||
unit_of_measurement: "%"
|
unit_of_measurement: "%"
|
||||||
device_class: "battery"
|
device_class: "battery"
|
||||||
value_template: "{{ value_json.battery }}"
|
value_template: "{{ value_json.battery }}"
|
||||||
- platform: mqtt
|
|
||||||
name: "Desk switch action"
|
|
||||||
state_topic: "z2m_deconz/desk_switch"
|
|
||||||
availability_topic: "z2m_deconz/bridge/state"
|
|
||||||
icon: "mdi:gesture-double-tap"
|
|
||||||
value_template: "{{ value_json.action }}"
|
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
name: "Desk switch LQI"
|
name: "Desk switch LQI"
|
||||||
state_topic: "z2m_deconz/desk_switch"
|
state_topic: "z2m_deconz/desk_switch"
|
||||||
@@ -28,15 +16,12 @@ sensor:
|
|||||||
|
|
||||||
|
|
||||||
automation:
|
automation:
|
||||||
- alias: Lighting · Living Room · Toggle ceiling lights on desk switch single click
|
- alias: Living room · Desk switch
|
||||||
trigger:
|
use_blueprint:
|
||||||
platform: mqtt
|
path: aqara_switch.yaml
|
||||||
topic: "z2m_deconz/desk_switch"
|
input:
|
||||||
condition:
|
z2m_topic: "z2m_deconz/desk_switch"
|
||||||
- condition: state
|
click:
|
||||||
entity_id: sensor.desk_switch_click
|
|
||||||
state: 'single'
|
|
||||||
action:
|
|
||||||
- service: light.toggle
|
- service: light.toggle
|
||||||
data_template:
|
data_template:
|
||||||
entity_id: light.living_room_main
|
entity_id: light.living_room_main
|
||||||
@@ -48,15 +33,7 @@ automation:
|
|||||||
100
|
100
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- alias: Lighting · Living Room · Toggle ambient lights on desk switch double click
|
double_click:
|
||||||
trigger:
|
|
||||||
platform: mqtt
|
|
||||||
topic: "z2m_deconz/desk_switch"
|
|
||||||
condition:
|
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.desk_switch_click
|
|
||||||
state: 'double'
|
|
||||||
action:
|
|
||||||
- service: light.toggle
|
- service: light.toggle
|
||||||
data_template:
|
data_template:
|
||||||
entity_id: light.living_room_ambient
|
entity_id: light.living_room_ambient
|
||||||
@@ -68,11 +45,6 @@ automation:
|
|||||||
100
|
100
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- alias: Music · Living Room · Play pause on desk switch hold
|
hold:
|
||||||
trigger:
|
|
||||||
platform: state
|
|
||||||
entity_id: sensor.desk_switch_action
|
|
||||||
to: 'hold'
|
|
||||||
action:
|
|
||||||
- service: media_player.media_play_pause
|
- service: media_player.media_play_pause
|
||||||
entity_id: media_player.living_room
|
entity_id: media_player.living_room
|
||||||
|
|||||||
@@ -22,162 +22,86 @@ sensor:
|
|||||||
|
|
||||||
automation:
|
automation:
|
||||||
- alias: Living room · Opple
|
- alias: Living room · Opple
|
||||||
mode: queued
|
use_blueprint:
|
||||||
trigger:
|
path: oppo_6_btn_switch.yaml
|
||||||
platform: mqtt
|
input:
|
||||||
topic: "z2m_deconz/opple_2"
|
opple_z2m_name: "z2m_deconz/opple_2"
|
||||||
action:
|
action_sensor: sensor.living_room_opple_action
|
||||||
- choose:
|
|
||||||
- conditions:
|
button_1_single:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_1_single'
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_off
|
- service: light.turn_off
|
||||||
entity_id: light.living_room
|
entity_id: light.living_room
|
||||||
|
|
||||||
- conditions:
|
button_2_single:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_2_single'
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_on
|
- service: light.turn_on
|
||||||
entity_id: light.living_room
|
entity_id: light.living_room
|
||||||
|
|
||||||
- conditions:
|
button_1_double:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_1_double'
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_off
|
- service: light.turn_off
|
||||||
entity_id: light.living_room_main
|
entity_id: light.living_room_main
|
||||||
|
|
||||||
- conditions:
|
button_2_double:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_2_double'
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_on
|
- service: light.turn_on
|
||||||
entity_id: light.living_room_main
|
entity_id: light.living_room_main
|
||||||
|
|
||||||
- conditions:
|
button_1_triple:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_1_triple'
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_off
|
- service: light.turn_off
|
||||||
entity_id: light.living_room_ambient
|
entity_id: light.living_room_ambient
|
||||||
|
|
||||||
- conditions:
|
button_2_triple:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_2_triple'
|
|
||||||
sequence:
|
|
||||||
- service: light.turn_on
|
- service: light.turn_on
|
||||||
entity_id: light.living_room_ambient
|
entity_id: light.living_room_ambient
|
||||||
|
|
||||||
- conditions:
|
button_2_release:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_2_release'
|
|
||||||
sequence:
|
|
||||||
- service: script.scene_living_room_ambient_neon
|
- service: script.scene_living_room_ambient_neon
|
||||||
|
|
||||||
- conditions:
|
button_3_single:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_3_single'
|
|
||||||
sequence:
|
|
||||||
- service: media_player.media_play_pause
|
- service: media_player.media_play_pause
|
||||||
entity_id: media_player.living_room
|
entity_id: media_player.living_room
|
||||||
|
|
||||||
- conditions:
|
button_3_double:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_3_double'
|
|
||||||
sequence:
|
|
||||||
- service: script.sonos_join_tv
|
- service: script.sonos_join_tv
|
||||||
|
|
||||||
- conditions:
|
button_3_triple:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_3_triple'
|
|
||||||
sequence:
|
|
||||||
- service: script.sonos_join_bedroom
|
- service: script.sonos_join_bedroom
|
||||||
|
|
||||||
- conditions:
|
button_3_release:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_3_release'
|
|
||||||
sequence:
|
|
||||||
- service: media_player.play_next
|
- service: media_player.play_next
|
||||||
entity_id: media_player.living_room
|
entity_id: media_player.living_room
|
||||||
|
|
||||||
- conditions:
|
button_4_single:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_4_single'
|
|
||||||
sequence:
|
|
||||||
- service: script.music_play
|
- service: script.music_play
|
||||||
|
|
||||||
- conditions:
|
button_4_double:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_4_double'
|
|
||||||
sequence:
|
|
||||||
- service: script.music_play
|
- service: script.music_play
|
||||||
data:
|
data:
|
||||||
playlist: 'Starred'
|
playlist: 'Starred'
|
||||||
|
|
||||||
- conditions:
|
button_4_triple:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_4_triple'
|
|
||||||
sequence:
|
|
||||||
- service: script.music_play
|
- service: script.music_play
|
||||||
data:
|
data:
|
||||||
playlist: 'Retro'
|
playlist: 'Retro'
|
||||||
|
|
||||||
- conditions:
|
button_5_single:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_5_single'
|
|
||||||
sequence:
|
|
||||||
- service: climate.turn_off
|
- service: climate.turn_off
|
||||||
entity_id: climate.toshiba_ac
|
entity_id: climate.toshiba_ac
|
||||||
|
|
||||||
- conditions:
|
button_5_double:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_5_double'
|
|
||||||
sequence:
|
|
||||||
- service: climate.set_temperature
|
- service: climate.set_temperature
|
||||||
entity_id: climate.toshiba_ac
|
entity_id: climate.toshiba_ac
|
||||||
data_template:
|
data_template:
|
||||||
temperature: "{{ state_attr('climate.toshiba_ac', 'temperature') | int -1}}"
|
temperature: "{{ state_attr('climate.toshiba_ac', 'temperature') | int -1}}"
|
||||||
|
|
||||||
- conditions:
|
button_6_single:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_6_single'
|
|
||||||
sequence:
|
|
||||||
- service: script.toshiba_ac_on_cool
|
- service: script.toshiba_ac_on_cool
|
||||||
|
|
||||||
- conditions:
|
button_6_double:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_6_double'
|
|
||||||
sequence:
|
|
||||||
- service: climate.set_temperature
|
- service: climate.set_temperature
|
||||||
entity_id: climate.toshiba_ac
|
entity_id: climate.toshiba_ac
|
||||||
data_template:
|
data_template:
|
||||||
temperature: "{{ state_attr('climate.toshiba_ac', 'temperature') | int +1}}"
|
temperature: "{{ state_attr('climate.toshiba_ac', 'temperature') | int +1}}"
|
||||||
|
|
||||||
- conditions:
|
button_6_triple:
|
||||||
- condition: state
|
|
||||||
entity_id: sensor.living_room_opple_action
|
|
||||||
state: 'button_6_triple'
|
|
||||||
sequence:
|
|
||||||
- service: automation.turn_off
|
- service: automation.turn_off
|
||||||
entity_id: automation.tv_sonos_join_tv_on_google_cast
|
entity_id: automation.tv_sonos_join_tv_on_google_cast
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user