Push which window has been opened

Hi there,

I’m using “Pushover” for notification like “windows left open”, “door bell” or “window has been opened” (if I’m away or sth). Works nice so far.

But I would like to have a push-notification with the information, which window has been opened. Especially, when I’m not at home.

like:
Entity “anyone-at-home” is not active and entity “kitchen-window-sensor” activated → pushover notification “Kitchen window has been opened”

Is there a solution for it?
I don’t want to create 17 automations (one for each window) with nearly the same configuration :see_no_evil:

Cheers!

This is really easy actually.

Create the automation and use the trigger.to_state.attributes.xxxx (i think) as the variable value in your pushover notification.

I have something with Join to tell me when someone leaves or comes home, here’s the excerpt

- alias: Someone Came Home
  trigger:
    - platform: state
      entity_id: group.a, group.b, group.c, group.d
      from: 'not_home'
      to: 'home'
      for:
        seconds: 5
  action:
    - service: mqtt.publish
      data_template:
        topic: "ha/tracker/{{ trigger.to_state.attributes.friendly_name | lower }}"
        payload: home
        retain: true
    - service: tts.google_say
      entity_id: media_player.livingroom_speaker
      data_template:
        message: "{{ trigger.to_state.attributes.friendly_name }} is home now"

here’s my Join notification that goes to my phone

    - service: notify.join_a
      data_template:
        title: "Home Assitant"
        message: "{{ trigger.to_state.attributes.friendly_name }} left home at {{ states('sensor.time') }}"

You should be able to cobble something that works for you from this.

mta: forgot some code

1 Like

Works great so far. Couldn’t get it work with groups, but with the entities.
Looks like this:

alias: "PUSH: Fenster wurde nachts oder in Abwesenheit geöffnet"
description: ""
triggers:
  - entity_id:
      - binary_sensor.eg_garderobe_fensterkontakt
    to: "on"
    trigger: state
  - entity_id:
      - binary_sensor.eg_bad_wc_fensterkontakt
    to: "on"
    trigger: state
...
...
...
actions:
  - data:
      message: "{{ trigger.to_state.attributes.friendly_name }} wurde geöffnet"
      title: WARNUNG
    action: notify.pushover
mode: single

But now I would like to do something similar (another automation) and can’t get it to work:
Trigger is “between 22 and 5 o’clock” and “last one leaves home”
Conditions are all my windows in one “or” operation.
action: Pushover-Message.

message: "{{ trigger.to_state.attributes.friendly_name }} wurde geöffnet"

does not work here, because it is the condition, in the “or”-operation, which fires the action.
I tried “condition.to_state.attributes.friendly_name” but doesn’t work.

Is there a solution for this kind of automation?

To exchange triggers and conditions doesn’t work for me, because this automation does two things:

  • notify me, if there is a windows left open
  • notify me, if someone opens a window between 22 and 5 o’clock

Cheers!