This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

WLED
#4
(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 Confused

--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 Smile 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
Reply


Messages In This Thread
WLED - by danborge - 20.05.2024, 20:43
RE: WLED - by admin - 21.05.2024, 07:24
RE: WLED - by Andrea Becagli - 21.05.2024, 11:37
RE: WLED - by danborge - 21.05.2024, 18:05
RE: WLED - by Andrea Becagli - 22.05.2024, 15:31
RE: WLED - by danborge - 22.05.2024, 16:45
RE: WLED - by AlexLV - 27.05.2024, 21:49

Forum Jump: