Lovelace alarm panel automation

Hi there,

I’m trying to refocus on my virtual alarm panel on Lovelace. I have set up an automation to trigger a notification if any of my doors are opened in the trigger section. That was straight forward enough, but I’m not sure how to handle the message section of the notification.

I want to have in this single automation the message to tell me which of the defined sensors in my trigger section triggered the alarm?

I assume some type of sensor template would need to be used? Could someone with coding knowledge help me get started with that?

I first tried putting the doors in a group and passing the group state to the message payload, but that only says of the group is ‘on’. That a sensor in that group was triggered but not specifically which one. Would greatly appreciate some guidance on how to progress

You must have a lot of doors lol I just spelled out which one is which in my Pushbullet or Google TTS. Basically 2 door sensors with 2 diff messages.

This alarm custom component will do all that for you and much more (select sensors from lists, home and away mode, entry/exit times etc…): YET another take on an alarm system Unfortunately it needs an update for HA v0.88.

However if you want to use your version your message should be formatted similar to this (you don’t say what notification service you are using). This is for an iOS group, you can adapt the message to your notification service. The important parts are data_template: (instead of data:) and the message template formatting.

  action:
  - service: notify.all_ios_devices
    data_template:
      message: "{{ trigger.to_state.attributes.friendly_name }} has TRIGGERED!!!"
1 Like