Telegramm message sent value of entity

Hi all,

i am pretty new to Home Assistant (right now figuring out if I should switch over from iobroker).
My most likely easy problem right now is to send a telegram message with a value of an entity, the yaml looks like this right now:

- id: '1618640651279'
  alias: Telegram USV discharge below 50%
  description: ''
  trigger:
  - type: battery_level
    platform: device
    device_id: 09eb7e30f2fa8d2ceddeb97369a86927
    entity_id: sensor.usv_battery_charge
    domain: sensor
    below: 75
  condition: []
  action:
  - service: telegram_bot.send_message
    data:
      title: USV
      message: test
  mode: single

but instead of the “test” i want to sent the value of my entity: “sensor.usv_status” (which is a string). I couldn’t find anywhere how to do this, what would be the right way to get this going?

thanks a lot!

1 Like

I guess it should be something like:

data:
  title: USV
  message:  "{{ states.sensor.usv.state. }}"

You can try it manually in the developer-tools section using templates

Do not use this format:

message:  "{{ states.sensor.usv_status.state }}"

Read the warning about it generating errors in the templating documentation. Use this format instead:

message:  "{{ states('sensor.usv_status') }}"
2 Likes

Thanks, that worked!