Messages with variables

In automations i use Telegraph and log entries to know what happened. But instead of a fixed message (i.e. Pool stopped) i would like to add the actual criteria, i.e. battery volt or battery soc.

How can one insert into the message text the value of a variable (sensor) ??

1 Like

Something like this?


'{{ states("sensor.mqtt_1234_plex_player_status") }}'

Yes. I tried your idea, and it works. Great. Thank you.

service: telegram_bot.send_message
data:
  message: HA000 {{states("sensor.battery_soc")}}
service: notify.persistent_notification
data:
  message: 'Test info message {{states("sensor.battery_soc")}}'
  title: Error messages tests

I tried similar method on cards de dashboard. But there this method is not supported. Correct?

I believe the only built-in card type that you can use templates in are Markdown cards. Some custom cards also accept Jinja templating, and some use other forms like Javascript.