MagicHome RGB Led with Tasmota, Colorpicker in Sitemap doesnt work

Tags: #<Tag:0x00007f173ce325d8> #<Tag:0x00007f173ce324e8> #<Tag:0x00007f173ce32420>

Hey all,

I have a problem with my RGB LED from MagicHome. I flashed it with tasmota and I got it running and it worked well. I can control it from the Paper UI without any problems. But I get sometimes Problems on my sitemap. Sometimes it works and if I change something, rules for example, it doesn’t work correctly anymore.

The Colorpicker doesn’t send the correct values for the hsb color. The slider for the brightness jumps always to the middle after I changed it, but it sends the correct values. If I close the colorpicker window and open it again the colorpicker are always at color white and brightness 50%.

If I save my sitemaps file with a different name then I have in the file it works again, but of course all the other switches not. Do you know maybe more?

// mqtt.things 
// RGB Controler
    Thing topic rgb_led_bild "RGB Led Bild" @ "Jonas" {
    Channels:
        Type string   : reachable  "Erreichbar"             [ stateTopic="stat/rgb_led_bild/LWT" ]
        Type switch   : power      "Power"                  [ stateTopic="stat/rgb_led_bild/POWER", commandTopic="cmnd/rgb_led_bild/POWER" ]
        Type dimmer   : dimmer     "Dimmer"                 [ stateTopic="stat/rgb_led_bild/RESULT", commandTopic="cmnd/rgb_led_bild/DIMMER", transformationPattern="JSONPATH:$.Dimmer" ]
        Type colorHSB : colour     "Farbe"                  [ stateTopic="stat/rgb_led_bild/RESULT", commandTopic="cmnd/rgb_led_bild/HSBColor", transformationPattern="JSONPATH:$.HSBColor" ]
        Type number   : rssi       "WiFi Signalstärke"      [ stateTopic="tele/rgb_led_bild/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
    }
//mqtt items
//RGB Controler
// rgb led Bild
Group    RGB_Led_Bild               "LED Bild"       
String   RGB_Led_Bild_Reachable   "Erreichbar: [%s]"                (RGB_Led_Bild)  {channel="mqtt:topic:mosquitto:rgb_led_bild:reachable"}
Switch   RGB_Led_Bild_Power       "Power: [%s]"                     (RGB_Led_Bild, Licht_power, Licht_hintergrund_power)   {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"}
Number   RGB_Led_Bild_Rssi        "Wifi Signalstärke: [%d %%]"      (RGB_Led_Bild)  {channel="mqtt:topic:mosquitto:rgb_led_bild:rssi"}
//sitemap as hamburg.sitemap
sitemap hamburg label="WG" {
    Frame label="Anwesenheit" {
        Text    item=Handy_Jonas_Online         label="Jonas da? [Ja]"      visibility=[Handy_Jonas_Online==ON]         icon="man_1"
        Text    item=Handy_Jonas_Online         label="Jonas da? [Nein]"    visibility=[Handy_Jonas_Online==OFF]    icon="man_1"
        Switch  item=gast_da                    label="Gast da?"            mappings=[ON="Ja", OFF="Nein"]        icon="man_1"         
        Switch  item=Test_schalter
        Switch  item=Test_schalter2
    }

    Frame label="Licht" {
        Switch item=Licht_alles label="Licht gesamt: [%s]" icon="light"

        Switch item=Steckdose_schreibtisch_Power label="Schreibtisch: [%s]" icon="light"
        Switch item=Steckdose_globus_Power label="Globus: [%s]" icon="light"
        Switch item=Steckdose_stehlampe_Power label="Stehlampe: [%s]" icon="light"

        Switch item=RGB_Led_Bild_Power label="Bild: [%s]" icon="light"
        Colorpicker item=RGB_Led_Bild_Colour label="Bild Farbe:"

    }

    Frame label="Musik" {
        Group item=Musik_Jonas
    }
}

It’d probably be helpful to know what those are then. UI use of color picker will sends commands to your Item, those will be visible in your events.log
So will incoming state changes from your device.

I think your problem is probably about transformations needed though; isn’t Tasmota wanting RGB encoded color but openHAB works in HSB encoded color?

Hey Rossko, thanks for the fast reply.

Tasmota works now with HSB color. It also works sometimes and always if I change the name of the sitemap, but then just the colorpicker. For example: The file calls hamburg.sitemap head of the file “sitemap hamburg label=“WG” {” this is correct but the colorpicker doesn’t work, but if I change to “sitemap ham label=“WG” {” the colorpicker works but the rest of course not.

Also, at the beginning the colorpicker works, but if I close the window of the colorpicker and then change just the brightness I get NaN values… If I refresh the tab of my browser the colorpicker shows again the correct values and I can also change the color correct. If I change the brightness the correct values will be send but the slider jumps always to 50% position.

// logs
2019-11-19 00:34:03.239 [ome.event.ItemCommandEvent] - Item 'RGB_Led_Bild_Power' received command ON

2019-11-19 00:34:03.250 [nt.ItemStatePredictedEvent] - RGB_Led_Bild_Power predicted to become ON

2019-11-19 00:34:03.269 [vent.ItemStateChangedEvent] - RGB_Led_Bild_Power changed from OFF to ON

2019-11-19 00:34:09.444 [ome.event.ItemCommandEvent] - Item 'RGB_Led_Bild_Colour' received command 172,94,92

2019-11-19 00:34:09.452 [nt.ItemStatePredictedEvent] - RGB_Led_Bild_Colour predicted to become 172,94,92

2019-11-19 00:34:09.466 [vent.ItemStateChangedEvent] - RGB_Led_Bild_Colour changed from 172,93,33 to 172,94,92

2019-11-19 00:34:09.606 [vent.ItemStateChangedEvent] - RGB_Led_Bild_Dimmer changed from 33 to 92

2019-11-19 00:34:57.079 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/RGB_Led_Bild_Colour' with an invalid status value 'NaN,NaN,5'.

2019-11-19 00:34:59.652 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/RGB_Led_Bild_Colour' with an invalid status value 'NaN,NaN,11'.

2019-11-19 00:35:01.905 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/RGB_Led_Bild_Colour' with an invalid status value 'NaN,NaN,25'.

2019-11-19 00:35:03.343 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/RGB_Led_Bild_Colour' with an invalid status value 'NaN,NaN,16'.

2019-11-19 00:35:32.388 [ome.event.ItemCommandEvent] - Item 'RGB_Led_Bild_Colour' received command 167,63,16

2019-11-19 00:35:32.403 [nt.ItemStatePredictedEvent] - RGB_Led_Bild_Colour predicted to become 167,63,16

2019-11-19 00:35:32.425 [vent.ItemStateChangedEvent] - RGB_Led_Bild_Colour changed from 172,94,92 to 167,63,16

2019-11-19 00:35:32.558 [vent.ItemStateChangedEvent] - RGB_Led_Bild_Dimmer changed from 92 to 16

2019-11-19 00:35:35.678 [ome.event.ItemCommandEvent] - Item 'RGB_Led_Bild_Colour' received command 167,63,85

2019-11-19 00:35:35.684 [nt.ItemStatePredictedEvent] - RGB_Led_Bild_Colour predicted to become 167,63,85

2019-11-19 00:35:35.695 [vent.ItemStateChangedEvent] - RGB_Led_Bild_Colour changed from 167,63,16 to 167,63,85

2019-11-19 00:35:35.789 [vent.ItemStateChangedEvent] - RGB_Led_Bild_Dimmer changed from 16 to 85

2019-11-19 00:35:38.584 [ome.event.ItemCommandEvent] - Item 'RGB_Led_Bild_Colour' received command 167,63,21

2019-11-19 00:35:38.589 [nt.ItemStatePredictedEvent] - RGB_Led_Bild_Colour predicted to become 167,63,21

2019-11-19 00:35:38.608 [vent.ItemStateChangedEvent] - RGB_Led_Bild_Colour changed from 167,63,85 to 167,63,21

2019-11-19 00:35:38.695 [vent.ItemStateChangedEvent] - RGB_Led_Bild_Dimmer changed from 85 to 21

Well, yes, if you break the format the results are unpredictable. This doesn’t help.

Okay, which UI are using with your sitemap and what OH version? That feels like UI is sending brightness only, dimmer style, which corresponds to what you describe you’re doing. Sounds like a UI widget mess up - each UI is different.

I use basic ui and openHAB 2.4.0 Release Build

Looks like a UI issue, at least in part - I have no color things but played with a dummy in OH2.4

Starting from Item state NULL, colorpicker works as expected in ClassicUI. Both the color wheel and dimmer slider work. The “up/down” buttons actually function as on-off buttons - I think that is intended but wrong graphics.

Just as a curiousity, Classic UI sends decimal HSB e.g.
Item 'testColor' received command 60,1.0101010101010102,38.8235294117647,100
while Basic UI sends integers.

Moving to BasicUI, the dimmer slider sends the correct info
Item 'testColor' received command 311,70,70
But the graphic slider pings back to the middle, as you saw.

Colorwheel sort of works
Item 'testColor' received command 111,81,50
but always sends brightness 50, part of the slider stuck at 50% bug I guess.

And as you say, the pointer loses its position after widget close/open.
I could reproduce your NaN incidents by close/reopen widget, then click.

I pronounce BasicUI Colorpicker widget 2.4 broken :wink:

It seems odd more folk don’t complain - perhaps it is just some browsers/environments. Mine is Chrome on Win7.
I can’t find any Github issues on this, but it would be interesting if anyone can try this out on a recent 2.5 milestone.

@Lolodomo for comment, known problem?

Hey, thanks for the test. So it is probably no configuration problem. I’m new to OpenHab but not new to programming, so I was a bit worried if it is my wrong config and / or understanding of OpenHab.

So hopefully there will be a fix. I can live with it but would be nice if it works as expected.

As a stopgap, I repeat it seems to work fine in ClassicUI

Hey, I just tested it and classic ui works here as well but is ofcourse not so nice like the basic ui. Is the a git or something, where I can report the problem?

Yes, github. Openhab2 addons would be appropriate I think.

Hey,

i didn’t find anything on github regarding this problem… I’m facing the same issue with my colorpicker in BasicUI its sending the correct data and the light changes the color properly, but the slider jumps to 50%. Reloading the site sets the slider to the correct position. Changing the color after reloading lets the slider jump to 50% again.

Im using Openhab 2.5 with basic-ui 2.5

Hey,

go to your tasmota ui -> ip of controller -> settings -> device config -> and choose "Arilux LC01 (37) as your device

now everything should work fine. :slight_smile:
Regards,
Axel