The work here is all done by volunteers who need something added. Feel free to create a binding for this.
Uses mqtt like I do
I don’t know anything about the WLED Control system, but since they’re using standard WS2812b LED strips I can only suggest following something similar to how I control several of these WS2812b LED strips with openHAB by hooking them up to Arduinos, programming and controlling them with the FastLED library
and wirelessly sending and receiving commands through MQTT and the MySensors library.
While this is not a plug and play solution, it allows for a much more versatile and individual control of these strips.
Both the above mentioned sites have very good tutorials, if you’re willing to dive into this subject.
Another option…
I currently use MQTT also to control WLED. Running three LED strips hooked up to some ESP-32’s.
Please find the WLED +Openhab integration +esp8266 wemos D1 Mini 4MB +WS2812 strip .
Using 4 instance of this . works really great . Lots of fetaure .
all files are: https://github.com/sujitrp/OPenHab-WLED-configuration-
@sujitrp Quick question for you : I see temple_light_wled_col.state.toString in your items file and it is the only place where it is mentionned beside the timeline. Shouldn’t we see ganesh_strip_wled_col instead ? Is it a mistake ?
By the way to make it work on my end I had to make changes to the items file. All mqtt=">[mqtt:wled/godlight2: etc… and <[mqtt:wled/godlight2/ etc… had to be replaced with mqtt=">[broker:wled/godlight2: etc… and <[broker:wled/godlight2/ etc…
The MQTT channels will be different for different setups. Yours is mqtt1 and you broker is named “broker”. With mqtt2 the configuration will be completely different (since you now have things for mqtt2).
Thank you for posting your openHAB files. They have been very useful for me getting this set up on my own system. I am at a loss though on where the .js files go in the OpenHAB system. What folder do they go in?
Hi Ben good morning,
.is file to go in /openHab-conf/transform
thank you I shall have a play this weekend. Your information was valuable.
Hi a litle out of topic
i have a number of Magic Home LED contorlers
can i flash this frameware on that ?
or this is for smarter LEDs?
Hi Gad not sure on this . But you can share
Magic led item details with photo . I shall have quick check . Is it esp8266 based ?
I will recommend 1. wemos d1 mini or 2. node mcu
this is the current binding
somthing like this
Ref above link . Nice discussion and solution on analogous strip control .
Thank you i will look this up
So not really sure if this works in the current 0.85 and 0.8.6 release after they changed to the homeassistant discovery. I am new to using the transforms but will try and figure it out. Has anyone else successfully gotten this working in the current release after they changed the mqtt structure?
When using @sujitrp’s recommendation I get see event changes but all different
13:29:09.384 [WARN ] [hab.binding.mqtt.generic.ChannelState] - Command '#FF0400' not supported by type 'ColorValue': #FF0400 is not a valid RGB syntax
13:29:09.383 [INFO ] [smarthome.event.ItemStateChangedEvent] - WLEDOfficeLight changed from NULL to 15,100,6
13:29:09.387 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler HomeAssistantThingHandler of thing mqtt:homeassistant:50c63829:WLED-office_light tried updating channel WLED-office_light#color although the handler was already disposed.
13:29:09.387 [WARN ] [hab.binding.mqtt.generic.ChannelState] - Command '#FF0400' not supported by type 'ColorValue': #FF0400 is not a valid RGB syntax
13:29:09.390 [WARN ] [rofiles.JSonPathTransformationProfile] - Please specify a function and a source format for this Profile in the 'function' and 'sourceFormat' parameters. Returning the original state now.
13:29:09.393 [INFO ] [smarthome.event.ItemStateChangedEvent] - WLEDOfficeLight_WLED3c6ef0_light_WLEDOffice changed from NULL to 15,100,6
13:29:22.554 [WARN ] [hab.binding.mqtt.generic.ChannelState] - Command '127' not supported by type 'ColorValue': 127 is not a valid RGB syntax
13:29:22.555 [WARN ] [hab.binding.mqtt.generic.ChannelState] - Command '127' not supported by type 'ColorValue': 127 is not a valid RGB syntax
13:29:22.555 [WARN ] [hab.binding.mqtt.generic.ChannelState] - Command '127' not supported by type 'ColorValue': 127 is not a valid RGB syntax
13:29:22.560 [WARN ] [hab.binding.mqtt.generic.ChannelState] - Command '127' not supported by type 'ColorValue': 127 is not a valid RGB syntax
13:29:22.564 [WARN ] [hab.binding.mqtt.generic.ChannelState] - Command '127' not supported by type 'ColorValue': 127 is not a valid RGB syntax
13:29:22.600 [WARN ] [hab.binding.mqtt.generic.ChannelState] - Command '#0004FF' not supported by type 'ColorValue': #0004FF is not a valid RGB syntax
13:29:22.600 [WARN ] [hab.binding.mqtt.generic.ChannelState] - Command '#0004FF' not supported by type 'ColorValue': #0004FF is not a valid RGB syntax
13:29:22.604 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler HomeAssistantThingHandler of thing mqtt:homeassistant:mqtt:WLED-office_light tried updating channel WLED-office_light#color although the handler was already disposed.
13:29:22.604 [WARN ] [hab.binding.mqtt.generic.ChannelState] - Command '#0004FF' not supported by type 'ColorValue': #0004FF is not a valid RGB syntax
13:29:22.608 [INFO ] [smarthome.event.ItemStateChangedEvent] - WLEDOfficeLight changed from 15,100,6 to 225,100,6
13:29:22.610 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler HomeAssistantThingHandler of thing mqtt:homeassistant:50c63829:WLED-office_light tried updating channel WLED-office_light#color although the handler was already disposed.
13:29:22.611 [WARN ] [hab.binding.mqtt.generic.ChannelState] - Command '#0004FF' not supported by type 'ColorValue': #0004FF is not a valid RGB syntax
13:29:22.616 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler HomeAssistantThingHandler of thing mqtt:homeassistant:50c63829:WLED-office_light tried updating channel WLED-office_light#color although the handler was already disposed.
13:29:22.617 [WARN ] [hab.binding.mqtt.generic.ChannelState] - Command '#0004FF' not supported by type 'ColorValue': #0004FF is not a valid RGB syntax
13:29:22.620 [WARN ] [rofiles.JSonPathTransformationProfile] - Please specify a function and a source format for this Profile in the 'function' and 'sourceFormat' parameters. Returning the original state now.
13:29:22.627 [INFO ] [smarthome.event.ItemStateChangedEvent] - WLEDOfficeLight_WLED3c6ef0_light_WLEDOffice changed from 15,100,6 to 225,100,6
Hi !
Can someone please suggest changes in the items for using it with a things file in mqtt 2.4 setup. I have started late with OH and have only used mqtt2.4.
Update:
Was easy to find out. Thanks OH
Things Definition
Thing mqtt:topic:ledStripThingId "LED Strip"
(mqtt:broker:brokerThingId) @ "My Room"
{
Channels:
Type switch : ledStrip "LED Strip" [ stateTopic="wled/740dd6/g", commandTopic="wled/740dd6", transformationPattern="MAP:LEDONOFF.map" ]
Type dimmer : ledStripDimmerOne "Bed Room Night Brightness [%d]" [ stateTopic="wled/740dd6/g", commandTopic="wled/740dd6", min=0,max=255 ]
Type dimmer : ledStripSpeedOne "Bed Room Night light Speed [%.0f]" [ stateTopic="wled/740dd6/api", commandTopic="wled/740dd6/api", min=0,max=255, formatBeforePublish="&SX=%s" ]
Type dimmer : ledStripIntensityOne "Bed Room Night light intensity [%.0f]" [ stateTopic="wled/740dd6/api", commandTopic="wled/740dd6/api", min=0,max=255, formatBeforePublish="&IX=%s" ]
Type number : ledStripColorN "Bed Room Night Color" [ commandTopic="wled/740dd6/col", transformationPatternOut="MAP:wledColoreffectsJSON.map" ]
Type number : ledStripEffects "Bed Room Night Effects" [ commandTopic="wled/740dd6/api", transformationPatternOut="MAP:wledColoreffectsJSON.map" ]
Type number : ledStripPalettes "Bed Room Night Palettes" [ commandTopic="wled/740dd6/api", transformationPatternOut="MAP:wledColoreffectsJSON.map" ]
}
Item Definition
Switch LEDStrip "LED Strip" ["Switchable"] { channel="mqtt:topic:ledStripThingId:ledStrip" }
Dimmer LEDStripDimmerOne "Bed Room Night Brightness [%d]" { channel="mqtt:topic:ledStripThingId:ledStripDimmerOne" }
Dimmer LEDStripSpeedOne "Bed Room Night light Speed [%.0f]" { channel="mqtt:topic:ledStripThingId:ledStripSpeedOne" }
Dimmer LEDStripIntensityOne "Bed Room Night light intensity [%.0f]" { channel="mqtt:topic:ledStripThingId:ledStripIntensityOne" }
Number LEDStripColorN "Bed Room Night Color" { channel="mqtt:topic:ledStripThingId:ledStripColorN" }
Number LEDStripEffects "Bed Room Night Effects" { channel="mqtt:topic:ledStripThingId:ledStripEffects" }
Number LEDStripPalettes "Bed Room Night Palettes" { channel="mqtt:topic:ledStripThingId:ledStripPalettes" }
Color LEDStripColor "Bed Room Night Color"
Rule for the Color Picker Item
rule "Publish changes to the Color for LEDs"
when
Item LEDStripColor received update
then
val HSBType newState = triggeringItem.state
val rgb = 16777215 + newState.getRGB
val mqttActions = getActions("mqtt","mqtt:broker:brokerThingId") // use the Thing ID for your configured Broker
mqttActions.publishMQTT("wled/740dd6/col",""+rgb)
end
Works now.
Sitemap remains the same, just edit the names accordingly.
Note: I did not use the js transformation as I read some OH developer somewhere saying on the forum that running JS engine inside takes great resources on the machine. Hence I went for simpler approach instead. Thanks
The only bit I cant get working with MQTT2.4 is the color. If anyone has a solution for that it would be nice to see it. By the way I am not a coder so these things can be tricky.