Comments (9)
I guess you found the solution, if not you can set the version to 9 or 10 to use a public address.
from magicblue.
Can you elaborate on this? How would I go about setting the version number in my python code when importing magicblue?
from magicblue.
When instantiating MagicBlue accepts the following parameters :
MagicBlue(mac_address, version=7, addr_type=None)
You should always prefer using version. However, if you're using v6 (which hasn't been released on pypi yet, only on master branch) or if you have a good reason to force the address type you can pass btle.ADDR_TYPE_PUBLIC
or btle.ADDR_TYPE_RANDOM
as a third parameter.
So ideally (replace 9 by whatever your version is) :
bulb = MagicBlue('xx:xx:xx:xx:xx:xx', 9)
Or if you really need to force address type
from bluepy import btle
bulb = MagicBlue('xx:xx:xx:xx:xx:xx', 6, btle.ADDR_TYPE_PUBLIC)
Please let met know if your version is not automatically supported; as we intend to cover all versions of magicblue this could be valuable information.
from magicblue.
@Betree Thanks for the info & updating the usage details. Hopefully this will improve my experience. These bulbs seem a little flakey, but thats just my opinion. They were a gift and I was hoping to find a way to integrate these into some home automation by using the Raspberry Pi as a hub. Thanks for your work on this project!
from magicblue.
Have you checked HomeAssistant ? This component may help you for your automation project
from magicblue.
@Betree I'm using a Vera Home Controller as the main control point. It's very open source alone. However, the bluetooth feature built-in to the Vera Plus is still very new-ish to the Mios team whom assists in module integration for the unit. So for now bluetooth is limited to one rgb bulb by "Revogi" and that bulbs like $30-$40. These MagicBlue bulbs were a gift to me so I was just messing around with them to see how far I could take it as well as avoiding putting the app on my phone. I didn't agree with all the permissions that were listed nor did I feel like changing it's permissions in settings.
I'm using the Raspberry Pi to control the bluetooth bulbs and my Vera Unit will talk to the Pi. I can tcp to through my network to the Vera Unit.....in which will also give me control through Alexa.
from magicblue.
@Betree When calling "set_effect" method in API usage, can you give an example expression with the correct parameter syntax?
This is not working as I interpreted: bulb.set_effect(green_blue_cross_fade, 5)
from magicblue.
You can use it like this :
from magicbluelib import MagicBlue, Effect
bulb = MagicBlue('xx:xx:xx:xx:xx:xx', 6, btle.ADDR_TYPE_PUBLIC)
bulb.set_effect(Effect.green_blue_cross_fade, 5)
from magicblue.
@Betree Thanks again. I looked at the library and noticed that I needed to access the class "Effect", but did not realize that it needed to be included in the import. So, thank you for this.
from magicblue.
Related Issues (20)
- Add support for functions (strobe, colors crossfade...etc) HOT 1
- UnboundLocalError: local variable 'addr_type' referenced before assignment HOT 3
- Publish to pypi HOT 2
- Add support for time schedules HOT 1
- Multiple bulbs setup HOT 14
- v8 bulbs can't connect sometimes HOT 5
- Testing the library without the actual bulb (suggestion) HOT 1
- Version 6 compatibility HOT 7
- MagicBlue interactive shell enhancement with python-prompt-toolkit
- x86 architecture HOT 6
- Tkinter GUI HOT 3
- Install and run magicblue in Raspbian Stretch (kernel version 4.9) - SOLVED! HOT 3
- Issues using magic blue HOT 3
- bluepy 1.20 is out HOT 2
- Cannot connect from shell HOT 4
- question: other lights HOT 5
- loss of connection after 10-15 minutes HOT 2
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- b
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magicblue.