Hi All
Just a update to everyone @gregg098 @nickrout @firstof9 @jimpower @oakbrad my effort to combining all the trackers.
- Unifi setup
- Unifi ping (Enable ping on USG! link)
- NMAP
- Fixed IP’s on all iPhones
- Installed HA app and setup GPS
- Install Bluetooth on Rasp3 and enable this (Reboot, disable wifi on phones and search on BT)
After some much testing I setup my first bayesin sensor
binary_sensor:
- platform: bayesian
prior: 0.5
name: 'Victoria Presence'
probability_threshold: 0.9
observations:
- entity_id: 'device_tracker.victoriasiphone_ping'
prob_given_true: 0.9
prob_given_false: 0.1
platform: 'state'
to_state: 'home'
- entity_id: 'device_tracker.victoria_iphone'
prob_given_true: 0.9
prob_given_false: 0.4
platform: 'state'
to_state: 'home'
- entity_id: 'device_tracker.victoriasiphone_2'
prob_given_true: 0.8
prob_given_false: 0.4
platform: 'state'
to_state: 'home'
This gave me a on/off for presence like this:
But I wanted a device_tracker so I found this great Node Red string from https://diyfuturism.com/
I then created this:
You dont have to create this by hand, just paste below code and change your own HA settings/names
(Again thanks to https://diyfuturism.com/ unfortunately the DB is down on this page so I am pasting the code below)
[{“id”:“763070f9.0c571”,“type”:“switch”,“z”:“4056fc4f.0baa64”,“name”:"",“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“on”,“vt”:“str”},{“t”:“eq”,“v”:“off”,“vt”:“str”}],“checkall”:“true”,“outputs”:2,“x”:1316.9999771118164,“y”:301.00000381469727,“wires”:[[“57b903a4.bd2f6c”],[“a080246.03d5ed8”]]},{“id”:“57b903a4.bd2f6c”,“type”:“api-call-service”,“z”:“4056fc4f.0baa64”,“name”:“Set Presence Home”,“server”:“8ac3cd7f.58d3e”,“service_domain”:“device_tracker”,“service”:“see”,“data”:"{“dev_id”:“brad_bayesian”,“location_name”:“home”}",“x”:1510.3333740234375,“y”:272.6667175292969,“wires”:[]},{“id”:“a080246.03d5ed8”,“type”:“api-call-service”,“z”:“4056fc4f.0baa64”,“name”:“Set Presence Not Home”,“server”:“8ac3cd7f.58d3e”,“service_domain”:“device_tracker”,“service”:“see”,“data”:"{“dev_id”:“brad_bayesian”,“location_name”:“not_home”}",“x”:1520.3333282470703,“y”:335.99999380111694,“wires”:[]},{“id”:“afb02bc5.351e68”,“type”:“comment”,“z”:“4056fc4f.0baa64”,“name”:“Convert Bayesian Sensor into Device Tracker”,“info”:"",“x”:1015.0000381469727,“y”:252.00008296966553,“wires”:[]},{“id”:“a86ac3f0.00c67”,“type”:“inject”,“z”:“4056fc4f.0baa64”,“name”:"",“topic”:"",“payload”:"",“payloadType”:“date”,“repeat”:“10”,“crontab”:"",“once”:false,“x”:942.3333129882812,“y”:300.6665403842926,“wires”:[[“d43007ca.720b78”]]},{“id”:“d43007ca.720b78”,“type”:“api-current-state”,“z”:“4056fc4f.0baa64”,“name”:“Bayesian Presence”,“server”:“8ac3cd7f.58d3e”,“halt_if”:"",“entity_id”:“binary_sensor.bayesian_presence”,“x”:1142.3333892822266,“y”:300.66639733314514,“wires”:[[“763070f9.0c571”]]},{“id”:“8ac3cd7f.58d3e”,“type”:“server”,“z”:"",“name”:“Home Assistant”,“url”:“http://HASSIP:8123”,“pass”:“XXX”}]
Then I finally get my normal icon but its based on all my sensors from my bayesin setup
That is based on
SO IS THIS PERFECT? NO! but it’s getting to a point where its better than anything I had before
UPDATE: I got the Home detection to be within seconds and no false positives!
The leaving home is now taking 7 min before registering but its stable, so I think I have to live with that
Cheers
Casperse