Skip to main content

A python library to interact with Beewi SmartBulb

Project description

BeewiPy

A python library to interact with Beewi SmartBulb.

SmartBulb is a series of Smart LED color bulbs manufactured by Beewi. These bulbs are controlled using BTLE (Bluetooth Low Energy) and the vendor provides an Android app to interact with the bulbs.

This library has been tested with BeeWi BBL229.

This is still work in progress! Today I have tested some of the methods, but not all and not using all the possible combinations. Any suggestion to improve the code is very welcome!

Getting started

Soon there will be a documentation section but meanwhile you can start here.

Prerequisites

  • Any linux distribution
  • Python 3 - this library requires the use of Python 3.
  • BluePy - this library relies on BluePy library made by IanHarvey.

Scanning for your device

First of all you need to know the MAC address of your device, so start by getting this information. It can be done using several ways, the easiest one is looking it up on the app provided by BeeWi.

Minimal working code

from BeewiPy import *
import time

MAC_ADDRESS = "00:00:00:00:00:00"       # Here you should put the MAC address of your device
myBulb = BeewiSmartBulb(MAC_ADDRESS)    # This will create a new BeewiSmartBulb object and connect to the device
myBulb.turnOn()                         # This will turn on your bulb
time.sleep(5)                           # This will wait 5 seconds
myBulb.turnOff()                        # This will turn off your bulb

The sky is the limit!

The BeewiSmartBulb class

Every object instantiated from the BeewiSmartBulb class will have the following methods available:

turnOn()

This method turns on the bulb

turnOff()

This method turns off the bulb

setBrightness(value)

This method will set the brightness value of the bulb. The accepted values range from 0 to 9.

setTemperature(value)

This method will set the temperature value of the bulb. The accepted values range from 0 to 9, being 0 the coolest setting and 9 the warmest setting.

setColor(red, green, blue)

This method will change the color of the bulb. The values passed for red, green and blue must be between 0 and 255.

setWhite()

This method will change the bulb from color mode to white mode.

setColorSequence(value)

This method will put the bulb in color sequence mode. In this mode the color of the bulb will cycle in predefined sequences. The value passed to this function range from 0 to 4.

Authors

  • David Polo

License

This project is licensed under the GNU General Public License v.3

Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BeewiPy-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

BeewiPy-0.0.1-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file BeewiPy-0.0.1.tar.gz.

File metadata

  • Download URL: BeewiPy-0.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for BeewiPy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9973042e11d4d0c71feb966453991b4e4a12017761d7e0615e08a6f32efe750c
MD5 0282a5dfad09ce2e92a75e39a3ebc332
BLAKE2b-256 3f0e839494aed28f24263fed5776cf8e0faba26cfec848ef9a2ea777d3a142b0

See more details on using hashes here.

File details

Details for the file BeewiPy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: BeewiPy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for BeewiPy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6407d81079118eaf9cff06b83fd5d5f53d51ec8973f9011454a7db46c243ec8c
MD5 2943b37adba896dbac45f5c73b8cbbd4
BLAKE2b-256 b91ee2ce1657cba7cb6e11ade7cfa5ab1e27c26d09f4351b27ec355dc311e215

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page