WLED - Control AudioReactive Enable/Disable Button from Home Assistant

Hi.

I have been looking for a way to control the AudioReactive enable/disbale button in WLED (under the ‘Info’ tab) from Home Assistant for a while now, but cannot find it or work out a way using the current API’s.

This would be a great option to provide end users a button on a page to make the WLED lights be audio reactive or just a normal effects.

Would this be a viable option to add to either the entities that come into Home Assistant or add it to the WLED API?

Cheers, Chris :slightly_smiling_face:

Can you save two presets?

One with audio-reactive on and one with it off.

Selecting presets from within HA is supported.

Also this is the wrong place to ask for API changes to WLED. You should ask for that at the WLED project github page.

EDIT: it is already supported by the API. You can use a command line switch:

# configuration.yaml
command_line:
  - switch:
      name: WLED Audio-Reactive
      command_on: >
        curl -X POST "http://<wled-ip>/json/state" -d '{"AudioReactive":{"enabled":true}}' -H "Content-Type: application/json"
      command_off: >
        curl -X POST "http://<wled-ip>/json/state" -d '{"AudioReactive":{"enabled":false}}' -H "Content-Type: application/json"

I have been unable to work out what the state command is for feedback. So this switch will operate in optimistic mode.

Loaded up HA last evening on a Ubuntu machine. HA immediately highjacked my WLED device. While I can control my WLED device using HA for general lighting, my audio-rreactive feature is gone. I attempted to implement your ‘switch’ (above). The ‘switch’ does appear in my dashboard as ‘off’, but I cannot get it to switch to the ‘on’ position. Any additional guidance you can provide?