Yet Another Philips Hue API Library for Python
This repository has been archived on 2025-09-28. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Find a file
2023-08-04 19:53:00 +02:00
yahuelib Fixed a typo in the rgb_to_hsv converter 2023-08-04 19:53:00 +02:00
.gitignore Added first working version of the library; updated README, .gitignore and LICENSE 2023-07-21 20:40:19 +02:00
DOCUMENTATION.md Fixed a typo in the rgb_to_hsv converter 2023-08-04 19:53:00 +02:00
LICENSE Added first working version of the library; updated README, .gitignore and LICENSE 2023-07-21 20:40:19 +02:00
pydoc-markdown.yml Created a documentation and updated the README 2023-07-21 22:35:31 +02:00
README.md Added support for Motion Sensors, setters for values like brightness or hue now expect API-native values instead of converting from (0.0-1.0), modified rgb to hsv converter accordingly, additional minor improvements, updated README and DOCUMENTATION 2023-08-04 19:36:09 +02:00

YaHue Lib

Yet Another Philips Hue API Library for Python. This project only implements home subset of the API.

Getting Started

Before you can use the API of your Hue Bridge, you have to create an API user for it.
See https://developers.meethue.com/develop/get-started-2/

Supported Features

  • 💡 Lights
    • reachable
    • on
    • brightness
    • hue
    • saturation
    • white color temperature
    • alert
    • alert_long
  • 🏠 Groups (Zones and Rooms)
    • any_on
    • all_on
    • brightness
    • hue
    • saturation
    • white color temperature
    • alert
    • alert_long
  • 👋 Motion Sensors
    • reachable
    • on
    • battery
    • sensitivity
    • sensitivitymax
    • ledindication
    • presence

Documentation

see DOCUMENTATION.md

Example

#!/usr/bin/env python3

# from yahuelib.controller import LightController
from yahuelib.controller import GroupController
from yahuelib.utils import rgb_to_hsv

if __name__ == "__main__":
    home = GroupController.from_name("Home", "192.168.0.120", "XXXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXX")
    if not home.check_all_on():
        home.set_all_on(True)
    color = rgb_to_hsv(255, 220, 100)
    home.set_hue(color[0])
    home.set_saturation(color[1])
    home.set_brightness(254)
    home.alert()