First off thanks for all the time and effort on a great plugin!
I only have on rPI at the moment and I simply want to run a conditional action based on who is closer to said rPi. I imagine it will have to be script based and wondering if I should use txpowerreceived or Pi_0_Distance or something else?
Its a big PITA as the rPi I completely out of range of indigo so I can't really see anything real time, and I'm ok at modifying python, not so much its creation....
For reference I have a dummy switch connected to an aeotec microswitch that I use to set my receiver to Speaker B output, source as Apple TV, and airplay the shuffled "bathroom" playlist. I'd like to have it specific to who ever hits the switch. It's pretty much the highest WAF rating I've ever gotten with automation.
Comparing distances
Re: Comparing distances
txpowerreceived or Pi_0_Distance:
distance is calculated from signalreceived and txPower: you can find discussion on how to calculate it on the web at many places.
"rPi is completely out of range of indigo", what does this mean : far away, not connected ..?
If you want to know which iBeacon is closest, yes currently you have to do this yourself. with triggers for each ibeacon and then rank the ibeacons.. But that is actually a good idea to add.
Give me a day. I can add a field that gives the device name of the closest ibeacon.
Q: what if no beacon is connected = all gone: should it keep that last name or make it blank? or "none"
Karl
[edit]
was easy to add..
next Q: should there be a cut off in distance: ie if distance > 10m (= not in room) ignore?
and should it be a parameter for each RPI or same for all?
distance is calculated from signalreceived and txPower:
Code: Select all
dist = sqrt( 10**( (txPower-rssi)/10 ) )"rPi is completely out of range of indigo", what does this mean : far away, not connected ..?
If you want to know which iBeacon is closest, yes currently you have to do this yourself. with triggers for each ibeacon and then rank the ibeacons.. But that is actually a good idea to add.
Give me a day. I can add a field that gives the device name of the closest ibeacon.
Q: what if no beacon is connected = all gone: should it keep that last name or make it blank? or "none"
Karl
[edit]
was easy to add..
next Q: should there be a cut off in distance: ie if distance > 10m (= not in room) ignore?
and should it be a parameter for each RPI or same for all?
Re: Comparing distances
here some screen shots:
1. RPI device edit 2. RPI device state: you can get the device name ... w:
will publish later today . still need to do some testing and optimizing
Karl
1. RPI device edit 2. RPI device state: you can get the device name ... w:
Code: Select all
yyyy = indigo.devices["name of your rpi"].states
xxx = yyyy["closestiBeacon"]
if xxx.find("@")>-1:
nameOfBeacon = xxx.split("@")[0]
distToRPI = float(xxx.split("@")[1])
indigo.server.log(" closest beacon to RPi is "+nameOfBeacon+" at distance of "+str(distToRPI))
# do something with dist
if distToRPI < 3:
indigo.server.log("beacon is very close" )
else:
indigo.server.log("no iBeacon is close" )Karl
Re: Comparing distances
@new2me07 check out the latest release v7.97.252. It should do everything you requested.
Karl
Karl