[SOLVED] Wled PLEASE MAKE THIS WORK IN OPENHAB

thanks a lot. a binding for wled is all we need
:smile:

No problem. The binding is ready for beta testing over in the below thread and has more functionality than the other method used in this thread…

1 Like

Thanks I’ll be using that from now on.

Is there a way to make the wled works like a touch dimmer? I build my kitchin lights whit w2812b strips and I wood like too be able to make it work whit short press to turn on and off and long press to make it dim up and down like a touch dimmer.

Yes It is Possible can do that.
Connect push button in Wemos mini Pin D2 and GND .
Then in WLED Setting page Time and Macro Page set macro
These macros can be executed using Button functionality
Button functionality have 3 action 1. Short Press 2. Long press 3. Double press

image

This is currently supported for the following parameters:
A, R, G, B, W, R2, G2, B2, W2, FX, SX, IX, FP, PL

ref this page :https://github.com/Aircoookie/WLED/wiki/HTTP-request-API
https://github.com/Aircoookie/WLED/wiki/Macros

My SetUp:

given the WLED can be used as a http dimmer can this rule “INCREASE/DECREASE”
by toggel a push button this wood be VERY NICE :smiley:

Dimmer myDimmer "My http Dimmer is [%d %%]" {http=">[*:POST:http://www.domain.org/home/lights/23871/?status=%2$s&type=text] <[http://www.domain.org/weather/openhabcity/daily:60000:REGEX(.*?<title>(.*?)</title>.*)]"}

(Item definition from documentation)

Now to change the value, either use a slider in Basic UI or something similar, with “real” sliders, or use INCREASE/DECREASE commands and a rule to set the value:

rule "My http dimmer"
when
    Item myDimmer received command
then
   if (receivedCommand == DECREASE) {
        myDimmer.sendCommand((myDimmer.state as DecimalType) - 5)
}
    else if (receivedCommand == INCREASE) {
        myDimmer.sendCommand((myDimmer.state as DecimalType) + 5)
}

I`m still making my lights smarter diy. ,but untili have gotten the first light to work like before
i tried to make it smarter (it had a regular dimmer before) , but i like some bling bling some times to play whit,so before i can move on to more lights i have to make this work first .

After woods i will like some off this lights to work on BK Hobby`s Hasp plates for next project

Are you tested the Dimmer part? If i use your example i only see values from 0 to 100 in the topics and never 0-255.

Also would you be so kind and provide the neccessary tranformation files?

Thanks a lot

Cheers

Andreas

Nevermind, now i get also the complete range from 0-255. However i would really appreciate if you could provide the tranformation files. :smiley:

Hi there.
The transformation files are in the last link of the post marked as solution.
Here is that link

If you use min/max definition in the channel configuration in .things file, you can transform dimmer’s 0-100 percent values to wled’s 0-255 values. The only drawback is, there is no way to round it up to integer value, but it seems it works fine on wled side without problems.

Here is my master brightness definition:
.things:

Thing mqtt:topic:sentinel:k-led-1 "Kitchen LED 1" (mqtt:broker:sentinel) @ "MQTT2" {
    Channels:
        Type dimmer : k_led_1_Dimmer "Kitchen LED Brightness [%d]" [ stateTopic="wled/k_led_1/g", commandTopic="wled/k_led_1/api", min=0,max=255, formatBeforePublish="&A=%s"  ]

.items

Dimmer  k_led_1_dimmer      "Kitchen Led 1 Brightness [%d %%]"                         (g_k_dimmer)     { channel="mqtt:topic:sentinel:k-led-1:k_led_1_Dimmer" }

Wled announces back the brightness value on /g topic after you sent the command. You can check it with an external mqtt client like mqtt.fx.

Hi everyone,

i got everything working. To make it easier for following openHAB users i forked aditya_Sharma repository and tried to adapt my working configuration files. So far i couldn’t test it in a seperate openHAB installation. I will do this in the next few days. Also i tried to put all information from this thread into the read me from this repository.

Cheers

Andreas

1 Like

@regnets Great, it works almost fully except that Wled_Color can’t find an item when linking things?

Have you tried the non merged Wled binding that is found on this forum? What works better using it by mqtt binding or via the wled binding?

@matt1 Thank you, I didn’t know about it, now I have it installed, it works and it looks like the problem. I am thinking is it because I use the firmware version for WLED_0.x.x_ESP8266_1M_ota.bin (I use ESP-01S RGB LED Controller Module) and it is not fully functional?

Do you have the latest iOS app or is that android? Try basic ui in a browser to check if it works in there. Older iOS version of it did that where the drop down lists were empty. It may be possible to use a mapping on the selection elements to fix it.

The other possible reason is when u drop a jar into the addons folder openhab may need more than one reboot for the cache to be created. Try a few reboots.

Regarding if it could be caused by your model of esp I doubt it as the binding should still display the full list in the selection drop down list. The list is hard encoded and should display fine, either it is the binding not loading correctly or a bug in your display ui, hence test it in basic ui.

thanks! I will try rebooting the system several times as well as with the basic interface. The items are all linked in Things, Android app version is the latest. As for my esp, I think there is no problem because previously using the solution of "Regnets Andreas " above, it works fully, except for Color.

Yeah that looks like it wont work as it is probably sending the wrong format for colour…

Type number : WLED_Color “WLED: Color” [ commandTopic=“wled/785f2a/col” ]

And then it uses a rule to send a packet. The above line should be removed from the things file and a unbound control created for the rule to use in a items file. see @aditya_Sharma post in this thread which has an example that looks like it will work.

Let me know which way works better once you solve the drop down list issue, which BTW it works fine here on Android app on my tablet, on my iOS phone and with Basic UI.

@matt1 The problem was fixed after I restarted Pi3 by re-powering it. Thank you so much.

I hope someone can help me out here. I thought getting my WLED light integrated via MQTT would be super easy but somehow it is just not working. Instead of sending ON/OFF it is sending 1/0 thus just dimming the light. Here is my config

Thing:

Thing topic WledSchrank1 "Schrank rechts" @ "Wohnzimmer" {
    Channels:
        Type switch    :   power               "Licht"              [ stateTopic="wled/schrank1/g", commandTopic="wled/schrank1", transformationPattern="MAP:WLED.map" ]
}

Item:

Switch WLED_schrank1             "Schrank rechts [%s]"     <light> (grSchrank) { channel="mqtt:topic:mosquitto:WledSchrank1:power" }

Sitemap part

Switch item=WLED_schrank1

Map

=Unknown
0=OFF
1=ON
...
255=ON

What am I missing here?

There is a non merged binding here: