Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95925

Get warning when window open and cold outside

$
0
0

@rak wrote:

Hi guys,

i try to understand how timer work with this use case.
I have a window state which is offen/zu/gekippt (open/close/tilt).

- alias: "Warn for open windows when cold"
  trigger:
    - platform: state
      entity_id:
        - sensor.window_arbeiten
      to: "offen"
      for:
        seconds: 15
    - platform: event
      event_type: timer.finished
      event_data:
        entity_id:
          - timer.window_open_reminder_arbeiten
  condition:
    - condition: numeric_state
      entity_id: sensor.netatmo_aussen_temperature
      below: 17
  action:
    - service: notify.alexa_media
      data_template:
        target:
          - media_player.echo_wohnen
        data:
          type: announce
        message: "Das Fenster {{ trigger.to_state.name }} ist auf."
    - service: timer.start
      data_template:
        entity_id: "timer.window_open_reminder_{{ trigger.entity_id | replace('sensor.window_','') | replace('timer.window_open_reminder_','') }}"
        duration: '00:00:15'

The 15 seconds is for testing only. Later it should be 15 minutes.

I doo the replace stuff bc I would like to have one rule for many windows and respective timers.

Whats wrong with this. The timer seems not get set in the 2nd service call.

Regards
Ralf

Posts: 7

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>