Use MagicHome LEDStripes with Tasmota in Openhab

  • Platform information:
    • Hardware: Proxmox VM
    • OS: Debian
    • Java Runtime Environment: zulu 8
  • openHAB version: openHAB 2.5.4 Release Build
  • Issue of the topic:
    Hi everybody,
    I try to use one MagicHome LED Stripe, which I flashed with Tasmota, in openHab. The Thing, Items and sitemaps look like the following:
    Thing topic rgb_led_bild "RGB Led Bild" @ "Jonas" {
    Channels:
        Type switch   : power      "Power"                  [ stateTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/stat/POWER", commandTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/cmnd/POWER" ]
        Type dimmer   : dimmer     "Dimmer"                 [ stateTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/stat/RESULT", commandTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/cmnd/DIMMER", transformationPattern="JSONPATH:$.Dimmer" ]
        Type colorHSB : colour     "Farbe"                  [ stateTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/stat/RESULT", commandTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/cmnd/HSBColor", transformationPattern="JSONPATH:$.HSBColor" ]
    }
Group    RGB_Led_Bild               "LED Bild"       
Switch   RGB_Led_Bild_Power       "Power: [%s]"                     (RGB_Led_Bild)   {channel="mqtt:topic:mosquitto:rgb_led_bild:power"}
Dimmer   RGB_Led_Bild_Dimmer      "Dimmer:"                         (RGB_Led_Bild)  {channel="mqtt:topic:mosquitto:rgb_led_bild:dimmer"}
Color    RGB_Led_Bild_Colour      "Farbe:"                          (RGB_Led_Bild)  {channel="mqtt:topic:mosquitto:rgb_led_bild:colour"}
	Switch item=RGB_Led_Bild_Power label="LEDBand: [%s]" icon="light"
        Colorpicker item=RGB_Led_Bild_Colour label="Bild Farbe:"
        Default item=RGB_Led_Bild_Dimmer label="Dimmer:"

It looks like

When I am changing the slider in the colorpicker, the brightness of the LEDs is changing, but the slider is jumping back to 50%.
When I afterwards change the color, then the color of the led is changed but with the dimmervalue 50, even if the old color had 100 (but because the slider jumped to 50)

Procedure:

LEDs set to red in Tasmota
16:33:50 MQT: Haus/Erdgeschoss/Wohnzimmer/LEDBand/stat/RESULT = {"POWER":"ON","Dimmer":100,"Color":"FF0004","HSBColor":"359,100,100","Channel":[100,0,2]}

refresh basicui,  colorpicker has the color red and slider on 100. Dimmer value in basicui is 100 as well.
I change the colorpicker to blue and the LED colors are changing. Dimmer stays 100 %

16:37:26 MQT: Haus/Erdgeschoss/Wohnzimmer/LEDBand/stat/RESULT = {"POWER":"ON","Dimmer":100,"Color":"0314FF","HSBColor":"236,99,100","Channel":[1,8,100]}

I now close the colorpicker and open it again, now the selected color is white (leds still blue). The slider below the colorpicker is 50%. The Slider of the Dimmer still 100%


I change the value again to blue 
16:38:32 MQT: Haus/Erdgeschoss/Wohnzimmer/LEDBand/stat/RESULT = {"POWER":"ON","Dimmer":50,"Color":"070D80","HSBColor":"237,95,50","Channel":[3,5,50]}
and the slider to nearly 75%
16:38:34 MQT: Haus/Erdgeschoss/Wohnzimmer/LEDBand/stat/RESULT = {"POWER":"ON","Dimmer":78,"Color":"0A14C7","HSBColor":"237,95,78","Channel":[4,8,78]}
As you can see the dimmer was moved to 50 percent, even if the brightness was not changed.
The second command where i change the brightness is committed correct to tasmota, but basicui is resetting it to 50

So I have 2 problems

  1. Sometimes when i open the colorrpicker it is set to white
  2. brigthness is set to 50%

I can see the following in the log:
2020-05-05 18:28:15.752 [WARN ] [t.generic.ChannelStateTransformation] - Executing the JSONPATH-transformation failed: Invalid path ‘$.Dimmer’ in ‘{“POWER”:“OFF”}’
2020-05-05 18:28:15.753 [WARN ] [t.generic.ChannelStateTransformation] - Executing the JSONPATH-transformation failed: Invalid path ‘$.HSBColor’ in ‘{“POWER”:“OFF”}’

