WLED API CONTROLLER

MasterGM

New elf
Joined
Aug 29, 2023
Messages
3
Hello!
I'm new to this word of LEDs, and I need some help to see if there is any "ready to use" software to what I'm looking to do!
First of all, a bit of background, I'm using a couple ESP32 with WLED and xLights to drive some leds(around 9k), and.. well it works perfectly, i make the sequencies and run them when needed, but right now I'm looking for a different approach.
See, i want to integrate some sensors to trigger specific (and pre-defined) sequences (that were already made on xLights), all of this on a SBC (like a Raspberry Pi 4)
Now, I'm pretty sure that xLights doesn't have an API at all, so what i would need is something that allows me to run predefined sequences directly from code, like python for example, or any working way that lets me just "run this if that happens".
A pseudo code approach of what I need:

if (sensor_Triggered())
RamdomApiExecuteSequence("\path\of\Sequence")

then, if RamdomApiExecuteSequence is called the Rasp will send the corresponding sequence to the controllers (Multiple ESP32 using WLED) allowing the Image/Sequence to be played!
Thank You so Much!
 

Mark_M

Annoying Elf
Joined
Dec 30, 2018
Messages
922
Location
Christmas Light world
Just this weekend there was a presentation about xLights Rest API from Virtual Christmas Summit. The recorded video should be on Youtube in 2 weeks.
Another option is ArtNET or MIDI triggers. These are less documented because not many people use it.

My other idea is watching the xSchedule webpage get and post responses and replaying this from your Pi.
xSchedule is the software to playback sequences in xLights.
xLights is the software to edit effects to make a sequence.
There is also xFade, which works like OBS. It's installed with xLights but doesn't create a shortcut in start menu (Windows).
 

MasterGM

New elf
Joined
Aug 29, 2023
Messages
3
The xSchedule Approach seems good!
It is possible to run xSchedule (and xLights for the matter) in a RBP 4? ( I could build them myself)
So I could receive x and y input from anywhere, then, in the same RBP trigger an xSchedule Webpage Sequence(I'm not really sure about this part as I'm not familiar with xSchedule at all) So the needed sequence plays?
 

Mark_M

Annoying Elf
Joined
Dec 30, 2018
Messages
922
Location
Christmas Light world
The xSchedule Approach seems good!
It is possible to run xSchedule (and xLights for the matter) in a RBP 4? ( I could build them myself)
I don't think xSchedule can be compiled to run on a Raspberry Pi.

Personally I would run FPP on a Pi and write your needed code into the script function of FPP. Then FPP can manage playing sequences based on the script you give it. That script can pull/push data from other places.

As an example; Remote Falcon plugin is a script to check with remotefalcon.com on sequence requests, then it plays the selected sequence on FPP (and reverts back after its finished). An example of FPP being the operating system and a custom script to control FPP.
 

dkulp

Full time elf
Joined
Jan 2, 2013
Messages
146
Location
Framingham, MA
If using a Raspberry Pi or Beaglebone, you may be able to do it entirely without any code. If the sensors can trigger GPIO inputs, then you can configure it all within FPP's UI and no need for any scripting at all. That said, you can still use scripts (python, php, plain bash, etc...) as FPP has a massive REST API.
 

Mark_M

Annoying Elf
Joined
Dec 30, 2018
Messages
922
Location
Christmas Light world
If using a Raspberry Pi or Beaglebone, you may be able to do it entirely without any code. If the sensors can trigger GPIO inputs, then you can configure it all within FPP's UI and no need for any scripting at all. That said, you can still use scripts (python, php, plain bash, etc...) as FPP has a massive REST API.

I'll copy some context from chat,

The problem is that is not GPIO triggering at all, I have a capacitive sensors( to react if someone touchs any panel, custom Serial Data (that comes from another microcontrollers), Custom WIFI Packets (that are being saved on the RBP), and also this RBP is sending data out(mostly status)

I'm confident FPP can handle serial/USB devices :).
 

MasterGM

New elf
Joined
Aug 29, 2023
Messages
3
Then thats the way to go!, I will try the approach of multiple RaspBerry PI first and, then only FPP. I will keep you updated!
 
Last edited:

Notenoughlights

400,000+ twinkly lights
Joined
Oct 16, 2016
Messages
656
Location
Christchurch, New Zealand
I was triggering random sequences from FPP with Home Assistant, MQTT and a push button connected to an ESP32/8266 running ESPHome, replace the push button with a sensor and that should do what you're after.


Edit: I used the GPIO inputs on the Pi running the sequences to trigger the random sequences from a playlist.
 
Last edited:
Top