I’ve been working on architectural lighting for my home (wall switches, fixtures) based on pixels for the last couple of years and originally had built a very horse and buggy scene/segment system that I integrated with Tasmota along with Makuna’s NeoPixelBus (tasmota had no support for pixels at all). I discovered the joys of DMX over the holidays and was about to integrate E1.31 support (from ESPPixel’s author) into Tasmota when I ran across WLED.
For my application I want there to always be bullet proof local control if mqtt (or even wifi) isn’t running, while a single button is great most of my switchplates and other widgets have 3 toggle or momentary buttons.
I’ve set up the button support to support 3 buttons with all the flash settings to allow single, double, and long press to invoke macros and send MQTT messages for the buttons themselves (rather than the state of the lights). I was hoping to use the HTTP API to set the state of multiple segments when you press a button (ie: implement a scene on a single or multiple pixel busses). I immediately ran into the problem that segment support via the HTTP GET API only allows you to change the settings of a single segment (the one that’s ‘main’) in a single call; the SS and SV are more about setting up segments than controlling them. The HTTP API parser just scans for the first parameter of a given type so there’s no way you could do multiple segments in a single call. The preset facility doesn’t appear to be able to store (today) presets that affect multiple segments (I couldn’t even make preset 16 do it with 6 segments, probably user error on my part).
With all that background out of the way, here’s what I’m thinking of doing – I’d like a cross check there isn’t some easier way or that I’m crossing the streams wrt some development coming down the pipe. Proposal:
- Add functionality to read a JSON blob from a SPIFFS file and execute it as a JSON API call; the JSON mechanism appears to be able to set up multiple segments in a single call.
- Add a JS= to the HTTP API facility that executes a JSON call from a SPIFFS file
With these in place I can upload scenes for multi-segment areas (stairs, cabinets, accent lighting around/under beds) using the SPIFF’s file browser and trigger those scenes with any of the 9 possible button actions.
I have a few places where I use toggle switches to trigger scenes (off the shelf decora switches usually) so I’ll probably make some tweaks to the ‘button’ code to understand stateful switches (in tasmota what I did was make each debounced transition from on–>off or off->on be its own trigger rather than treating it like a button).
I’ll fork/share what I’ve done, but it seems like it might be too specialized to merge generally. My holy grail/long term plan is replacing all my Insteon and z-wave stuff with ESP’s and pixels. I want to set up the system so I can leave in the house and have it not be useless to a naive end user when I eventually move (that’s the local control part of the equation), and that can easily be replaced with dumb mechanical switches for most of the built in stuff if something breaks and there are no spares left.