I set up a Telegram bot as a notifier for automations. I’d like to use a variable in the message to indicate my presence. For example, have the automation trigger when my device tracker arrives or leaves, then send a message that my presence is “X”. How would I write the variable that shows my presence value?
- service: notify.your_telegram_service_here
data:
title: '🌎 *Location Updated*'
message: "hatrabbit is {{ states('device_tracker.hatrabbit') }}"
Awesome, thanks.
You can make the message a little nicer than 'not_home'
like this:
message: "hatrabbit is {{ states('device_tracker.hatrabbit')|replace('_', ' ') }}"
this will give you hatrabbit is home
or hatrabbit is not home