All Projects → rytilahti → python-yeelightbt

rytilahti / python-yeelightbt

Licence: other
Python library for Yeelight's bedside (btle) and candela lamps

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to python-yeelightbt

yeelight.io
Node.js library for controlling Xiao Mi Yeelight
Stars: ✭ 19 (-75.32%)
Mutual labels:  yeelight
hass-miio-yeelink
Xiaomi Miio Yeelink/Yeelight devices for Home Assistant
Stars: ✭ 140 (+81.82%)
Mutual labels:  yeelight
Miio
Control Mi Home devices, such as Mi Robot Vacuums, Mi Air Purifiers, Mi Smart Home Gateway (Aqara) and more
Stars: ✭ 1,669 (+2067.53%)
Mutual labels:  yeelight
YeelightController
Control your Xiaomi Yeelight from your OSX Device
Stars: ✭ 39 (-49.35%)
Mutual labels:  yeelight
esphome-components
ESPHome components
Stars: ✭ 62 (-19.48%)
Mutual labels:  yeelight
homebridge-yeelight-platform
Homebridge plugin for Yeelight Lights supporting Scenes/Moods/Color Flow/Custom Presets/Music Flow/Night Mode
Stars: ✭ 53 (-31.17%)
Mutual labels:  yeelight
goodbye-mihome
Web UI and plugins to manage Xiaomi MiHome gateway, sensors and smart devices.
Stars: ✭ 92 (+19.48%)
Mutual labels:  yeelight
fluxee
💡 Controlling Yeelight smart lights corresponding to f.lux display color temperature
Stars: ✭ 55 (-28.57%)
Mutual labels:  yeelight
Smart-Lights-Yeelight
Control Yeelight Devices quickly from your Mac OS Tray
Stars: ✭ 51 (-33.77%)
Mutual labels:  yeelight
mi-lamp-re
💡 Reverse Engineering Notes for the Yeelight Bedside Lamp (BLE)
Stars: ✭ 35 (-54.55%)
Mutual labels:  yeelight
esphome-yeelight-ceiling-light
Esphome custom firmware for some Yeelight Ceiling Lights
Stars: ✭ 81 (+5.19%)
Mutual labels:  yeelight
node-yeelight-wifi
node js package for xiaomi yeelight bulbs
Stars: ✭ 49 (-36.36%)
Mutual labels:  yeelight
yeelight-cli
a low level, cross-platform command line client for Yeelight
Stars: ✭ 43 (-44.16%)
Mutual labels:  yeelight
yeelight
The nodeJS client library for controlling yeelight over LAN
Stars: ✭ 52 (-32.47%)
Mutual labels:  yeelight
yeelight-hand-controller
With Yeelight Hand Controller you can turn on and off your Yeelight just with a finger snap and change the brightness intensity raising or lowering your hand.
Stars: ✭ 41 (-46.75%)
Mutual labels:  yeelight
microbit-ble
Read data from micro:bit using Bluetooth from Linux
Stars: ✭ 40 (-48.05%)
Mutual labels:  bluepy
python-eq3bt
Python library and command-line tool for eQ-3 Smart Bluetooth thermostats
Stars: ✭ 107 (+38.96%)
Mutual labels:  bluepy
hass-gelight
Home assistant custom component to control C by GE smart light bulb locally via Bluetooth
Stars: ✭ 32 (-58.44%)
Mutual labels:  bluepy

Python library for Yeelight Bedside lamp

This library allows controlling Yeelight's bluetooth-enabled bedside lamp and Candela devices.

Note that this library is not actively maintained, however, patches are very welcome.

Candelas support only setting the light on and off, and adjusting the brightness.

Currently supported features:

  • State
  • Color mode (white, color, flow)
  • Temperature
  • Brightness
  • Sleep, wakeup & scheduling (partially)

Installation

pip install git+https://github.com/rytilahti/python-yeelightbt/

In case you are getting "No such file or directory" error for bluepy-helper, you have to go into bluepy's directory and run make there. It is also a good idea to let the helper to have capabilities for accessing the bluetooth devices without being root, e.g., by doing the following:

setcap cap_net_admin,cap_net_raw+eip bluepy-helper

And then simply try if the scanning works. You can use pass '-dd' as option to the command to see the debug messages from bluepy in case it is not working.

Usage

Try

$ yeelightbt --help

and

$ yeelightbt [command] --help

For debugging you can pass -d/--debug, adding it second time will also print out the debug from bluepy.

Finding supported devices

$ yeelightbt scan
Scanning for 5 seconds
Devices found:
  f8:24:41:xx:xx:xx (XMCTD_XXXX), rssi=-83

Reading status & states

To avoid passing --mac for every call, set the following environment variable:

export YEELIGHTBT_MAC=AA:BB:CC:11:22:33
$ yeelightbt

MAC: f8:24:41:xx:xx:xx
  Mode: LampMode.White
  Color: (0, 0, 0)
  Temperature: 5000
  Brightness: 50
$ yeelightbt temperature

Temperature: 5000
$ yeelightbt color 255 0 0
Setting color: 255 0 0

Home Assistant support

This repository also contains a basic Home Assistant custom component.

Yeelightbt installation on Home Assistant (for Raspberry Pi)

  1. SSH into the host through port 22222 to get all necessary privileges (follow setup there). /!\ Using the SSH add-on will not work, it gives access to port 22. Use Putty for instance:
ssh [email protected] -p 22222

You will be logged into the Home Assistant command line interface and type login to access the host system.

  1. Access the bash:
docker exec -it $(docker ps -f name=homeassistant -q) bash
  1. Yeelightbt requires bluepy and the installer may not find where it is located. Therefore, navigate to the package:
cd /usr/local/lib/python3.7/site-packages/bluepy
  1. Install as mentionned above:
pip install git+https://github.com/rytilahti/python-yeelightbt/
  1. Ensure the light is ON and the switch is on the bluetooth position (at least for the Candela). Detect the supported devices and check if the lamp can be turned on/off with the commands described above.

Custom Component Installation

Copy yeelight_bt directory located under custom_components over to ~/.homeassistant/custom_components/.

Configuration

light:
  - platform: yeelight_bt
    devices:
      Bedside:
        mac: 'f8:24:41:xx:xx:xx'

Limitation

With the current custom component version, Home Assistant may lose the connection with the devices after a few minutes or hours. Home Assistant has to be restarted to reestablish this connection

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].