I have have two triggers. One for arriving in the oofce and one for leaving. How to merge them into one.
Trigger 1:
id: conradwork
alias: 'Conrad is in the office'
trigger:
- platform: state
entity_id: device_tracker.homeassistant_conrad_iphone6s_owntrack
from: 'not_home'
to: 'Work'
action:
service: notify.pushover
data:
message: "Conrad is in the office!"
You could use some automation templating to achieve what you want. The first example on that page is actually quite similar to what you want to do.
The grammar might be a little funny, but you could even just use the “enter” or “leave” events as described here, which I think would have the syntax of {{ trigger.event.state }}.
You might still want to have two separate triggers (same ones you have now), but it’s okay for an automation to have two triggers. But with templating you can pull the zone or event that caused the automation to trigger, and use that in your notification.
If you want the language to be more natural, a better option might be to use an if statement in your notification as shown here.