Hi,
I have an automation that takes data from the proximity sensor and I would like to associate its distance to the notification of the single entity. I can’t find the trigger to insert in the notification. I tried with {{ states(‘trigger.to_entity_id’) }} but it didn’t work.
I report the complete automation:
alias: notify distance
description: ""
triggers:
- trigger: numeric_state
entity_id:
- sensor.casa_composite_aaa_distanza
- sensor.casa_composite_bbb_distanza
- sensor.casa_composite_ccc_distanza
for:
hours: 0
minutes: 0
seconds: 15
above: 950
- trigger: numeric_state
entity_id:
- sensor.casa_composite_aaa_distanza
- sensor.casa_composite_bbb_distanza
- sensor.casa_composite_ccc_distanza
for:
hours: 0
minutes: 0
seconds: 15
below: 950
conditions: []
actions:
- data:
message: |
Ore {{ states('sensor.time') }} di {{ states('sensor.weekday') }} {{
states('sensor.data_ita_custom') }}
title: |
{% if trigger.event == "above" %}
{{ trigger.to_state.name }} dista {{ ?????? }} da casa
{% else %}
{{ trigger.to_state.name }} sta rientrando a casa e dista {{ ??????? }}
{% endif %}
action: notify.miotg
Thanks in advance