mKeRix / room-assistant

Presence tracking and more for automation on the room-level
https://www.room-assistant.io
MIT License
1.27k stars 122 forks source link

Support for Crownstones #192

Closed mrquincle closed 4 years ago

mrquincle commented 4 years ago

Is your feature request related to a problem? Please describe. Crownstone will be supporting Home Assistant. The first release is planned in six weeks from now. The Crownstones themselves are small hardware units that can be placed behind power outlets or in the base of light fixtures. They can switch, dim, monitor energy consumption, but they also operate as Bluetooth LE beacons and scanners.

Describe the solution you'd like We're interested in integration. The more inputs are possible, the better the indoor localization algorithms become.

Describe alternatives you've considered We've a lot of expertise in Bluetooth LE as can be witnessed on e.g. our blog. The hardware runs firmware which we implement open-source and can be found on github. The alternative would be to only integrate with home assistant and disregard projects like yours that helps users to achieve the same goals as we would like to help them attain.

Additional context This is just an informal feature request, asking if support for this type of hardware would fit on your roadmap. If the request is out of scope, feel free to close this issue of course!

paulrbeers commented 4 years ago

@mrquincle How are you tracking iphones and watches? I could use BLE if there was a simple way to track an iPhone without having to resort to starting an app every time I restarted my phone (truthfully the real problem is my wife, she'd never remember....love her to death, but she would just roll her eyes at me if I told her she had to boot up an app every time she restarted her phone).

mrquincle commented 4 years ago

@paulrbeers Yes, not to have to start an app after a boot is important. Although developers can make some mistakes here and there, this is feasible though. Our apps start automatically, on iPhone and Android.

Then, to track a watch, you need devices (like RaspberryPIs or Crownstones) that scan for the watch. The algorithms do not reside on the watch itself. Now it completely depends on the smart watch at hand. How often does it advertise? How often does it rotate its MAC address? Often wearables, when connected, do stop advertising. For example, the Fitbit does, the Jawbone didn't. You might sometimes have to use tricks like described in this issue to force e.g. an Apple Watch to advertise. By first pairing it with a headset it wants later on to be connectable to it, so it keeps advertising. If it has never paired to a peripheral before the watch won't do so.

paulrbeers commented 4 years ago

@mrquincle I know the issues with watches (you linked to my trick to fix Apple Watches wink ).

I noticed crownstones require 4 "in sight", does that mean 4 per room? Or just 4 per say floor? I'm mostly interested in room presence. I assume the crownstone built ins work on US AC 110V power based on the tech specs?

mrquincle commented 4 years ago

Ha! That's funny. :-) My apologies.

With 4 "in sight" it is actually meant to be "in range". Often you don't have to have 4 in a room to have the system work fine. Normally we recommend 2 in a normal-sized room, 1 in something like a hallway or toilet. We have them FCC certified for 110V AC indeed.

mKeRix commented 4 years ago

Generally I'm open to new integrations - I'm happy to help by guiding and reviewing contributions. As I don't own any Crownstones hardware yet I wouldn't be able to develop it myself currently though (at least not on a level that I would feel comfortable with releasing).

I'll try to put my understanding of the idea into some bullet points so you can correct me if I got something wrong/missed something:

Cool hardware idea to mix-in presence detection with power plugs btw!

mrquincle commented 4 years ago

Sweet! Yes, that's in general how I imagined it.

From this I understand that contributions are welcome. Hence, I'll figure out where to put this on the roadmap. You can close this issue then and I estimate that we'll probably come with pull requests in Q4 this year. I'll also make sure hardware is available, so the PRs can be properly verified.

mKeRix commented 4 years ago

Sounds good! :)