WLed: A binding for controlling LED strips and strings from an opensource esp8266 project

If anyone is interested in using this binding, it is now ready to be used. The idea is to do all setup with the app or the webpage of WLED and only what is needed to actually automate inside your rules gets added to the binding as the Wled project is changing a lot.

Download precompiled jar from here.
http://pcmus.com/openhab/WLed/
It requires the Paho library which is also included in the ZIP. Just drop both JAR files into your addons folder (after stopping Openhab first) to install or if you have a binding which uses a different paho version just leave the paho lib out and the binding should work fine with a different version. You may need to restart Openhab a few times before the cache is created and everything works, so ignore issues till it is restarted a few times.

GitHub Project and readme is found here which includes example things, items and sitemap files.

The GitHub project for the firmware for a ESP device and plenty of info on how to get the hardware going:

Working features of the binding are:

  • Colour, Brightness and on and off are all working from a single color item. This means that Google and Alexa can use the same name to control all these seamlessly. Only tag the colour channel to do this.
  • Auto discovery finds your Leds from the MQTT broker so it can be setup without editing text files. For this to work you need to leave the MQTT topic structure to the default.
  • FX (two way sync so this list changes in Openhab when you select them in the wled app / webpage)
  • Palettes (two way sync so this list changes in Openhab when you select them in the wled app / webpage)
  • Preset selection and a number of other controls to start and stop the presets looping.
  • Adjustable transition time.
  • Speed and Intensity controls
  • Sleep mode (two way sync so this changes in Openhab when you select them in the wled app / webpage)

This was a quick conversion from another binding (espmilighthub) which has been used for years already so it should be very stable and has the ability to buffer, throttle and filter out the messages to and from Openhab to stop things getting flooded with data. You can drag your finger around colour wheels and not overload the esp8266 with too much data. In debug logging you will see this getting logged.

Since I never got the WLed project running with other methods it would be great to hear how this binding works compared to how people were doing it before hand. What is better? Anything work not as good and needs to be improved?

6 Likes

To build some great Christmas lights that have built in FX the WLED project is great. All you need is…

  • 5v 2 amp power supply (old phone charger that is 2a is perfect and easy to find a free one)
  • Wemos D1 mini clone $3
  • WS2811 Strings of LED which cost $10 per 50 leds all wired up with plugs. 4 strings plug end to end to give you 200 LEDs which is great for a 7+ foot tree.
  • plugs and heatshrink to make it all neat.

A case you can print to house it all in…

1 Like

Post away young man, post away…

Please post I will give it a try

Yes I will try this binding.

Segment support would be nice

With which project on esp8266 will this work?

Source code and precompiled jar is now linked in the first post. If you wish to use google/Alexa to control colours and brightness you need to select the SOLID fx and also the fader that selects how long to take to transition a change should be at the min setting for this to really shine.

This one which is covered in multiple videos on youtube if you wish to learn more or see it in action.

Thanks!

Just uploaded a newer version today that…

  • Fixes an issue in the android app due to dimmers giving a decimal place that caused an error.
  • FX list fixed and should be correct now.
  • Numbers added to the start of the FX to help know the number to use in rules.
  • Logging should not mention milight anymore.
2 Likes

New version uploaded today 2019-12-13

  • Updated FX list as version 0.9 firmware now has FX with different names and other changes.
  • Fixed bug that sent palettes to the preset list.
  • Now will show up correctly as off if turned off in the app or the sleep timer.

Can be used on the older firmwares with no problems just some of the FX will be named differently.

1 Like

Exelent work

I have installed newest jar file from wled-2019-12-13.zip
Thing comes to life easily.

In http://openhabianpi:8080/paperui/index.html#/control?tab=OTHER
I can’t see or use all of the functions like on/off

I suspect that is because there is no channel for on off only dimmer (not a problem)

I use VS Code to autogenerate Items and they don’t all show up properly as all channels are not defined in the thing I suspect. (not a problem)


Note to people other than matt1 this is not how you setup items yet.

I am super happy at your progress

How do you do that?
Another thread perhaps?

1 Like

4 Likes

A colour channel can be bound/linked to a “Switch” a “Dimmer” and a “Color” Element, and once you do that you will have all the controls showing up. See the examples in the readme file.

This has the advantage that when you ask Google or Alexa to control X light, you can call it the same thing for on/off and changing colour if you only tag the colour channel all the controls work through that one channel.

My color items are as per the Readme

Color WLedStringTest "WLED" ["Lighting"] {channel="wled:wled:001:0eb121:colour"}
Switch WLedStringTestSwitch   "on/off"    {channel="wled:wled:001:0eb121:colour"}
Dimmer WLedStringTestDimmer   "level"     {channel="wled:wled:001:0eb121:colour"}

and contol section looks like

This binding is going to make it so easy to setup wled thanks for all the work you are putting in.

You will find there are some errors in the logs warning you your syntax is wrong.

What is correct 0eb121 VS test
Auto001 VS 001

It works so if it does not for you then look what is different between the ones that do and the ones that do not.

Ok that a rookie cut paste mistake on my part.

Its all working accept for trying to select FX in basic ui sitemap

Works fine selecting fx for me and if it cycles it will keep updating the fx name if another control is moved.

I uploaded a newer version which now updates the brightness fader. I am probably done with this binding until they make the mqtt topic changes.

2 Likes

It is all working now.

I running openhabian on PI3 / openHAB 2.4.0-1 (Release Build)
Presets works perfectly. When I selected FX or presets in Basic UI it would freeze.

  • I loaded your latest jar file from wled-2019-12-13.zip
  • Made separate sitmap to isolate code.
  • Restarted openhab
    openhabian@openHABianPi:~$ sudo systemctl restart openhab2.service
  • Celebrate in success :partying_face:

I will now wait paitently for Wled MQTT topics to be finnished so we can start this all over again. Thankyou and have a well deserved break.

What a great binding. It works really well to control my outdoor LED strips. And I learned a great trick using VS code to generate items and sitemaps. Thanks @matt1 and @denominator.

2 Likes