From 26b2a043b2f20deca6f241b13962abfb69417335 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sat, 27 Jun 2020 18:18:24 +0300 Subject: [PATCH] Toggle AC from Wallmote --- .../advanced_dashboard/08_automations.yaml | 1 + .../devices/living_room/toshiba_ac.yaml | 47 ++++++++++--------- .../devices/living_room/wallmote.yaml | 19 ++++++++ 3 files changed, 46 insertions(+), 21 deletions(-) diff --git a/config/lovelace/advanced_dashboard/08_automations.yaml b/config/lovelace/advanced_dashboard/08_automations.yaml index ab99d77..2af1b0a 100644 --- a/config/lovelace/advanced_dashboard/08_automations.yaml +++ b/config/lovelace/advanced_dashboard/08_automations.yaml @@ -185,6 +185,7 @@ cards: - automation.wallmote_living_room_2_hold_play_music - automation.wallmote_living_room_3_tap_toggle_main_lights - automation.wallmote_living_room_3_hold_toggle_ambient_lights + - automation.wallmote_living_room_4_tap_toggle_ac - automation.wallmote_living_room_4_hold_toggle_titanium - type: entities diff --git a/config/packages/devices/living_room/toshiba_ac.yaml b/config/packages/devices/living_room/toshiba_ac.yaml index b1a8bb6..0f5dc9d 100644 --- a/config/packages/devices/living_room/toshiba_ac.yaml +++ b/config/packages/devices/living_room/toshiba_ac.yaml @@ -26,6 +26,31 @@ climate: supported_swing_list: - "off" +script: + toshiba_ac_on_cool: + sequence: + - service: climate.turn_on + entity_id: climate.toshiba_ac + - delay: "00:00:01" + - service: climate.set_hvac_mode + entity_id: climate.toshiba_ac + data: + hvac_mode: "cool" + - service: climate.set_fan_mode + entity_id: climate.toshiba_ac + data: + fan_mode: "auto" + - delay: "00:00:01" + - service: climate.set_temperature + entity_id: climate.toshiba_ac + data: + temperature: 19 + - service: logbook.log + data: + name: "馃挩 Climate Module 路 " + message: "AC 路 Switching on 路 Above 24 degrees, windows closed" + domain: climate + automation: - alias: Climate 路聽AC 路聽Turn on if hot trigger: @@ -60,27 +85,7 @@ automation: entity_id: climate.toshiba_ac state: "off" action: - - service: climate.turn_on - entity_id: climate.toshiba_ac - - delay: "00:00:01" - - service: climate.set_hvac_mode - entity_id: climate.toshiba_ac - data: - hvac_mode: "cool" - - service: climate.set_fan_mode - entity_id: climate.toshiba_ac - data: - fan_mode: "auto" - - delay: "00:00:01" - - service: climate.set_temperature - entity_id: climate.toshiba_ac - data: - temperature: 19 - - service: logbook.log - data: - name: "馃挩 Climate Module 路 " - message: "AC 路 Switching on 路 Above 24 degrees, windows closed" - domain: climate + - service: script.toshiba_ac_on_cool - alias: Climate 路聽AC 路聽Turn off trigger: diff --git a/config/packages/devices/living_room/wallmote.yaml b/config/packages/devices/living_room/wallmote.yaml index 9a8ed8e..df5f281 100644 --- a/config/packages/devices/living_room/wallmote.yaml +++ b/config/packages/devices/living_room/wallmote.yaml @@ -94,6 +94,25 @@ automation: - service: light.toggle entity_id: light.living_room_ambient + - alias: Wallmote 路聽Living room 路 4 路 Tap 路聽Toggle AC + trigger: + platform: event + event_type: zwave.scene_activated + event_data: + entity_id: zwave.aeon_labs_zw130_wallmote_quad + node_id: 5 + scene_id: 4 + scene_data: 0 + action: + - service_template: >- + {% if is_state('climate.toshiba_ac', 'off') %} + script.toshiba_ac_on_cool + {% else %} + climate.turn_off + {% endif %} + data_template: + entity_id: "{% if not is_state('climate.toshiba_ac', 'off') %}climate.toshiba_ac{%endif%}" + - alias: Wallmote 路聽Living room 路 4 路 Hold 路 Toggle Titanium trigger: platform: event