OH3 / H801 RGBW with Tasmota

Hello,
I’m trying to setup my H801 running Tasmota in my new OH3.
A normal Sonoff switch is already running, so MQTT works.
My problem is the setup for the color.
I added an channel for POWER and another for color, but I’m not able to do anything at the color (no options).
I did not find any guides for OH3. Can anyone share his setup?
(H801 means RGBW Light, Power, Brightness and Color)

Thank you!




Can anyone please share his settings?

Still unsolved :confused:

I liked OH 2 much more

Can you explain your problem a bit more? You have a Tasmota RGBW light. You have configured a power channel, which works. You have configured a color channel, but color does not work? How exactly does it “not work”? Are there any error messages? What happens if you change the color item? Do you see MQTT messages when changing the color item? From what you write (“I’m not able to do anything at the color (no options)”) I don’t understand what doesn’t work (except “everything”, which is not helpful…)

My setup has a Tasmota RGBW light bulb. The tricky par of talking to this device is (in my opinion) switching between color mode and white mode. I use four channels for this: Power, Brightness (dimmer), Color Temperature for white and Color (HSB).
My channel configuration looks like this (note I have configured this via GUI, not text files: In the Thing definition there are three tabs: “Thing”, “Channels” and “Code”. Since it is more compact to post I give (parts of) the “Code” tab here, instead of screenshots):

UID: mqtt:topic:MqttRaspi:Wifilight06
label: Wifilight06
thingTypeUID: mqtt:topic
configuration:
  payloadNotAvailable: Offline
  availabilityTopic: Wifilight06/tele/LWT
  payloadAvailable: Online
bridgeUID: mqtt:broker:MqttRaspi
location: Kitchen
channels:
  - id: power
    channelTypeUID: mqtt:switch
    label: Power
    description: ""
    configuration:
      commandTopic: Wifilight06/cmnd/POWER
      stateTopic: Wifilight06/tele/STATE
      transformationPattern: JSONPATH:$.POWER
      off: OFF
      on: ON
  - id: Brightness
    channelTypeUID: mqtt:dimmer
    label: Brightness
    description: ""
    configuration:
      commandTopic: Wifilight06/cmnd/DIMMER
      stateTopic: Wifilight06/stat/DIMMER
      transformationPattern: JSONPATH:$.Dimmer
  - id: ColorTemp
    channelTypeUID: mqtt:dimmer
    label: Color Temperature (mired)
    description: ""
    configuration:
      commandTopic: Wifilight06/cmnd/CT
      step: 10
      min: 153
      stateTopic: Wifilight06/stat/CT
      transformationPattern: JSONPATH:$.CT
      max: 493
  - id: ColorHSB
    channelTypeUID: mqtt:color
    label: Color HSB
    description: ""
    configuration:
      commandTopic: Wifilight06/cmnd/HSBCOLOR
      colorMode: HSB
      stateTopic: Wifilight06/stat/HSBCOLOR
      transformationPattern: JSONPATH:$.HSBColor
      onBrightness: 60

Each channel is linked to a corresponding item (like your Ambilight Schreibtisch Color, which looks perfectly fine). If all items have “Property_Light” set you can now operate all items in MainUI, in tab “Equipment” on the card “Lights”. In my case it looks like this:
grafik

After pressing the color picker button (white square beside the switch in the last line) and selecting a color the openHAB sends the command cmnd/Wifilight06/HSBCOLOR 207,0,100 to Tasmota and the light turns blue(-ish).
When changing the color temperature to a value between 153 and 500 the bulb is white again.

Does this help?

2 Likes

Hi,

thank you so much for your answer @Fleck!
It already helped me since it provided more informations about the channels I have to use.
I didn’t know about the “HSBCOLOR”.

I’ve tried setting it up now, but it doesn’t work.

image

And the code snippet:

channels:
  - id: ambschreibtisch
    channelTypeUID: mqtt:switch
    label: Power
    description: ""
    configuration:
      commandTopic: cmnd/tasmota_schreibtisch/power
      stateTopic: stat/tasmota_schreibtisch/power
  - id: ColorHSB
    channelTypeUID: mqtt:color
    label: Color HSB
    description: ""
    configuration:
      commandTopic: cmnd/tasmota_schreibtisch/HSBCOLOR
      stateTopic: stat/tasmota_schreibtisch/HSBCOLOR
      transformationPattern: JSONPATH:$.HSBColor

