So here is my question. I have a binary sensor group called binary_sensor.doorandwindows which not surprisingly, contains all my doors and windows in a group. When one entity is open, it is on, whilst when they are all closed, its off.
My issue is I have an automation which alerts me if any doors/windows are open after 10:30, however I don’t have an easy way of identifying which one is open. I can see in the logs, it shows which one triggered it, but i want to know how to get this information out via a template.
Thanks for getting back to me, unfortunately that didn’t work.
Below is the whole automation:
alias: Notify Doors Windows Open after 22:30
trigger:
- at: "22:30:00"
platform: time
id: Time_2230
condition:
- condition: state
entity_id: binary_sensor.doorandwindows
state: "on"
action:
- data:
message: "A door or Window is open"
title: Alert
service: notify.mobile_app_**mobile**
mode: single
When I added the code to the message part of the action, it said “Error rendering data template: UndefinedError: ‘trigger’ is undefined”