question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rgb support for HomeAssistant

See original GitHub issue

I am unable to set the color on my Yeelight YLDL01YL Meteorite light. HomeAssistant does support it with its Yeelight integration and setting the color does work.

service: light.turn_on
data:
  entity_id: light.yeelight_ceiling10_0xyz_ambilight
  rgb_color:
    - 0
    - 255
    - 0

On, Off and Dim does work with “HomeAssistant Device” type.

{"entityId":"light.yeelight_ceiling10_0xyz_ambilight","hassName":"Home Assistant","state":"on"}
{"entityId":"light.yeelight_ceiling10_0xyz_ambilight","hassName":"Home Assistant","state":"on","bri":"${intensity.percent}"}
{"entityId":"light.yeelight_ceiling10_0xyz_ambilight","hassName":"Home Assistant","state":"off"}

Is setting the rgb color supported? I can’t find it on the documentation or an example.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pimw1commented, May 13, 2021

Hi, í’ve finetuned it a bit to get the smoothest response from Hyperion (with transition = 0.5). I also got to know that “color items” also need brightness variable in it (otherwise applications like hyperion can only change color but not birghtness). See below all settings that i am using.

Generic “Bridge Control” Settings, section “HomeAssistant Names and IP Addresses”

  • Name: Home Assistant (can be any name)
  • IP: 192.168.2.21 (ip address of your Home Assisant device)
  • Port: 8123 (is usually 8123)
  • Token/Password: your_super_secret_token
  • Auth Type: do not select “Legacy password”
  • Use SSL: do not select this option

-> Save > wait for 10 seconds: the Bridge is reinitializing, but this message stays forever > “Bridge Stop” -> rerun HA-Bridge (if you installed HA-bridge up correctly, this will happen automatically when rebooting the device running HA-Bridge). After reboot, do the following:

  • Add your devices using the tab “HomeAssistant Devices”: select them and click on Build Item. Save with the green button on top.
  • Under “Bridge Devices”, you can press Edit/Copy. This will bring you to the next screen, at which you should add the settings as explained below:

On Items:

  • Type: HTTP Device
  • Target Item: http://192.168.2.21:8123/api/services/light/turn_on (please replace with the ip-address of your device running Home Assistant)
  • Delay: empty
  • Count: empty
  • Filter IP’s: empty
  • HTTP Verb: POST
  • HTTP Body: {“entity_id”:“light.woonkamer_subwoofer”,“transition”:0.5}
  • HTTP Headers: [{“name”:“Authorization”,“value”:“Bearer your_super_secret_token”}]
  • Content Type: application/json

As you can see, my device is “light.woonkamer_subwoofer”. Please change this to your entity_id of interest (the entity id as it is named in Home Assistant itself). This remark naturally applies also to the rest of the settings below.

Dim Items:

  • Type: HTTP Device
  • Target Item: http://192.168.2.21:8123/api/services/light/turn_on (please replace with the ip-address of your device running Home Assistant)
  • Delay: empty
  • Count: empty
  • Filter IP’s: empty
  • HTTP Verb: POST
  • HTTP Body: {“entity_id”:“light.woonkamer_subwoofer”,“transition”:0.5,"brightness"😒{intensity.byte}}
  • HTTP Headers: [{“name”:“Authorization”,“value”:“Bearer your_super_secret_token”}]
  • Content Type: application/json

Off Items:

  • Type: HTTP Device
  • Target Item: http://192.168.2.21:8123/api/services/light/turn_on (please replace with the ip-address of your device running Home Assistant)
  • Delay: empty
  • Count: empty
  • Filter IP’s: empty
  • HTTP Verb: POST
  • HTTP Body: {“entity_id”:“light.woonkamer_subwoofer”,“transition”:0.5}
  • HTTP Headers: [{“name”:“Authorization”,“value”:“Bearer your_super_secret_token”}]
  • Content Type: application/json

Color Items:

  • Type: HTTP Device
  • Target Item: http://192.168.2.21:8123/api/services/light/turn_on (please replace with the ip-address of your device running Home Assistant)
  • Delay: empty
  • Count: empty
  • Filter IP’s: empty
  • HTTP Verb: POST
  • HTTP Body: {“entity_id”:“light.woonkamer_subwoofer”,“transition”:0.5,“rgb_color”:[${color.r},${color.g},${color.b}],"brightness"😒{intensity.byte}}`
  • HTTP Headers: [{“name”:“Authorization”,“value”:“Bearer your_super_secret_token”}]
  • Content Type: application/json.

I’m linking here to a topic on the Home Assistant forum: https://community.home-assistant.io/t/ha-bridge-with-auth-token/93729 That gave me important clues how to do this. I hope this explanation will help others. The end-result is pretty spectacular: HDMI grabber ->Hyperion->HA-Bridge->Home Assistant ->

  • Zigbee Conbee II -> Hue lights
  • Wifi LIFX lights.

edit: i’ve created a more extensive manual on how to setup Hyperion-> HA-Bridge -> Home Assistant. You can find it here: https://community.home-assistant.io/t/instruction-hyperion-ha-bridge-home-assistant/307708

0reactions
pimw1commented, May 12, 2021

I think/hope that i’ve got a solution: i’m sending out the below http requests:

image

image

When testing, all four buttons are working (TEST ON, Test Dim, Test OFF, Test Color).

This was quite a challenge since i’m not a programmer (i had to learn on the fly how to use REST APIs plus combining that knowlegde with the usage of the HA-Bridge variables).

Edit: the black bars are my super secret Home Assisant token, i’d like it to stay super secret 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenRGB + Home Assistant - Third party integrations
Hello guys! ... This is a great solution to control your Aura and compatible RGB devices of your computer without any other proprietary...
Read more >
control your Razer Chroma RGB devices from Home Assistant
Each of the light entities supports RGB colour and brightness settings in a usual HA way. Sending message service (per-key RGB keyboards). Using ......
Read more >
A hassle free Zigbee LED controller for Home Assistant that ...
How to connect the Zigbee Led controller to Home Assistant ... This supports 5 channels (RGB and warm/cold white).
Read more >
KAUF RGB Wall Switch with ESPHome, Compatible with ...
KAUF RGB Wall Switch with ESPHome, Compatible with Tasmota, Made for Home Assistant ; Small Business. This product is from a small business...
Read more >
Light Component - ESPHome
The light domain in ESPHome lets you create lights that will automatically be shown in Home Assistant's frontend and have many features such...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found