The only difference I can see is the

which isn’t shown in my code snippet

image

And now even the power button isn’t working anymore (not sending or changing state)

Log file:

2022-05-29 11:18:40.288 [WARN ] [rnal.handler.GenericMQTTThingHandler] - Channel configuration error
java.lang.IllegalArgumentException: No enum constant org.openhab.binding.mqtt.generic.mapping.ColorMode.
	at java.lang.Enum.valueOf(Enum.java:240) ~[?:?]
	at org.openhab.binding.mqtt.generic.mapping.ColorMode.valueOf(ColorMode.java:1) ~[bundleFile:?]
	at org.openhab.binding.mqtt.generic.values.ValueFactory.createValueState(ValueFactory.java:62) ~[bundleFile:?]
	at org.openhab.binding.mqtt.generic.internal.handler.GenericMQTTThingHandler.initialize(GenericMQTTThingHandler.java:159) [bundleFile:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]

Hmm, which version of openHAB are you using? I am on version 3.2 and I think there was a change in the MQTT binding some time between 3.0 and 3.2 regarding the color modes.

I‘m running on 3.2.0 too.

Perhaps you are a victim of this bug: MQTT Channel Type "color" causes exception when using lowercase "hsb" in file or when using UI · Issue #10117 · openhab/openhab-addons · GitHub ?

I don’t think this was the direct reason, but when troubleshooting I saw that the option

colorMode: HSB

was missing. Clicked around a bit (reselected HSB, save, …) and it was in Code.

Now this error isn’t shown anymore and Power Works.
But I’m still not done :wink:

Color(HSB) still has no options:


and state Null.

and when using the Brightness Color Temp changes from warm white (set via Tasmota) to an “artifical cold white”.

channels:
  - id: ambschreibtisch
    channelTypeUID: mqtt:switch
    label: Power
    description: ""
    configuration:
      commandTopic: cmnd/tasmota_schreibtisch/power
      stateTopic: stat/tasmota_schreibtisch/power
  - id: ColorHSB
    channelTypeUID: mqtt:color
    label: Color HSB
    description: ""
    configuration:
      commandTopic: cmnd/tasmota_schreibtisch/HSBCOLOR
      colorMode: HSB
      stateTopic: stat/tasmota_schreibtisch/HSBCOLOR
      transformationPattern: JSONPATH:$.HSBColor
  - id: Brightness
    channelTypeUID: mqtt:dimmer
    label: Brightness
    description: ""
    configuration:
      commandTopic: cmnd/tasmota_schreibtisch/DIMMER
      stateTopic: stat/tasmota_schreibtisch/DIMMER
      transformationPattern: JSONPATH:$.Dimmer

Is it possible that Tasmota isn’t using the stateTopic? (Or openhab not sending a request)

It isn’t shown in MQTT Explorer.
When I use the Power Button in OpenHab, stat gets created in the Explorer. But only for Power

image

When I send “State” in the Tasmota Terminal it is shown in the MQTT Explorer
image

… but still not updated in OpenHab.

Strange. I see the stat/tasmota_name/HSBCOLOR mqtt topic coming from Tasmota. Can you send the HSBOLCOR command manually over MQTT Explorer (cmnd/tasmota_schreibtisch/HSBCOLOR) with contents e.g. 135,0,100 and check if you see the corresponding stat message in MQTT Explorer and in openHAB?

I can see the message in the MQTT Explorer when sending the HSBColor command:
image

Thing in OpenHAB is still null.
But I just saw, that even the Power in OpenHab doesn’t get updated (/POWER, …). But in this case it can be turned on/off via openhab.

POWER must be upper-case

commandTopic: cmnd/tasmota_schreibtisch/POWER
stateTopic: stat/tasmota_schreibtisch/POWER

And for HSBColor try

stateTopic: stat/tasmota_schreibtisch/RESULT

Thank you!
Power works, but Color not yet:

Executing the JSONPATH-transformation failed: Invalid path '$.HSBColor' in '{"POWER":"ON"}'

when i switch the power button.

When i update the color via Tasmota no error, but also no change in Openhab.

The problem seems to be: if power is toggled, there is only the power in the result message (MQTT Explorer). Color, … is missing

{"POWER":"ON"}

Things:

