I’m trying to create an automation that notifies me if the humidity is too high in a room. I want to include the room name in the message, but cannot seem to get it to work.
I get the following error in the tracelog: Error rendering data template: UndefinedError 'dict object' has no attribute 'numeric_state'
EDIT: solved with {{ area_name(trigger.entity_id) }}
alias: High Humidity Notification
description: ""
trigger:
- platform: numeric_state
entity_id:
- sensor.th_livingroom_humidity
- sensor.th_study_humidity
- sensor.th_bedroom_humidity
- sensor.th_kitchen_humidity
for:
hours: 0
minutes: 15
seconds: 0
above: 65
action:
- service: notify.notify
data:
message: |
Humidity is too high: {{ area_name(trigger.entity_id) }}
mode: single