I’ve been busy creating my rules and such to help automate my house, I have the following rule:
- alias: People Arriving Home
trigger:
platform: state
entity_id: device_tracker.name1, device_tracker.name2
from: 'not_home'
to: 'home'
action:
service: notify.fb
data:
message: 'Welcome home.'
target:
- +44xxxxxxxxxxxxxx
What I would like is to include in the fb notify the name of the device tracker that triggered the event. Is there a clever way to do it, or do I need multiple rules for each device_tracker?
What you want to do is exactly (well almost) what I was setting up today. I will try and help, just understand I too am still learning and by no means an expert.
- alias: People Arriving Home
trigger:
platform: state
entity_id: device_tracker.name1, device_tracker.name2
from: 'not_home'
to: 'home'
action:
service: notify.fb
data_template:
message: "Welcome home {{ device_tracker.name }}"
target:
- +44xxxxxxxxxxxxxx
Now, how you extract the friendly name from that I am not sure of. It may need some tweaking, but the templating is what you are after I believe. I ‘think’ it will be something along the lines of {{ trigger.to_state.friendly_name }} but don’t hold me to that.