Code Monkey home page Code Monkey logo

Comments (9)

Betree avatar Betree commented on May 22, 2024

I guess you found the solution, if not you can set the version to 9 or 10 to use a public address.

from magicblue.

Raynman77 avatar Raynman77 commented on May 22, 2024

Can you elaborate on this? How would I go about setting the version number in my python code when importing magicblue?

from magicblue.

Betree avatar Betree commented on May 22, 2024

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.

Raynman77 avatar Raynman77 commented on May 22, 2024

@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.

Betree avatar Betree commented on May 22, 2024

Have you checked HomeAssistant ? This component may help you for your automation project

from magicblue.

Raynman77 avatar Raynman77 commented on May 22, 2024

@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.

Raynman77 avatar Raynman77 commented on May 22, 2024

@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.

Betree avatar Betree commented on May 22, 2024

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.

Raynman77 avatar Raynman77 commented on May 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.