channels:
  - id: ambschreibtisch
    channelTypeUID: mqtt:switch
    label: Power
    description: ""
    configuration:
      commandTopic: cmnd/tasmota_schreibtisch/POWER
      stateTopic: stat/tasmota_schreibtisch/POWER
  - id: ColorHSB
    channelTypeUID: mqtt:color
    label: Color HSB
    description: ""
    configuration:
      commandTopic: cmnd/tasmota_schreibtisch/HSBCOLOR
      colorMode: HSB
      stateTopic: stat/tasmota_schreibtisch/RESULT
      transformationPattern: JSONPATH:$.HSBColor
  - id: Brightness
    channelTypeUID: mqtt:dimmer
    label: Brightness
    description: ""
    configuration:
      commandTopic: cmnd/tasmota_schreibtisch/DIMMER
      stateTopic: stat/tasmota_schreibtisch/DIMMER
      transformationPattern: JSONPATH:$.Dimmer

Dimmer is also not updated.

The

Executing the JSONPATH-transformation failed: Invalid path '$.HSBColor' in '{"POWER":"ON"}'

you can fix with REGEX in the transformationPattern, see my config

UID: mqtt:topic:d0a861377f:Tasmota_LED_Strip
label: Tasmota LED Strip
thingTypeUID: mqtt:topic
configuration:
  payloadNotAvailable: Offline
  availabilityTopic: tele/LED_Strip/LWT
  payloadAvailable: Online
bridgeUID: mqtt:broker:d0a861377f
channels:
  - id: IP_Address
    channelTypeUID: mqtt:string
    label: IP Address
    description: ""
    configuration:
      stateTopic: stat/LED_Strip/STATUS5
      transformationPattern: JSONPATH:$.StatusNET.IPAddress
  - id: ColorTest
    channelTypeUID: mqtt:color
    label: ColorTest
    description: ""
    configuration:
      commandTopic: cmnd/LED_Strip/HSBCOLOR
      stateTopic: stat/LED_Strip/RESULT
      transformationPattern: REGEX:(.*\"HSBColor\".*)∩JSONPATH:$.HSBColor
  - id: Power
    channelTypeUID: mqtt:switch
    label: Power
    description: ""
    configuration:
      commandTopic: cmnd/LED_Strip/POWER
      stateTopic: stat/LED_Strip/RESULT
      transformationPattern: REGEX:(.*\"POWER\".*)∩JSONPATH:$.POWER
  - id: Dimmer
    channelTypeUID: mqtt:dimmer
    label: Dimmer
    description: ""
    configuration:
      commandTopic: cmnd/LED_Strip/Dimmer
      stateTopic: stat/LED_Strip/RESULT
      transformationPattern: REGEX:(.*\"Dimmer\".*)∩JSONPATH:$.Dimmer

If you change color or dimmer in OH, can you see the commands in MQTTExplorer like this?

cmnd
  LED_Strip
  Dimmer = 70
  HSBCOLOR = 340,100,70

and what is your Tasmota version?

I’m on OH 3.3 M3 and Tasmota 10.0.0

2 Likes

Wow! Thank you!

It seems that everything works. I’ll do more tests in the next days.
I’m surprised it only works with Regex, I haven’t seen it when researching.

Also Thanks @Fleck!

I’m on openHAB 3.2.0 and since yesterday Tasmota 11.1.0. Before it was 10.X

I’m on a way to turn on the warm white leds: (Color/Dimmer does work!)

  - id: White
    channelTypeUID: mqtt:switch
    label: White
    description: ""
    configuration:
      commandTopic: cmnd/tasmota_schreibtisch/WHITE
      stateTopic: stat/tasmota_schreibtisch/RESULT
      off: "0"
      on: "100"

It works, but throws the warning:

[ab.binding.mqtt.generic.ChannelState] - Command '{"POWER":"ON","Dimmer":100,"Color":"000000FF00","HSBColor":"237,100,0","White":100,"CT":153,"Channel":[0,0,0,100,0]}' not supported by type 'OnOffValue': No enum constant org.openhab.core.library.types.OnOffType.{"POWER":"ON","Dimmer":100,"Color":"000000FF00","HSBColor":"237,100,0","White":100,"CT":153,"Channel":[0,0,0,100,0]}

How did you solve that switch?
I’m sending 100 for ON, 0 for OFF.
Or is there a more elegant way?