Is it related to the topic Haus/Erdgeschoss/Wohnzimmer/LEDBand/stat/RESULT?
Should I change it to tele? I have seen that I can create 2 channels in thing and then use both channels in item. Does it make sense here?

I’m looking forward if here is somebody who can help me.
Best regards
Eric

These MQTT topics were also confusing for me in Tasmota. And also the docs doesn’t say anything in details on how the topics works.

I think yes, it is jumping back to the previous state, because in the state topics you get a response which doesn’t contains the new color values. If I’m right I also set the tele topics for these channels. It seemed that on that topics the whole JSON object is returned, not just the changed attributes, so it will work.

So you configure the Item with only the teletopic AS a Channel or with both?
So you configure that dir every Item?

You can also connect a Dimmer item to the mqtt colour channel!

I used magichome with the wifi binding directly, was no need to use mqtt.

Tasmota is much better than its original crappy fw… previously I also used that, but I didn’t like that too much…

No problem…

On that subject…I purchased some cheap wifi bulbs that are not compatible with current openhab choices. How does one go about flashing new firmware?

It depends on the exact device.
If it is a “Tuya” (Smartlife App) branded Wi-Fi bulb, there is a chance that you can flash it without disassembling, easily through Wi-Fi.
If not, you have to do a disassembly, find the ESP chip and flash the firmware with a Serial connector.

I adapted your remarks ( 2 channels, color channels also for dimmer value) and changed it to the following values:

Things:

        Type switch   : power      "Power"                  [ stateTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/stat/POWER", commandTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/cmnd/POWER" ]
        Type dimmer   : dimmer     "Dimmer"                 [ stateTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/stat/RESULT", commandTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/cmnd/DIMMER", transformationPattern="JSONPATH:$.Dimmer" ]
        Type dimmer   : dimmer2     "Dimmer"                 [ stateTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/tele/STATE", commandTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/cmnd/DIMMER", transformationPattern="JSONPATH:$.Dimmer" ]
        Type colorHSB : colour     "Farbe"                  [ stateTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/stat/RESULT", commandTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/cmnd/HSBColor", transformationPattern="JSONPATH:$.HSBColor" ]
        Type colorHSB : colour2     "Farbe"                  [ stateTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/tele/STATE", commandTopic="Haus/Erdgeschoss/Wohnzimmer/LEDBand/cmnd/HSBColor", transformationPattern="JSONPATH:$.HSBColor" ]
        

Items:


Group    RGB_Led_Bild               "LED Bild"       
Switch   RGB_Led_Bild_Power       "Power: [%s]"                     (RGB_Led_Bild)   {channel="mqtt:topic:mosquitto:rgb_led_bild:power"}
Dimmer   RGB_Led_Bild_Dimmer      "Dimmer:"                         (RGB_Led_Bild)  {channel="mqtt:topic:mosquitto:rgb_led_bild:colour",channel="mqtt:topic:mosquitto:rgb_led_bild:colour2"}
Color    RGB_Led_Bild_Colour      "Farbe:"                          (RGB_Led_Bild)  {channel="mqtt:topic:mosquitto:rgb_led_bild:colour",channel="mqtt:topic:mosquitto:rgb_led_bild:colour2"}

The errors in the log file seem to be gone but the led is still not working like i want it

What is the exact problem with it? With the error gone, it means that it receives the full JSON object and can parse it, so it should work I suppose…

I have still the problems in basic ui that it is resetting to 50 % and that the color is white when i open the colorpicker
I attached a video
Datei von filehorst.de laden

Maybe you could show your tasmota magichome led config, when you have the same?

Is this issue the same as described here?

yes seems to be the same.
changed it to Arilux LC01 (37) but the slider is still jumping to 50

I have the same issue with my flashed Gosund bulb. But it seems to be an issue with basicui. The openhab app (Android bèta) is working fine!

Ah, ok…I actually found the Phillips Wiz bulbs at a big box store for $13. There is a jar available for these…only issue, which may be with many different is that you must set static IP in the router for them…mine did a reset and it assigned new ips.

It is a BasicUI bug, at least it seems like that, see: HSB Colorpicker sets 50% Brightness when color is "picked"