Hi folks, first time poster, be gentle with me!
I’ve been fiddling with HA for a couple of months now, and I have it doing a few things that I’m happy with - but I’m having little luck with device tracking, and I hope someone can point out where I’m going wrong.
I am trying to use Owntracks, connected to a free CloudMQTT instance, then trigger automations based on devices changing zone.
My device shows as “HOME” on HA->Overview, and shows in the correct place on the map when I’m out. The configured Zones show as yellow circles on the map. So (I believe) the Owntracks -> CloudMQTT -> HA path must all be working, and the problem lie with my automations(?)
I’ve setup a bunch of similar test automations, cribbing from examples on the HA site. These appear under “Automation” on HA->Overview, and work if activated manually (i.e. send a notification via mailgun). But they don’t ever trigger on my device moving/changing zones.
I DO see entries in the logbook such as " is at "
I suspect (part of) the problem is that I’m not referring to devices correctly. Can someone explain the distinction between the Owntracks settings “Device ID”, “Tracker ID” and “username”, and which should be used in HA with entity_id: device_tracker.?
Or I guess equivalently, which part of the device entry in known_devices.yaml goes in entity_id: device_tracker.?
I also have the Unifi device tracker component installed, which might complicate things? But I think that, so far, HA is simply seeing everything on unifi, including the phones that are also running Owntracks, as entirely separate devices (“Android-xxxxxxx”)
Any suggestions?
Here’s my automations.yaml:
- alias: 'Leave Home Test'
trigger:
platform: zone
event: leave
zone: zone.home
entity_id: device_tracker.apgS3New
action:
service: notify.mailgun
data:
message: 'Test left the house'
- alias: 'Leave Home notification apgS3'
trigger:
platform: zone
event: leave
zone: zone.home
entity_id: device_tracker.apgS3
# condition:
# condition: time
#after: '20:00'
action:
service: notify.mailgun
data:
message: 'A (apgS3) left the house'
- alias: 'Leave Home Vanadium'
trigger:
platform: zone
event: leave
zone: zone.home
entity_id: device_tracker.Vanadium
action:
service: notify.mailgun
data:
title: 'Vanadium left the house'
message: 'Vanadium left the building'
- alias: 'Leave Home notification S3'
trigger:
platform: zone
event: leave
zone: zone.home
entity_id: device_tracker.S3
# condition:
# condition: time
#after: '20:00'
action:
service: notify.mailgun
data:
title: 'A (S3) left the house'
message: '...yes he did!'
- alias: 'Arrive Home notification apgS3'
trigger:
platform: zone
event: enter
zone: zone.home
entity_id: device_tracker.apgS3
action:
service: notify.mailgun
data:
message: 'A (apgS3) got home'
- alias: 'Arrive GT notification apgS3'
trigger:
platform: zone
event: enter
zone: zone.gt
entity_id: device_tracker.apgS3
action:
service: notify.mailgun
data:
message: 'A (apgS3) got to GT'