(21.05.2024, 11:37)Andrea Becagli Wrote:(20.05.2024, 20:43)danborge Wrote: Hi,
Has anyone done a WLED integration? Tried searching the forums (and google), without luck. My goal is to use KNX+ LM visualization to control WLED (on/off, dim, color, effects).
I've also tried looking at other json scripts, but its quite difficult to understand with zero lua scripting knowledge...
The WLED page on json isn't very helpful (https://kno.wled.ge/interfaces/json-api/)
WLED also support MQTT (https://kno.wled.ge/interfaces/mqtt/), but that was even more difficult to understand
--Dan
I have developed a pretty good library if you want. It just controls one segment though, but you can adapt it a little to control more than one
Thanks, that would be great Got one segment on two different ESP32s, so its just what I'm looking for.
(21.05.2024, 07:24)admin Wrote: Example for brightness control.
Attach an event script to 0..100% scale object. Change WLED_IP to your WLED device IP address.
Code:http = require('socket.http')
json = require('json')
ltn12 = require('ltn12')
url = 'http://WLED_IP/json/state'
value = event.getvalue()
data = json.encode({
on = value > 0,
bri = math.round(value * 2.55),
})
res, code = http.request({
url = url,
method = 'POST',
headers = {
['content-type'] = 'application/json',
['content-length'] = #data,
},
source = ltn12.source.string(data),
})
log(res, code)
Thanks, I'll make a script and try this