-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document how to configure Home-assistant with RGB/White lights (AI_LIGHT) and MQTT #144
Comments
Original comment by JF002 (Bitbucket: JF002, GitHub: JF002): Here is the information I could gather by reading the code. Please tell me if I'm wrong in my understanding! All the settings (color, brightness, white value and temperature) are applied throught only one MQTT topic (/light/{id}/color) :
I tested all these possibilities by publishling the values manually with an MQTT client (mosquitto_pub). But I couldn't integrate all of them with Home-Assistant:
I think it would be easier if multiple topics were used :
This way, the integration with home-assistant would be easier, for both the setting and the feedback topics. What do you think about all of this? |
Original comment by Pete (Bitbucket: xbmcnut, GitHub: xbmcnut): I've just deployed H801 with 1.8.1 (in RGB mode) and have noticed that the brightness is around 30-40% lower than the controller I replaced it with. Anyone else see this as from above there appears to be no way to adjust the brightness level and wife not happy. :( |
Working on this issue in branch "light", right now it supports:
I'm not sure about the MQTT reporting these values. Internally I'm storing RGB and brightness values. Going from temperature color to RGB is easy, not so easy the other way around. Same for white since white means "same value for red, green and blue". |
Original comment by JF002 (Bitbucket: JF002, GitHub: JF002): Oh thanks for working on it! However, this class worked quite well with Home-assistant. I publish the project on Github : https://github.com/JF002/ESP8266_HASS_ESPURNARGB, you can use the code if you want to :) Basically, it uses the following mqtt topics for the settings:
And the following ones for the state:
The function mqtt_callback() in main just forward the values to the class EspurnaLight which does all the work. And finally, here is the configuration from home-assistant:
Hope this helps :) |
Original comment by Jonathan Hatter (Bitbucket: jhatter, GitHub: jhatter): Can someone explain what I need to do to make this work? I'm using a Magic Home type LED controller but I had to to flash the board as esp8285 and switch the green and red pin numbers for it to respond correctly and set it to rgbw since it has separate white LEDs. I have added all the MQTT topics shown above in to Home Assistant. I have all of the options listed but the only one that works is the color change. Brightness, color temperature, and white value don't change anything. From the espurna webpage the rgb LEDs and white LEDs work correctly. Excuse me if this isn't going to be implemented until a future release. I wasn't sure from the comments above if it was already supposed to work or not. |
This feature is not yet released. As I say in my last comment it in a development branch called "light". And the implementation by @JF002 is different from mine. Part of the work to do is to reach a common point between both... |
Light support changed a bit with 1.9.0. The HA configuration file should go like this:
Basically: command topics now should end with "/set" by default. Light topics are "color", "brightness", "mired" (for temperature color) and "channel/#" for each channel. For RGB or RGBW lights the first 3 channels are mapped to the "color" topic but you can also drive them using the "channel" topic. So "/light/AI_LIGHT_TEST/channel/0/set" to 255 will turn RED LEDs on. The AiLight has 4 channels so "/light/AI_LIGHT_TEST/channel/3/set" maps to the white LEDs. |
Removing milestone: 1.8.4 (automated comment) |
Original comment by Jonathan Hatter (Bitbucket: jhatter, GitHub: jhatter): Thank you for your efforts. I updated the firmware and changed the HA assistant code. I can control the led controller from within HA and all functions work great! I did notice that I couldn't do white by itself. I had to have the brightness of the rgb on at least 1 or the whole switch would be off. No problem at all. At that level you really can't tell that it's not white by itself. |
Closing this. Opened #192 for the brightness issue with the white channel. |
Removing milestone: 1.9.1 (automated comment) |
Originally reported by: JF002 (Bitbucket: JF002, GitHub: JF002)
Espurna 1.8 supports AI Thinker RGB/White light bulbs, with ON/OFF command and color switching, but te integration with Home-Assistant and MQTT doesn't seem to be completely documented.
Moreover, it's not clear if color temperature, brightness and white values are supported for now.
Here is an example of my working configuration for the light, with ON/OFF and color settings:
Home-assistant also supports the following settings: white value, brightness and color temp (see https://home-assistant.io/components/light.mqtt/).
I tried adding these lines in the configuration file, but it doesn't work correctly:
Are these functionalities already supported? If yes, how to use them (topics, format,...) ?
I would be happy to write some documentation once I manage to make it work :)
The text was updated successfully, but these errors were encountered: