-
Notifications
You must be signed in to change notification settings - Fork 53
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
MIPOW PLAYBULB adapter #677
Comments
Note that Niels' code at https://github.com/BluetoothRocks/Lightbulb/blob/master/lib/bluetooth-bulb.js#L8 only cares about reading/writing the color, which would be a great first step to get working, but depending on what model it is (I have a candle, sphere and comet available here), those devices have additional functions available, which would be also nice to support if we can figure out how. If I wanted to look into getting something working there myself, how would I start? |
I'd recommend copying an existing javascript-based adapter and using that as a starting point:
You'll probably want to use noble to do the Bluetooth comms. If you need any help with that, please let us know. I've been working with it a great deal lately. Here are a couple general resources, as well: |
I started some work based on a fork of the example-adapter and put it into https://github.com/KaiRo-at/playbulb-adapter - it can do device discovery somewhat decently but the device functionality is very much faked still, and that's where I pretty much got stuck. From what I've seen, we IMHO probably need 2 things going forward:
|
I think the biggest problem with using noble (or other libraries that use BlueZ) in multiple adapters is the state issue. For example, HomeKit constantly scans in the background to watch for events from devices, but BlueZ (or at least noble) freaks out when you try to communicate with a device while a scan is happening. It's very annoying.
|
Hi @KaiRo-at and @mrstegeman, just a note to say that this sounds very similar to what I'd like to do with Happy Lighting / Triones bulbs: https://discourse.mozilla.org/t/wip-adapter-for-bluetooth-happylighting-triones-bulbs/49477 |
I saw in WebThingsIO/gateway#165 that it's hard to get generic BLE support working because devices have different APIs behind the BLE connection. Niels Leenheer, creator of html5test, currently does a lot of presentations about WebBluetooth (e.g. the one at DACHFest I saw) and touting that e.g. MiPow Playbulb devices are nice to work with there. They have a nice collection of lights that work via BLE.
Niels has demo JS code (working with Chrome, which ships WebBluetooth) at https://github.com/BluetoothRocks/Lightbulb so following that it should not be hard to get an adapter done (and FWIW, he references the Open GATT Registry that has docs for more BLE devices).
I have got me some of those devices, so I'd be able to test, and as a Tech Speaker this would be great for doing demos as it works with what the RPi3 has on board by default - and the fewer pieces I need in a demo, the fewer points where things can fail. ;-)
The text was updated successfully, but these errors were encountered: