Audio sync with LEDs and home assistant lights

Hey all,

Back story… I used to have my zha lights connected to philips hue, and for halloween i would sync my lights with the spooky audio in the house via an app. Well i moved all my lights over to Hass this last year, so i was in search of a means of doing this…

I created a python script that does just this. It syncs the audio pitch with color and the volume with brightness. I have also included a server script that allows you control via a web browser.

What is required…

  • a raspberry pi
  • a usb mic (im using an old web cam)
    • you will have to figure out the device index for the usb mic and configure the script

Optional:

  • if you want to connect to hass, then you need an instance of hass.
    • including an api key, and ip address and configure the script.
  • if you only want to control led lights (ws2812) directly connected to the pi, you must have the lights
    • you have to have the info for the leds and configure the script.

You can find it here:

5 Likes

This looks nice.

I would suggest to convert this to a separate audio-sensor-server pushing the pitch and volume to Home Assistant and/or directly to MQTT for any service to take its actions.

Then another server could listen on actions for the led-strip either from MQTT or direct connection to the audio-sensor-server.

This would render the script general purpose for partying up your home or similar.