-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up Presence Detection #216
Comments
I've done some other tests. |
A bluetooth device has to advertise itself using beacons. It seems you've solved that part by using nrf connect. I'd suggest to get an actual ble beacon you can for example put on your keychain. Having for phone constantly sending beacons will drain its batteries. For me Gigaset G-Tag work quite well, but other tags should work too. |
I understand but HA companion can simulate a beacon on my phone. But it seems that the infos which are advertise doesn't fit the infos asked by your code (name and address). Is it possible? |
The thing is it's not exactly standardized what a ble beacon looks like. There many format iBeacon and eddystone being the two most known. I'm not exactly sure what kind of beacon HA companion simulates. You can try other apps, there are plenty that simulate beacons, and usually you can select what kind of beacon you want to simulate. |
HA companion simulates iBeacon. |
There's indeed a check that a device has to have a name. If I omit this check, I see a crazy amount of devices in my area - too many to transfer via MQTT due to memory constraints. I understand that just having one device looks appealing, but do you really want to drain your phone battery due to this? Those beacons are always transmitted, wether you're home or not. It could be made configurable to skip the name-check, maybe it works in less urban environments. |
Maybe have a list of IDs that are passed through? |
I simulate an ibeacon with HA companion for 2 days now and i don't notice a major difference on my battery. |
I'm sorry if i ask stupid things but the "presence/devices" topics is not in json ? Am i right ? I'm sorry, I realize I did not say thank you for the amazing work. As i said i'm new to automation and my english is poor so i went straight to the point... |
Hi, yes I know this is a bit inconsistent, but JSON has a lot of redundant information, and I need to keep the message short due to memory constraints. CSV is a lot more space efficient. The presence detection is somewhat of a byproduct since NUKI signals state changes via beacons, so they are received already, NUKI Hub is just publishing them to MQTT, but not its main functionality. Maybe the easy solution is to just run another ESP with espresence? |
"The presence detection is somewhat of a byproduct since NUKI signals state changes via beacons, so they are received already" I fear i miss something... how do you set your lock to open when you're tag is recognized? |
Oh i understand if it's not the purpose of the development. |
Someone gave me the code for HA. If someone is searching the same feature than me later, i put it here. But it doesn't work with HA companion because it doesn't advertise "name". Set the value higher than 50, if you want a wider range. mqtt:
|
Why don't you just use another app that allows you to send the name? |
Cause it's an other app using battery and space on my phone. Most of apps need to have a permanent notification. I like to keep it simple and invisible. |
I've tried a Tile beacon. It doesn't advertise a name either, so doesn't work with presence detection on Nuki_hub. |
Hello, I'm sorry to bother you again with that problem. |
Can you point to me to where you read that? |
Check if this binary works. Beacons will be added if they match that minor ID, which should be the case for the HA companion app as far as I understand. |
Sorry but it's not working. |
Do you know if they updated the android app already? |
Yes but only in beta which i have |
I don't think it matters too much because the only change is that 40004 minor value is set by default now (to match the future change in ibeacon tracker integration) |
Well that is the important part. The binary above should check for that minor ID, and if found it should be added to presence detection. |
ok I see |
I don't know anything about code but it seems you have a "scanner" and then you build the mqtt message from address , name and rssi. Maybe it's not showing because it has no name to show ? |
Correct, everything without a name is filtered out, this is intentional. It could be made configurable though, but you'll detect a lot of devices eventually. And there's a limit to how many devices can be published, due to limitations of using a microcontroller, so eventually if you live in an urban environment, you won't see your device because it's omitted because too many devices are detected. |
It's exactly the same problem with iBeacon tracker in HA. So they set a exception on minor 40004 to allow no named devices to be discovered. |
I'm curious. How do you open your door? You have a beacon with a name? |
I'm using a Gigaset G-Tag, which I have on my keychain. Better than using an app I think, because it'll drain your phones battery if it's constantly broadcasting beacons. |
Honestly, the HA app doesn't drain my battery at all. |
@swann05 Please recheck with this binary, it works for me. It seems the special minor id is not beta anymore. |
It's working ! |
That sure can be done. |
It's all good ! Thank you very much ! |
Hi, I'm sorry if it isn't the right spot to ask this. I'm new in home automation.
I try to set up a Presence detection via Bluetooth and was thinking about detection through the lock. I've found that i can see some devices through mqtt > nuki/presence/devices.
But i can't understand why i can't see my phone. There are 4 devices : nuki lock, and 3 others that i guess to be my sonos devices.
That's it ! I can't see my phone or my wife's ...
I have HA and running HA companion with beacon activated.
The text was updated successfully, but these errors were encountered: