Skip to content
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

MQTT light - Color wheel not working with auto discovered Tasmota #50316

Closed
majorsl opened this issue May 8, 2021 · 20 comments
Closed

MQTT light - Color wheel not working with auto discovered Tasmota #50316

majorsl opened this issue May 8, 2021 · 20 comments

Comments

@majorsl
Copy link

majorsl commented May 8, 2021

The problem

The color wheel in any Tasmota light does not change the color and sets the bulb to white. Clicking the color briefly changes the LEDs to the preferred color but immediately goes back to white. An example of what happens in the UI can be found in a video by a user here:

Note:
In this issue, Tasmota is using the MQTT integration's light with basic schema.
Setting an rgbw color will be translated to a color command followed by a white command. Tasmota will turn off the colors when processing the white command.

https://www.reddit.com/r/homeassistant/comments/n7upv2/home_assistant_tasmota_lights_not_working/

The Tasmota web interface for a bulb works as expected (HA issue).

Tasmota via MQTT.

What is version of Home Assistant Core has the issue?

core-2021.5.1

What was the last working version of Home Assistant Core?

2021.4.6

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Tasmota via MQTT

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tasmota/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Possibly:

Logger: homeassistant.components.mqtt
Source: components/mqtt/__init__.py:888
Integration: MQTT (documentation, issues)
First occurred: 11:00:47 AM (1 occurrences)
Last logged: 11:00:47 AM

Can't decode payload b'{"name":"Bookshelf status","stat_t":"bookshelf/tele/HASS_STATE","avty_t":"bookshelf/tele/LWT","pl_avail":"Online",0\xf1\x02\x00\x15bookshelf/stat/STATUS{"Status":{"Module":0,"DeviceName":"Bookshelf","FriendlyName":["Bookshelf"],"Topic":"bookshelf","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"Butt' on homeassistant/sensor/681DBC_status/config with encoding utf-8 (for <Job HassJobType.Coroutinefunction <function async_start.<locals>.async_discovery_message_received at 0x7f1663a47040>>)

Additional information

https://www.reddit.com/r/homeassistant/comments/n7upv2/home_assistant_tasmota_lights_not_working/

@probot-home-assistant
Copy link

Hey there @emontnemery, mind taking a look at this issue as its been labeled with an integration (tasmota) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@emontnemery
Copy link
Contributor

emontnemery commented May 8, 2021

Please share a log with the settings below of changing the color with the color wheel:

logger:
  default: info
  logs:
    homeassistant.core: debug
    homeassistant.components.mqtt: debug

@majorsl
Copy link
Author

majorsl commented May 8, 2021

Please share a log with the settings below of changing the color with the color wheel:

logger:
  default: info
  logs:
    homeassistant.core: debug
    homeassistant.components.mqtt: debug

Debug log attached, entity triggered was "bookcase" around the 16:02 mark.

Folks in the Reddit thread note that the newer native Tasmota integration works, this seems to be with the older MQTT integration
home-assistant.log.zip
.

@rob1303-hub
Copy link

I am using the new native Tasmota integration and am experiencing this issue.

Wheel stops working whenever white value (in RGBW) is greater than 0.

If I issue "color xxx,xxx,xxx,0 "command in tasmota console then wheel will continue to work until colour value for W is anything other than 0.

@emontnemery
Copy link
Contributor

emontnemery commented May 9, 2021

@rob1303-hub yours is a different issue because you use the native integration. Could you please open a new issue about it, and let's continue the discussion there.

Wheel stops working whenever white value (in RGBW) is greater than 0.

This is expected, Tasmota lights don't support color and white at the same time, it has to be one or the other.

The current implementation of the native integration will set the light to white if the white value is greater than 0, and to color otherwise.
I agree the user experience is not great though, but I'm not sure how to improve it, suggestions are welcome.

The best option for now is to do SetOption37=128, that will expose the RGB channels as an RGB light and the white channel as a monochrome light which can work independently. Could you give that a try?

@emontnemery
Copy link
Contributor

emontnemery commented May 9, 2021

@majorsl Thanks! The problem with Tasmota is that sending the white command will turn off the color channels, and sending a color command will turn off the white channel.

The best option is to do SetOption37=128, that will expose the RGB channels as an RGB light and the white channel as a monochrome light which can work independently. Could you give that a try?

@majorsl
Copy link
Author

majorsl commented May 9, 2021

@emontnemery thanks! I was unaware of that so37 (so many in taz!) I think, after some testing yesterday, that the newer integration for me is the real long term fix and the better option overall. I was unaware that both ways could be used at the same time and depending on so19 0/1 that's how it was determined. That makes my migration so much less painful since I can do the lights now and worry about switches, plugs, etc later.

@rob1303-hub
Copy link

@emontnemery. Thanks for the speedy reply.

The current implementation of the native integration will set the light to white if the white value is greater than 0, and to color otherwise.

That makes sense.

please open a new issue about it, and let's continue the discussion there.

Will do.

The best option for now is to do SetOption37=128, that will expose the RGB channels as an RGB light and the white channel as a monochrome light which can work independently. Could you give that a try?

Did this. SO37 128 created the second switch and I could switch between them and control the light without issue.

However, as a user, I found having to switch between two lights non-intuitive. I find it easier to revert back to SO37 0 and then manually reduce the white brightness to 0 when I want to use the colour wheel.

I agree the user experience is not great though, but I'm not sure how to improve it, suggestions are welcome.

I am no programmer, but would it be possible to do the following in the UI:

  • if user clicks in the centre of wheel (white section) - turns white light on and uses white brightness to control dimmer
  • if user clicks anywhere else on wheel (ie on the colours) and the white light gets set to 0 and RGB turns on?

Happy to test anything to help out.

@probot-home-assistant
Copy link

mqtt documentation
mqtt source
(message by IssueLinks)

@emontnemery emontnemery changed the title Tasmota Lights - Color Wheel not Working MQTT light - Color wheel not working with auto discovered Tasmota May 10, 2021
@digiblur
Copy link
Contributor

Can confirm several folks I know have the same issue of it sending the color2, then white 0 right after.

@bmorgan99
Copy link

I also have it. No Tasmota integration, only auto MQTT.

@emontnemery
Copy link
Contributor

emontnemery commented May 14, 2021

The problem is understood, the workaround is to split the light in two as explained here: #50316 (comment), or to use the Tasmota integration for RGBW lights instead of MQTT, that behaves better.

A proper correction will require changes in both Tasmota and Home Assistant. Initial Tasmota patches are merged, but Home Assistant patches (#50464, #50530) are currently under review. The final change will be to update the Tasmota MQTT discovery to use the new feature.

@WiredWonder
Copy link

What was wrong with the way it used to work?

@emontnemery
Copy link
Contributor

emontnemery commented Jun 3, 2021

The problem with the old way was the "white_value" light feature which was poorly documented and thus behaved differently for different lights.
It's been replaced by an "RGBW" color mode.

@WiredWonder
Copy link

The old way worked. The current way has broken all my (and many other) lights and seems it was released without testing. Any chance of rolling back this change until the corresponding changes are made (and tested) in Tasmota?

@emontnemery
Copy link
Contributor

emontnemery commented Jun 4, 2021

Agreed that the new color picker does not work well with Tasmota in its default configuration.

There are multiple viable workarounds for Tasmota:

  • Use the native Tasmota integration
  • SetOption37=128 - This will expose two lights, one RGB and one white, to Home Assistant
  • Enable white blend mode by setting SetOption105 1, this will expose the RGBW light as an RGB light, and Tasmota will automatically control the white channel.

For the default configuration, this is the way forward: #51411, the PR introduces a "white" color_mode which will work well with Tasmota's default configuration (color or white, not both).

@emontnemery
Copy link
Contributor

"white" color_mode is available in Home Assistant 2021.7 which was released last week.
This PR arendst/Tasmota#12659 makes use of that for Tasmota RGBW lights configured with SetOption19 1

@mlepard
Copy link

mlepard commented Jul 15, 2021

Just leaving a comment that I was having the same issues with my v9.5 Tasmota Integration RGBW bulb and the latest HA.
Using the HA UI to set the white color on my bulb sent the following MQTT data to the bulb:
NoDelay;Power1 ON;NoDelay;White 94

However, using the service light.turn_on:

  data:
    brightness_pct: 98
    rgbw_color:
       - 0
       - 0
       - 0
       - 255

Only sent the following MQTT data to the bulb:
NoDelay;Dimmer 94

Calling light.turn_on with the following data worked correctly

  data:
    brightness_pct: 98
    white: 254

This issue was the only place I could find mention of the new white value, it's not in the online docs or listed in the light.turn_on service in the developer tools.

@emontnemery
Copy link
Contributor

emontnemery commented Jul 16, 2021

@mlepard thanks for pointing out that docs are missing; this adds documentation: home-assistant/home-assistant.io#18529 and this adds it to the developer tools: #53075

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 14, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants