LED-strip RGBW Magic Home with Tasmota and MQTT

Hey

MORE QUESTIONS AT POST 10… :wink:

Im loosing it soon. Problems with getting my ledstrip to work correctly with Hassio.

I have flashed it and using Tasmota to control it and have made the setup for mqtt.

BUT…

When I click on the sliderbutton the ledstrip goes ON but it takes forever to get full controll.
ledon

My code:

light:
  - platform: mqtt
    name: "Ledutekok"
    command_topic: "cmnd/magichome/POWER"
    state_topic: "tele/magichome/STATE"
    state_value_template: "{{value_json.POWER}}"
    availability_topic: "tele/magichome/LWT"
    brightness_command_topic: "cmnd/magichome/Dimmer"
    brightness_state_topic: "tele/magichome/STATE"
    brightness_scale: 100
    on_command_type: "brightness"
    brightness_value_template: "{{value_json.Dimmer}}"
    white_value_state_topic: "tele/magichome/STATE"
    white_value_command_topic: "cmnd/magichome/White"
    white_value_scale: 100
    white_value_template: "{{ value_json.Channel[3] }}"
    rgb_command_topic: "cmnd/magichome/Color2"
    rgb_state_topic: "tele/magichome/STATE"
    rgb_value_template: "{{value_json.Color.split(',')[0:3]|join(',')}}"
    effect_command_topic: "cmnd/magichome/Scheme"
    effect_state_topic: "tele/magichome/STATE"
    effect_value_template: "{{value_json.Scheme}}"
    effect_list:
      - 0
      - 1
      - 2
      - 3
      - 4
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    qos: 1
    retain: false

Whats wrong? Someone?

Check out WLED.

Works really well, lots of effects and pallets, and Frenk is working on an integration for it for home assistant.

Even without that it is possible to control it well using automations and mqtt (or nodered):

This is what I cobbled together for now:

Can share it if you like.

DrZZs video:

But can I flash a MagicHome-ledcontroller with WLED?

This is not an individually adressable ledstrip.

Well you could, it’s an ESP12S board with 4MB or memory. But I’ve just realised you are using a LED strip with separate R, G and B PWM channels for control. So do not do it.

WLED is only compatible with WS2812B, WS2811, SK6812, and APA102 one wire addressable type strips.

Sorry for the confusion.

no problems…
I have plans for WLED but this I already ordered before I saw WLED.

So any thougths on my problem? Someone?

Any errors in the home assistant log that look relevant?

Exception in rgb_received when handling msg on ‘tele/magichome/STATE’: ‘{“Time”:“2019-10-28T11:04:01”,“Uptime”:“0T00:29:51”,“Heap”:14,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“OFF”,“Dimmer”:100,“Color”:“FF000000”,“HSBColor”:“0,100,100”,“Channel”:[100,0,0,0],“Scheme”:0,“Fade”:“OFF”,“Speed”:1,“LedTable”:“ON”,“Wifi”:{“AP”:1,“SSId”:“PimpRoad9”,“BSSId”:“D0:17:C2:D8:7C:70”,“Channel”:10,“RSSI”:86,“LinkCount”:1,“Downtime”:“0T00:00:04”}}’
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/mqtt/light/schema_basic.py”, line 362, in rgb_received
rgb = [int(val) for val in payload.split(",")]
File “/usr/src/homeassistant/homeassistant/components/mqtt/light/schema_basic.py”, line 362, in
rgb = [int(val) for val in payload.split(",")]
ValueError: invalid literal for int() with base 10: ‘FF000000’

Seems like it is sending color in HEX instead of RGBW. FIXED that error. My rules in console was wrong.

ORIGINAL PROBLEMS STILL REMAINS!! =(

I have a couple of RGBW LED Strips.
I use an h801 led controller to control them. it’s based on ESP8266
Here is an example of the code I used to flash the device:

After several hour of reading (and ignoring my wife, she´s not very happy now) I finally found the setting for getting it to work!

SetOption59 1

Send tele/%topic%/STATE in addition to stat/%topic%/RESULT for commands: State , Power and any command causing a light to be turned on. »6.3.0.13
0 = disable (default)
1 = enable

Thanks for all the help!

Now to satisfy my wife! =)

