From 490f5cf3beead27fbe655041cec6430ac1e65067 Mon Sep 17 00:00:00 2001 From: Kevin Eifinger Date: Sun, 2 Aug 2020 15:16:25 +0200 Subject: [PATCH] input_numbers for motion triggers --- input_number.yaml | 6 --- packages/climate.yaml | 47 ++++++++++++++++ packages/fridge.yaml | 1 - packages/motion_trigger.yaml | 41 ++++++++++---- packages/room_presence.yaml | 4 +- .../toggle_thermostat_when_window_open.yaml | 53 ------------------- 6 files changed, 81 insertions(+), 71 deletions(-) delete mode 100644 packages/toggle_thermostat_when_window_open.yaml diff --git a/input_number.yaml b/input_number.yaml index 34cf2939..0a61ba6b 100644 --- a/input_number.yaml +++ b/input_number.yaml @@ -23,12 +23,6 @@ warm_upper_bath_before_wakeup: min: 18 max: 30 step: 0.5 -oben_treppe_motion_trigger_delay: - name: Treppen Bewegungsmelder Licht Dauer - icon: mdi:alarm - min: 90 - max: 300 - step: 5 ################################################################# ## Appdaemon App Switches - Thermostats - Leaving ################################################################# diff --git a/packages/climate.yaml b/packages/climate.yaml index a153a59d..26ca55a6 100644 --- a/packages/climate.yaml +++ b/packages/climate.yaml @@ -149,6 +149,53 @@ script: temperature: > {{ state_attr('climate.wohnzimmer_thermostat', 'temperature') | float + 2 }} +automation: + - id: bfbb961f-ca65-4916-b9f6-b4afabadc7af + alias: Fußbodenheizung im Bad aus/an wenn Fenster auf/zu + description: Turn on/off bathroom floor heating when the window is opened/closed + trigger: + - platform: state + entity_id: binary_sensor.contact_lower_bathroom_window_tilted + - platform: state + entity_id: binary_sensor.contact_lower_bathroom_window + action: + - choose: + - conditions: + - condition: template + value_template: > + {{ trigger.to_state.state == 'on'}} + sequence: + - service: homeassistant.turn_off + entity_id: climate.bad_thermostat + default: + - service: homeassistant.turn_on + entity_id: climate.bad_thermostat + - id: cc85d256-87ae-4303-b234-27d81c98451b + alias: Fußbodenheizung im Bad oben aus/an wenn Fenster auf/zu + description: Turn on/off upper bathroom floor heating when the window is opened/closed + trigger: + - platform: state + entity_id: binary_sensor.contact_upper_bathroom_window_tilted + - platform: state + entity_id: binary_sensor.contact_upper_bathroom_window + action: + - choose: + - conditions: + - condition: template + value_template: > + {{ trigger.to_state.state == 'on'}} + sequence: + - service: homeassistant.turn_off + entity_id: climate.bad_oben_thermostat + default: + - service: homeassistant.turn_on + entity_id: climate.bad_oben_thermostat +homeassistant: + customize: + automation.fussbodenheizung_im_bad_aus_an_wenn_fenster_auf_zu: + icon: mdi:radiator-off + automation.fussbodenheizung_im_bad_oben_aus_an_wenn_fenster_auf_zu: + icon: mdi:radiator-off cloud: alexa: filter: diff --git a/packages/fridge.yaml b/packages/fridge.yaml index f568076f..08cd65b4 100644 --- a/packages/fridge.yaml +++ b/packages/fridge.yaml @@ -26,7 +26,6 @@ homeassistant: customize: automation.kuhlschrank_strom_kontrolle: icon: mdi:fridge - cloud: alexa: filter: diff --git a/packages/motion_trigger.yaml b/packages/motion_trigger.yaml index 54fe3841..8f19dfb1 100644 --- a/packages/motion_trigger.yaml +++ b/packages/motion_trigger.yaml @@ -31,7 +31,8 @@ automation: data: entity_id: light.upper_stairs_yeelight brightness: 1 - - delay: 60 + - delay: + seconds: "{{ states('input_number.stairs_motion_trigger_delay') | int }}" - service: light.turn_off data: entity_id: light.stairs_lower_yeelight @@ -47,7 +48,8 @@ automation: data: entity_id: light.upper_stairs_yeelight brightness: 100 - - delay: 60 + - delay: + seconds: "{{ states('input_number.stairs_motion_trigger_delay') | int }}" - service: light.turn_off data: entity_id: light.stairs_lower_yeelight @@ -80,7 +82,8 @@ automation: data: entity_id: light.philips_miio_light_bulb brightness: 100 - - delay: 60 + - delay: + seconds: "{{ states('input_number.studyroom_motion_trigger_delay') | int }}" - service: light.turn_off data: entity_id: light.philips_miio_light_bulb @@ -110,7 +113,8 @@ automation: data: entity_id: light.lower_bathroom_yeelight brightness: 1 - - delay: 60 + - delay: + seconds: "{{ states('input_number.bathroom_motion_trigger_delay') | int }}" - service: light.turn_off data: entity_id: light.lower_bathroom_yeelight @@ -119,7 +123,8 @@ automation: data: entity_id: light.lower_bathroom_yeelight brightness: 100 - - delay: 60 + - delay: + seconds: "{{ states('input_number.bathroom_motion_trigger_delay') | int }}" - service: light.turn_off data: entity_id: light.lower_bathroom_yeelight @@ -149,10 +154,26 @@ automation: data: entity_id: light.bedroom_yeelight brightness: 100 - - delay: 60 - - service: light.turn_off - data: - entity_id: light.bedroom_yeelight + +input_number: + stairs_motion_trigger_delay: + name: Treppen Bewegungsmelder Licht Dauer + icon: mdi:alarm + min: 90 + max: 300 + step: 5 + studyroom_motion_trigger_delay: + name: Arbeitszimmer Bewegungsmelder Licht Dauer + icon: mdi:alarm + min: 90 + max: 300 + step: 5 + bathroom_motion_trigger_delay: + name: Bad Bewegungsmelder Licht Dauer + icon: mdi:alarm + min: 90 + max: 6000 + step: 5 homeassistant: customize: automation.treppe_bewegungsmelder: @@ -161,3 +182,5 @@ homeassistant: icon: mdi:briefcase automation.bad_bewegungsmelder: icon: mdi:shower + automation.schlafzimmer_bewegungsmelder: + icon: mdi:bed diff --git a/packages/room_presence.yaml b/packages/room_presence.yaml index d676a928..2084dbdf 100644 --- a/packages/room_presence.yaml +++ b/packages/room_presence.yaml @@ -75,7 +75,7 @@ sensor: value_template: >- {% if states.device_tracker.sm_g975f.state != 'home' and states.device_tracker.sm_g975f.state == 'not_home' %} - Unterwegs + {{ states('sensor.sm_g975f_geocoded_location') }} {% elif states.device_tracker.sm_g975f.state != 'home' and states.device_tracker.sm_g975f.state != 'not_home' %} {{states.device_tracker.sm_g975f.state}} @@ -90,7 +90,7 @@ sensor: value_template: >- {% if states.device_tracker.oneplus_a3003.state != 'home' and states.device_tracker.oneplus_a3003.state == 'not_home' %} - Unterwegs + {{ states('sensor.oneplus_a3003_geocoded_location') }} {% elif states.device_tracker.oneplus_a3003.state != 'home' and states.device_tracker.oneplus_a3003.state != 'not_home' %} {{states.device_tracker.oneplus_a3003.state}} diff --git a/packages/toggle_thermostat_when_window_open.yaml b/packages/toggle_thermostat_when_window_open.yaml deleted file mode 100644 index be41478c..00000000 --- a/packages/toggle_thermostat_when_window_open.yaml +++ /dev/null @@ -1,53 +0,0 @@ ---- -automation: - - id: bfbb961f-ca65-4916-b9f6-b4afabadc7af - alias: Fußbodenheizung im Bad aus/an wenn Fenster auf/zu - description: Turn on/off bathroom floor heating when the window is opened/closed - trigger: - - platform: state - entity_id: binary_sensor.contact_lower_bathroom_window_tilted - - platform: state - entity_id: binary_sensor.contact_lower_bathroom_window - action: - - choose: - - conditions: - - condition: template - value_template: > - {{ trigger.to_state.state == 'on'}} - sequence: - - service: homeassistant.turn_off - entity_id: climate.bad_thermostat - default: - - service: homeassistant.turn_on - entity_id: climate.bad_thermostat - - id: cc85d256-87ae-4303-b234-27d81c98451b - alias: Fußbodenheizung im Bad oben aus/an wenn Fenster auf/zu - description: Turn on/off upper bathroom floor heating when the window is opened/closed - trigger: - - platform: state - entity_id: binary_sensor.contact_upper_bathroom_window_tilted - - platform: state - entity_id: binary_sensor.contact_upper_bathroom_window - action: - - choose: - - conditions: - - condition: template - value_template: > - {{ trigger.to_state.state == 'on'}} - sequence: - - service: homeassistant.turn_off - entity_id: climate.bad_oben_thermostat - default: - - service: homeassistant.turn_on - entity_id: climate.bad_oben_thermostat - -homeassistant: - customize: - automation.fussbodenheizung_im_bad_ausschalten_wenn_fenster_offen: - icon: mdi:window-open - automation.fussbodenheizung_im_bad_anschalten_wenn_fenster_zu: - icon: mdi:window-closed - automation.fussbodenheizung_im_bad_oben_ausschalten_wenn_fenster_offen: - icon: mdi:window-open - automation.fussbodenheizung_im_bad_oben_anschalten_wenn_fenster_zu: - icon: mdi:window-closed