I might be trying to cram too much into one automation, but here goes: I want to determine which of two device trackers arrives or leaves which of of two locations. I wrote a super long automation that successfully figures this out, and now I want to send the result in a Telegram message. I need a variable for which person triggered the message, for whether they arrived or left, and for which location. I came from Hubitat where variables like %device% and %value% work, but now I need to know how to accomplish it in Telegram. The code for my triggers is below.
- id: '1629262345220'
alias: Who arrived/left?
description: ''
trigger:
- platform: zone
entity_id: device_tracker.life360_buster
zone: zone.shop
event: enter
- platform: zone
entity_id: device_tracker.life360_trixie
zone: zone.shop
event: enter
- platform: zone
entity_id: device_tracker.life360_buster
zone: zone.shop
event: leave
- platform: zone
entity_id: device_tracker.life360_trixie
zone: zone.shop
event: leave
- platform: zone
entity_id: device_tracker.life360_buster
zone: zone.bar
event: enter
- platform: zone
entity_id: device_tracker.life360_trixie
zone: zone.bar
event: enter
- platform: zone
entity_id: device_tracker.life360_buster
zone: zone.bar
event: leave
- platform: zone
entity_id: device_tracker.life360_trixie
zone: zone.bar
event: leave
- platform: zone
entity_id: device_tracker.life360_buster
zone: zone.crib
event: enter
- platform: zone
entity_id: device_tracker.life360_trixie
zone: zone.crib
event: enter
- platform: zone
entity_id: device_tracker.life360_buster
zone: zone.crib
event: leave
- platform: zone
entity_id: device_tracker.life360_trixie
zone: zone.crib
event: leave
condition: []
action:
- service: telegram_bot.send_message
data:
message: *I need to know how to write this*
mode: single