API command for disabling a button?

I am new to WLED and LED strips in general. I’m having a lot of fun learning how to use the ESP32, soldering, and experimenting with simple circuits. My first project was a light strip around a door connected to a PIR so motion turns on the strip. Works really well. My second project was LED strips under a bed that serves dual functions:

  1. Activated by sound
  2. Activated by motion

I’m using an INMP441 and an HC-SR501. I have T=0 (“Off”) and T=1 (“On”) presets connected to the short and long button actions, respectively.

I have added Home Assistant and would like to create an integration that does the following:

  1. When the TV is off, select a non-sound-reactive effect. The LEDs will act as a night light if someone is moving around the room.
  2. When the TV is on, select a sound-reactive effect and disable the motion sensor.

I’ve created the integrations using two additional presets but I’m not sure how to disable the motion sensor. As it is now, the sound animation only plays when there is also motion detected. Is there an API command for this that I can add to the appropriate preset?

Thanks in advance for any help.

You need to Implement TV Status Detection

Use Home Assistant to monitor the TV’s power state. You can achieve this by using an automation that triggers when the TV turns on or off. Once the TV’s status is determined, send corresponding commands to WLED to adjust the LED strip settings.

To disable the motion sensor when the TV is on, you’ll need to send a command to WLED that disables the button actions associated with the motion sensor. This will effectively prevent the motion sensor from triggering the “On” preset.

Set preset:

wled/lights/*/setPreset?presetId=SOUND wled/lights/*/setPreset?presetId=NIGHTLIGHT
2. Disable button actions for motion sensor:

wled/lights/*/setButtonActions?button=0&mode=disabled wled/lights/*/setButtonActions?button=1&mode=disabled

Oh, and ofc.
Create two additional presets: one for the sound-reactive effect and one for the non-sound-reactive effect. Make sure to assign unique IDs to these presets, such as “sound” and “nightlight.”

More specific