Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 2.2 KB

install-unicornlight.md

File metadata and controls

45 lines (33 loc) · 2.2 KB

Install UnicornLight

TODO: Supply more information

UnicornLight is an experimental mini »ambient light« (Raspberry Pi Zero W or better and Unicorn pHAT or Unicorn HAT required). It can get its light color information from nearly any MQTT topic, as comma-separated RGB or Kelvin value.

Install on a Raspberry Pi Zero W or better as described in docs/install-signalpi.md but instead of the blinkt! library install the Unicorn HAT Python library.

The module to call and/or put into crontab is ~/studiodisplay/python/mqtt-unicornlight.py.


UnicornLight and Home Assistant

You can easily integrate UnicornLight with Home Assistant using the following code in your configuration.yaml:

light:
  - platform: mqtt
    name: "UnicornLight"
    state_topic: "unicornlight/1/status/power"
    command_topic: "unicornlight/1/set/power"
    payload_on: "on"
    payload_off: "off"
    rgb_state_topic: "unicornlight/1/status/color"
    rgb_command_topic: "unicornlight/1/set/color"
    brightness_state_topic: "unicornlight/1/status/brightness"
    brightness_command_topic: "unicornlight/1/set/brightness"
    brightness_scale: 100
    availability_topic: "unicornlight/1/connected"
    payload_available: "2"
    payload_not_available: "0"
    qos: 0
    optimistic: false
    retain: false

This results in a fully configurable UnicornLight in Home Assistant, which can be automated and used for signalling, illumination or ambient light:

homeassistant-unicornlight unicornlight-pi-zero

Hint: If you use UnicornLight with a home automation system, you’ll probably want to use an empty light_topic in the configuration file.

UnicornLight retains its status topics on the MQTT broker, so Home Assistant will immediately know its status and availability. Commands sent to a MQTT command topic should not be retained, this is why we set retain: false in Home Assistant’s configuration.yaml.