From 5311508e393b090b606a580c82d9816b852055e3 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sun, 26 Jun 2022 18:52:13 +0300 Subject: [PATCH] AC Notify when conditions met --- .../devices/living_room/toshiba_ac.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/config/packages/devices/living_room/toshiba_ac.yaml b/config/packages/devices/living_room/toshiba_ac.yaml index a66ac3d..be8e204 100644 --- a/config/packages/devices/living_room/toshiba_ac.yaml +++ b/config/packages/devices/living_room/toshiba_ac.yaml @@ -56,6 +56,15 @@ input_number: template: - binary_sensor: + - name: Toshiba AC Climate conditions met + state: > + {% set temp_matching = states('sensor.multisensor_6_temperature')|float >= states('input_number.toshiba_trigger_temp')|float %} + {% set outside_temp_high = states('sensor.dark_sky_apparent_temperature')|float + 2 >= states('input_number.toshiba_trigger_temp')|float %} + {% set someone_home = is_state('binary_sensor.someone_home', 'on') %} + {% set ac_off = is_state('climate.toshiba_ac', 'off') %} + + {{ temp_matching and outside_temp_high and someone_home and ac_off }} + - name: Toshiba AC conditions met icon: > {{ is_state('binary_sensor.toshiba_ac_conditions_met', 'on') | iif('mdi:home-thermometer', 'mdi:home-thermometer-outline') }} @@ -188,3 +197,15 @@ automation: name: "馃挩 Climate Module 路 " message: "AC 路 Switching off" domain: climate + + - alias: Climate 路 AC 路聽Notify conditions met + trigger: + platform: state + entity_id: binary_sensor.toshiba_ac_climate_conditions_met + from: 'off' + to: 'on' + action: + - service: notify.telegram + data: + title: "馃挩 Climate Module 路 AC 路聽Conditions met" + message: "I would turn the AC on, but some windows or doors are open."