Control WLED through REST in a script

I played around with WLEd, a super attractive option for cheap LED controllers.
Now I have some of them and I want to trigger presets through nymea.
MQTT doesn‘t support triggering WLED presets, but through REST command it works.

Can somebody pls post a code example for a script that does that?


Guess I figured it out:

import QtQuick 2.0
import nymea 1.0

Item {
    property string on: "";
    property string off: "";

    ThingState {
        id: oberleuchte
        thingId: "{73e382a8-e0b3-400d-81c3-d462fcc94338}" // Küche Oberleuchte - this is a generic light
        stateName: "power"
            if(value == 0) {
                var http = new XMLHttpRequest();
      "GET", off, true);
            } else {
                var http = new XMLHttpRequest();
      "GET", on, true);

Any tips to make it better?

That looks great :+1:

Thanks for sharing