More things I finding on the way.

In the Commands-cookbook https://github.com/arendst/Tasmota/wiki/Commands#light there is a command “Speed”. Adressable between 1 and 20.

How do I config hassio to get that as a slider?

I can change the speed in the console by writing “Speed 1” or another number. For dimmer it is the same way. Dimmer is coding like this:

    brightness_command_topic: "cmnd/magichome/Dimmer"
    brightness_state_topic: "tele/magichome/STATE"
    brightness_scale: 100
    on_command_type: "brightness"
    brightness_value_template: "{{value_json.Dimmer}}"

I tried to do the same with speed but NO luck. plz help!

Please do! The card looks great and I haven’t been able to create one myself yet.

You are a life saver! I could not figure out for the life of me how to fix my new bulbs since Christmas after using the latest Tuya-Convert! Thank you so much!

Hi,

I had a similar issue when I started using the Tasmota. I used to upload everything by Arduino IDE and with a pre-written sample code for the configuration.yaml for HomeAssistant. I used the code from the top and continued from there. I found that the button did not update when I set another value, but only after 60 seconds. Turns out this is the default ‘update’ period where all the device parameters are published. I got everything working by writing: TelePeriod 10 in the console of the esp web app. To let itself update (just really a temporary fix) .

For the following, note that my device name is: DVES_2F675E = %Topic%

But it turns out that the subscription topics are not correct. Where tele is used, there should be used stat. Because at the time the ON Payload is written to "cmnd/DVES_2F675E/POWER" the response is written to the "stat/DVES_2F675E/RESULT" topic

I added descriptive text after the effect number, not that this addition is handled perfectly by the esp and is very handy for the HomeAssistant GUI

Hope this helps others,
Cheers, Koen

  - platform: mqtt
    name: "Digitale RGB strip"
    command_topic: "cmnd/DVES_2F675E/POWER"
    state_topic: "stat/DVES_2F675E/RESULT"
    state_value_template: "{{value_json.POWER}}"
    payload_on: "ON"
    payload_off: "OFF"
    availability_topic: "tele/DVES_2F675E/LWT"
    brightness_command_topic: "cmnd/DVES_2F675E/Dimmer"
    brightness_state_topic: "stat/DVES_2F675E/RESULT"
    brightness_scale: 100
    on_command_type: "brightness"
    brightness_value_template: "{{value_json.Dimmer}}"
    rgb_command_topic: "cmnd/DVES_2F675E/Color2"
    rgb_state_topic: "stat/DVES_2F675E/RESULT"
    rgb_value_template: "{{value_json.Color.split(',')[0:3]|join(',')}}"
    effect_command_topic: "cmnd/DVES_2F675E/Scheme"
    effect_state_topic: "tele/DVES_2F675E/RESULT"
    effect_value_template: "{{value_json.Scheme}}"
    effect_list:
      - 2 colorfade up
      - 3 colorfade down
      - 12 fire pattern
      - 4 random colors
      - 6 candle lights
      - 8 christmas green/red
      - 11 short rainbow
    payload_available: "Online"
    payload_not_available: "Offline"
    qos: 1
    retain: false

2 Likes

Thanks Koen, this worked EXACTLY how I wanted it to, and with very little change on my part thanks to your brilliant explanations! I’m running on TASMOTA 8.2.0.3. You saved me a lot of time with this template.

Hi @tom_l _i I have rgbw led Tasmota (Magic Home) I don’t know why in HA I don’t have White slide.
I WLED-HomeAssistant is different firmware?

Yes WLED is completely different firmware.

but what is the different?
now I set follow this link https://tasmota.github.io/docs/devices/MagicHome-with-ESP8285/ my correct type model Arilux LC04 (ZJ-WFMN-A V1.1) and now in HA there is White slide, but from Gooogle home not!.

OMG!

A massive number of effects and colour pallets.

1 Like

where to find control WLED?

But note that it works best with individually addressable LED strips (E.g. WS2812) but can be made to work with RGBW strips with some extra hardware.