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 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-ueboom

v1.0.2

Published

Homebridge plugin for UE Boom speakers

Downloads

55

Readme

Homebridge UE Boom (Speaker Plugin)

This is an accessory plugin for Homebridge allowing to turn on and off a UE Boom speaker and integrating it with HomeKit.

Installation

Homebridge

First, install Homebridge and gatttool via Bluez (you also need Node.js installed):

sudo npm install -g homebridge
sudo apt-get install bluez

Then install this plugin:

sudo npm install -g homebridge-ueboom

Homebridge Docker

In case you're using Homebridge Docker, add the following line to your container startup script:

apk add --no-cache bluez-deprecated

Then install this plugin:

sudo npm install -g homebridge-ueboom

Find out the MAC address

To get the plugin working you have to provide the following parameters:

  • speaker: MAC address of the speaker
  • host: MAC address of the audio source device (iPhone, ...)

In case you don't know how to retrieve the MAC address of the speaker:

  1. Pair the speaker to your MacBook
  2. Click on Bluetooth icon in the Menu Bar while pressing ⌥ Option
  3. Select the speaker of which you need the address
  4. Write down the MAC address

To retrieve the MAC address of the host, it strictly depends on the device you're using. If you're playing music from an iPhone/iPad then you can find it in Settings > General > About > Bluetooth.

Configuration

Create a ~/.homebridge/config.json file (change name, speaker and host as necessary):

{
  "bridge": {
    "name": "Homebridge",
    "username": "E5:B9:0D:64:1E:CB",
    "port": 51826,
    "pin": "031-45-154"
  },
  "description": "This is an example configuration file with homebridge-ueboom plugin.",
  "accessories": [
    {
      "accessory": "UEBoomSpeaker",
      "name": "Bathroom Speaker",
      "speaker": "C0:28:8D:45:28:55",
      "host": "4098ADA356C4"
    }
  ],
  "platforms": []
}

Breaking change: in case you're transitioning from v0.0.1 or v0.0.2, update your config file with the newly requested variables!

How does it work

Since more than one person asked me how this works and that the speaker doesn't connect to the Pi after being turned on, I thought I could spend a couple of words about.

This is the command that does the whole work, everything else is just boilerplate code for the homebridge plugin:

gatttool -i hci0 -b $SPEAKER_ADDRESS --char-write-req -a 0x0003 -n ${HOST_ADDRESS}${ON_OFF_COMMAND}
  • SPEAKER_ADDRESS is the MAC address of the speaker
  • HOST_ADDRESS is the MAC address of the audio source device (iPhone, ...)
  • ON_OFF_COMMAND is 01 to turn the speaker on and 02 to turn it off

The gatttool command turns the speaker on but doesn’t associate the speaker with the Raspberry Pi. The speaker connects to the host device (in my case my iPhone).

I don't know the exact specifications so this is pure speculation: the speaker itself has the usual Bluetooth 4.0 module that allows to stream music, in addition to that there's also a BLE (Bluetooth Low Energy) module that for its own nature is always on and allows to turn the speaker on and off remotely (within range). The only reason why I'm not sure this is the real reason is that the two modules would probably have two separate MAC addresses, and from what I've observed there's only one single address available.

How I did it

I knew that the speaker could be turned on remotely (within range) using the proprietary Ultimate Ears app, and it was obvious that the bluetooth command was sent by the application itself.

I first installed Apple's Bluetooth logging profile on my iPhone, then connected it to the Mac via USB and used PacketLogger to trace the packages sent from the phone (specifically ATT Send type). By opening the UE app and tapping on the remote power button in it I was able to sniff the conversation between the phone and the speaker as shown in this screenshot.

packetLoggerScreenshot

From here I retrieved the MAC address of the speaker (as described above) and used gatttool to perform a write request, and BOOM (pun intended) I can turn on the speaker from my command line.

Contributors

Special thanks go to: