GA with RGB Light

Hi all, I added a new RGB item to my openhab using a Tasmota flashed RGB strip controller which works with HSB values.

Simple configuration added to items:

Color  DeskRGB_Color "Desk Backlight" <colorwheel> { mqtt=">[control:ha/mod/93A5/cmnd/hsbcolor:command:*:default]",ga="light" }

Works fine from openhab as expected. However, in google home land, it completely messes up the commands:
Changing brightness just sends ha/mod/93A5/cmnd/hsbcolor <0-100>
On or off sends ha/mod/93A5/cmnd/hsbcolor <ON|OFF>

This gets all misinterpreted by openhab and does all weird things. What does work is setting the color via GA - works fine as it sends HSB values for that.

Surely I don’t have to set up a proxy item and scripts just to control it via GA?

As i understand it, that’s exactly what Google Assistant should send for commands on a dimmer item. The question is, what values are expected by your Tasmota device for brightness and on/off? I would have thought it would be the same.

The tasmota firmware just uses the brightness to control on/off. i.e brightness 0 = OFF. GA sends a specific OFF command only ( Which tasmota also supports but on the ‘cmnd’ topic)

Okay, so what do you mean by this? I think that’s what’s throwing me off. Are you saying that brightness works, and the only issue is the on/off command? And how does the device react to the on/off?

Sending HSB data to the object with Openhab works 100% - Because that’s all it does. B=0=OFF.

However, GA sends OFF|ON or just the brightness value, as well as a separate HSB value when setting color - All effectively to the same item/mqtt topic. I don’t see how I can separate that without having to create a proxy item and use rules to remap it to the real item. I assume there is something I am doing wrong but perhaps not…

TASMOTA dose not support onoff data to hsbcolor only HSB data. This is a limitation of TASMOTA.

You can create a map file on the item so you don’t need another item just MAP the ON and OFF to what you want and then just add another line with only = on it to pass everything else through.

That sounds ok, how would I handle the brightness though?

I don’t know maybe you do need dummy items.

Have you tried WLED GitHub - Skinah/wled: An openHAB binding for the esp8266 WLed project.

I’m pretty sure it’s just something to do with the item setup.
Looking at the event logs:
2021-03-02 21:12:43.158 [ome.event.ItemCommandEvent] - Item ‘GADeskRGB’ received command ON
2021-03-02 21:12:43.162 [vent.ItemStateChangedEvent] - GADeskRGB changed from 0,0,0 to 0,0,100

So as you can see, the item is receiving the data that I want from GA (or at least the binding is converting the data into a useable format), but then the MQTT binding is mangling it. How can I get it to send ‘raw’ data to MQTT?

I sussed it - Well, sort of. It works and it’s not too much of a mess:

2 Items:

Color  DeskRGB_Color "Desk Backlight Color" <colorwheel> { mqtt=">[control:ha/mod/93A5/cmnd/hsbcolor:command:*:default]"}
Color  GADeskRGB "Desk RGB" { ga="Light" }

Rule:

    rule "Desk RGB"
    when
            Item GADeskRGB received command
    then
              sendCommand( DeskRGB_Color, GADeskRGB.state)
    end

Works well, but sometimes the brightness does not come through and you need to set it again. I think this is a GA thing, not OpenHAB. I also find that the GA app struggles to show the color option most of the time but at least i can use voice control for it.