pasoad
(Pasoad)
March 1, 2020, 6:56pm
1
Hi homie !
I’ve got some issue with this automation, i tried to send a notification to my wife’s phone when i leave my work but can’t make it work.
Here is the code :
alias: "when_pa_leave_work"
trigger:
- platform: state
entity_id: device_tracker.bla_l09
from: 'travail_pa'
to: 'away'
condition:
- condition: time
after: '17:50:00'
before: '20:00:00'
weekday:
- mon
- tue
- thu
- fri
- sat
action:
- service: notify.mobile_app_bkl_l09
data_template:
message: "P.A. vient de partir du boulot"
Have you got some tips for me please?
AhmadK
(akasma74)
March 1, 2020, 7:02pm
2
well, basic stuff first: trigger your automation without conditions to see if it works, then with conditions.
if both work, your trigger is wrong.
I don’t know anything about trackers so that’s it from me
1 Like
tom_l
March 1, 2020, 7:13pm
3
Instead of ‘away’ try ‘not_home’.
Use a zone trigger instead of state trigger
3 Likes
pasoad
(Pasoad)
March 1, 2020, 7:46pm
6
Woaw! so many people to help me! Thanks a lot @tom_l @AhmadK @Marsman
I’ll try your solutions tomorrow and come back here to tell if it’s working.
i had a similar problem with the same notification intent
and the only way I got it working was using the Zone trigger as @Marsman suggests
Twan
(Antoine)
March 2, 2020, 3:16pm
8
Hi !
As @tom_l and @Marsman suggested, use not_home
instead of away
and use a zone trigger.
Here’s my config where I broadcast when I leave work if there’s anybody home, and include my ETA from the Waze sensor
Hope it helps !
pasoad
(Pasoad)
March 2, 2020, 8:33pm
9
So i did a test today and it’s working!
This is what i’ve done:
I tried to replace “state” by “zone” as trigger but home assistant told me there was something wrong with my automation.
I tried this but didn’t change anything.
Here i saw that i used the device name for the entity (device_tracker.bla_l09) in state of the owner name (for here: person.p_a)
So thanks a lot all for your help !
PS: @Twan Also love classic 21 radio
Twan
(Antoine)
March 2, 2020, 10:11pm
10
Glad you made it work !
Also, do not forget to link your tracker to the right person :
PS: I had to be quite clever to make Classic21 to play on my Google Home devices