I have a problem with no idea how to solve it. Need some help.
I have presence based on phone BT. A raspberry is doing scans every 30 seconds and publish status via MQTT.
I need to, once some person is detected, to keep that status for some time (like 10 minutes), but if the phones goes away of the BT radio, is will publish status ‘not_home’.
If I set the scan frequency to a lower rate, it will take a long time to detect someone. I tried to make some automation but did not work.
I also have presence detection with ping to the ip device, but BT is much faster when I come home and some times phone does not connect to wifi immediately, but BT is always discovered after few seconds I cross the door (but then if I go away the BT radio, it changes to not_home and that is my problem).
Sure, is quite simple:
I have two device trackers for each person:
Phone BT (with a raspberry for detecting and then publishing via mqtt) -> tracker_bt
Phone ping (as soon as phone connects to the internet, it changes to home state) -> tracker_phone
So, what I made was, when tracker_bt was detected (person status change to home), then I set up tracker_phone to home as well (it has the property consider_home set to 10 minutes).
But it did not worked, because as soon as tracker_bt change back to not_home, person status also change to not_home (even tracker_phone was still with home status).