npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

homebridge-switchsound

v1.0.8

Published

Homebridge SwitchSound is a plugin for Raspberry Pi and Linux systems.

Readme

SwitchSound

SwitchSound is a plugin that offers the possibility to create buttons that activate the playback of audio files present locally. Each button is linked (and will play) a single audio file or a folder of audio files in shuffle. In the latter case, pressing the button will randomly select and play one of the audio files present in the specified path. For each button you can adjust the volume of the audio playback. The volume cannot be adjusted during playback but only before pressing the button.

Install Omxplayer

Log in ssh to the raspberry and install omxplayer with this command. Omxplayer is the music player that will play your sounds.

sudo apt-get install omxplayer

Upload your sounds on Pi

Log in ssh to the raspberry and create a folder "sounds" in this path:

/home/pi/

To create folders and transfer your audio files, you can use an SFTP application. I use Cyberduck. https://cyberduck.io/

How use SwitchSound

After installing the player and uploaded our favorite sounds, let's create the Homekit buttons corresponding to our audio files. Let's open the Homebridge configuration and create the new SwitchSound platform as follows:

{
    "platform": "SwitchSound",
    "name": "SwitchSound",
    "debug": false,
    "defaultSoundPlayer": "/usr/bin/omxplayer.bin",
    "accessories": [
        {
            "accessory": "SwitchSound",
            "id": "000000000001",
            "name": "Server Pronto",
            "soundFile": "/home/pi/sounds/restart/",
            "soundOptions": [],
            "shuffle": 1,
            "loop": false,
            "volume": 66,
            "debug": false,
            "sequence": false
        },
        {
            "accessory": "SwitchSound",
            "id": "000000000002",
            "name": "Allarme",
            "soundFile": "/home/pi/sounds/varie/AlarmSound2.mp3",
            "soundOptions": [],
            "loop": false,
            "volume": 66,
            "debug": false,
            "sequence": false
        }
    ]
}

Parameters

  • accessory <string> required: identifies the accessory. It must always be SwitchSound
  • id <string> required: identifies the serial code of the accessory. You can write whatever you want
  • name <string> required: identifies the name of the button that will appear in HomeKit
  • soundFile <string> required: identifies the path of the audio file to be connected and playing. In case of multiple files in shuffle, you can stop at the folder
  • soundOptions <string> optional: For the more experienced, it is possible to pass additional parameters to omxplayer
  • shuffle <bool> optional: activates shuffle mode. In this case it is necessary to indicate the path of a folder within the soundFile parameter
  • loop <bool> optional: play the audio file endlessly until the user turns off the button from HomeKit
  • volume <int> required: It is necessary to indicate a starting volume (0-100)
  • debug <bool> optional: enable debug mode with more output instructions
  • sequence <bool> optional: offers the possibility to play an audio file several times consecutively. Useful for short audio files

Permissions

If the playback of your audio files does not work, it may be necessary to assign permissions to the user with whom you started homebridge (if different from pi).

Run these commands:

sudo passwd INSERT_YOUR_USERNAME_HOMEBRIDGE
sudo usermod -a -G video INSERT_YOUR_USERNAME_HOMEBRIDGE

Now reboot your raspberry.