Windows Notification

I´m new to Hassio and switching from Fhem to this.

I want to create an automation when a window contact changes state to get a pushover notification.

All my sensors beginn with “TS” (TS Badezimmer, TS Wohnzimmer …)
In Fhem I can say if TS.* equals open then pushover “$Device was opened”

So I have one rule that contains all my sensors and set the name in the notification dynamicly.

Is this possible here too ?

No, when specifying entities to be monitored, you can’t use a wild-card like *.

so I must make an automation for every sensor ? that’s sounds bad.

would it possible in future to add regex or wild-cards ? would make some thinks a lot easier. I don’t know if there is already a discussion or more infos about that for hassio

Notifications for example or battery low alarm (I have over 20 different devices that have a battery reading). I have a few more ideas where this is useful.

I use node red and telegram in this fashion.

I use node red and telegram in this fashion.

Thats a way but I think not the best. implement wild-cards or something simliar would make much more possibilities. and safes resources because I don’t need to run x services for such things.

I find node red to be the best automation for me. So much easier to debug and test with.

Ok. But that doesn’t currently exist and people have been asking for it for years…so unless you’re going to add it in, you’re going to have to be open to alternative options.

I think this would do what you want.

  - id: sensor_notification
    alias: Sensor Notification

    trigger:
      - platform: state
        entity_id:
          - sensor.sensor1
          - sensor.sensor2
          - sensor.sensor3
          - sensor.sensor4
          - sensor.sensor5

    action: notify.notify
    data_template:
      title: Sensor Open
      message: "{{ trigger.from_state.state.name }} - {{ trigger.from_state.state }}"
1 Like

No, you can use one automation that is triggered by multiple sensors. However, you must identify the sensors (see the example provided by jazzyisj).


I think I understand the advantage of supporting a wild-card. If in the future you were to add a new sensor called ‘TS Something’ then the automation would automatically include it because it triggers for any sensor name beginning with the letters ‘TS’.

Currently, there is no support for wild-cards anywhere in Home Assistant. If you want it, search the Feature Requests section of this forum for an existing request for it (if any) and vote for it or create a new request.

There is another way to do it that almost exists in Home Assistant. Currently you can create a group of sensors. What doesn’t exist is the ability for Home Assistant to monitor the group’s sensors for state-changes. It almost exists because there is a function called expand which expands groups into their individual group-members. So the automation’s trigger would look something like this:

    trigger:
      - platform: template
        value_template: >
           {{ expand('group.windows') | selectattr('state', 'eq', 'on') | list }}

However, currently this will not monitor the states of the members of group.windows but the state of the group itself. If you would like to see it use the members of the group, you may wish to cast a vote for this Feature Request to have it work that way.