Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105900

Get the entity_id as string name in an automation

$
0
0

Hi, I try read name from triggered item and send message. my code is

alias: TestVoltage
description: ""
triggers:
  - entity_id:
      - sensor.sonoff_1001e7e22f_voltage_1
      - sensor.sonoff_1001e7e22f_voltage_2
      - sensor.sonoff_1001e7e242_voltage_1
      - sensor.sonoff_1001e7e242_voltage_2
    trigger: state
conditions: []
actions:
  - data:
      message: Voltage changed on {{ trigger.entity_id }} device!
      title: VOLT2.
    action: notify.evgen
mode: single

but it don’t work, I don’t receive any message
but if I change the row

message: Voltage changed on {{ trigger.entity_id }} device!

to

message: Voltage changed on {{ trigger.entity_id.name }} device!

I receive the message, but with empty name
how I can fix it and receive the {{ trigger.entity_id }} as string name?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 105900

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>