Yeah right now RA reports which room you are essentially nearest, which doesn’t help our efforts to get all 3 positions.
I’ve spoken to the dev of RA, and they are looking at providing all values / distances via MQTT by device ID.
This would mean you would have:
Room-assistant/phone1/summary/
{ “node1” : { “distance” : 22 , “status” : “online”}, “node2” : { “distance” : 5, “status” : “online”},
“node3” : { “distance” : 8 , “status” : “online”}
Then you could easily parse those JSON distances and states to node-red for calculation.
However in the meantime I’m using the room-assistant API which works, but means I have to query it from node-red.
Running 2 queries actually:
- Hit all node API endpoints /status - and checking there are no errors
- Hit 1 of the nodes API that is online and you can get all the distances. To make it a tad more reliable it would make sense to have 1 or 2 nodes more than you need. Then based on the results in theory pick the 3 lowest values (or 4 for 3D trilangulation) (ie the closest to the phone) and drop the ones that may be close to the edge of the range and cause issues Orin a big house not actually see the phone at all.
I had this delusion of grandeur that I’d have some free time over Christmas to test and investigate - my toddler has other plans lol
Oh, re the distance - it’s an arbitrary measure of the signal strength calculation RA uses. I haven’t figured out what the optimum measure is yet so have kept the distance consistent but starting with 1 node and checking the distance in real life (say 10 was the difference in distance from my office door to the office wall) then I used that same scale to workout the other distances in the house. It does take some tinkering and some patience.
I’ve now got 7 ESP32s flashed with the same ibeacon info and testing the Rooms app.
Issue with that is it’s all on the phone so will use the battery more - but the AI part of it allows for training which basically says “I know I’m in this room because I can see these beacons and these strengths)
I haven’t worked out how to apply a similar AI model from node-red so hopefully going to teach myself how to do that over the next few weeks as I prefer the Rpi room-assistant set up, but the AI training process would teach the process which room you are most likely in.