I spent most of my life today setting up owntracks and getting it working. I seem to have succeeded. I had to bridge the MQTT from my cloudmqtt.com to my local mosquitto on my ubuntu server but there are a couple great posts here with perfect directions.
Drove the neighborhood watching Home and Away trip and it seems to be working great.
I actually almost have this figured out. However one question. I have this set (just for play) so that when a switch is tripped the squeezebox (calendar) starts playing.
automation 9:
alias: Calendar begins playing
trigger:
- platform: state
entity_id: switch.front_room_light
state: 'on'
action:
- service: media_player.media_play
entity_id: media_player.calendar
What I want is so that when the device tracker sees me coming home it turns on this media player so the talk radio is playing when I walk in the door.
However the state being “Home” I don’t want it to turn on just because I’m home. Just when I come home from work. Conditions? Conditions “and” with “time” maybe?
I am actually getting the hang of this Home Assistant thing. Now I’ll make it only be able to happen Mon-Fri from 4 to 5:30 PM or something like that. I’m usually listening to a certain program when I get home and I always miss a minute or two fumbling around getting situated being home and fighting off a happy dog. No more!
automation 9:
alias: Calendar begins playing
trigger:
platform: zone
entity_id: device_tracker.phone_phone
zone: zone.home
# Event is either enter or leave
event: enter
action:
- service: media_player.media_play
entity_id: media_player.calendar
Is this it? No way to test until tomorrow other than triggering it which works and I don’t want to drive circles around the neighborhood anymore tonight
automation 9:
alias: Calendar begins playing
trigger:
platform: zone
entity_id: device_tracker.phone_phone
zone: zone.home
# Event is either enter or leave
event: enter
condition:
condition: and
conditions:
- condition: state
entity_id: device_tracker.phone_phone
state: 'home'
- condition: time
after: '16:00:00'
before: '17:45:00'
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: media_player.media_play
entity_id: media_player.calendar