Play preset sound through speakers with Zigbee?

Hello everyone,

I am currently using HA green + a Zigbee dongle to automate some lights and smart plugs. I want to add a speaker to my infrastructure where, when triggered, the speaker would play an preset audio file for a certain amount of time. I just need an on/off action for a simple sound/music. I want to avoid using an Alexa as they rely on the cloud and I want to keep everything local.

Here is my current configuration:

1 HA green connected via ethernet + 1 Sonoff Zigbee dongle connected to the HA green via USB
1 Zigbee smart plug
1 Zigbee smart light

I really appreciate any tips/directions you may have!!

Thanks

These work well with home assistant: https://raspiaudio.com/muse/

Wifi not zigbee.

1 Like

Thanks, Tom! That seems like a good option but unfortunately I cannot use anything through wifi (I am working on a project using my uni’s wifi), so I am not sure how I would be to connect the speaker to HA in that case.

I’m not aware of any zigbee speakers, only alarm sirens.

That’s mostly what I have found online. It doesn’t have to be Zigbee only, maybe just local. Anything that does not rely on cloud or wifi. Thanks for your help!

Perhaps if it is simply a preset audio file, you could use something like this, and just control the power with a zigbee relay (or a zigbee outlet to which your USB power is connected). Another option would be using a switchbot device to physically press the button (they use bluetooth).

1 Like

Is this what you mean by a zigbee relay?

I’ll go ahead and edit my original post, but here is my config so far:

1 HA green connected via ethernet + 1 Sonoff Zigbee dongle connected to the HA green via USB
1 Zigbee smart plug
1 Zigbee smart light

The switchbot could be an option, but it seems a bit finicky with a couple of extra steps. I wouldn’t consider it for now.

That leaves you with Bluetooth (because you have excluded WiFi and Zigbee wasn’t designed for streaming audio).

No. Was referring to something like this.

Another option I just found: ZBMicro - SONOFF Official

Okay. How does this work, generally? I’m super new to this I’m sorry if this is obvious. Would you need to power the TF Card you showed earlier which would later control an audio output via either 3.5mm or USB?

Oh I see! Would you use the latter with a USB speaker then?

Yes unfortunately, but I only to turn an audio output on/off with the same constant volume + sound every time, so maybe there is a way? Again, still very much learning so I appreciate the feedback/help.

Apologies, I misunderstood your requirements.

Are you able to play a music file to an amplified speaker physically connected to the headphone jack of your Home Assistant server?

How far will the speaker be from the server?


FWIW, about 15 years ago and well before the advent of Home Assistant, that’s how I played announcements from my home automation server. I connected the speakers to the server via a 25 foot extension cable.

1 Like

Yes, I would just control/toggle power to that audio player. I think it just starts playing the sound file as soon as it gets power, and remembers the last volume level it was at. You can control power to it with either option I sent, but using the ZBMicro seems simpler as you can power this player directly from USB.
It can output audio via 3.5mm to any sound system you prefer, or if a small speaker is sufficient, it has an onboard 2W amplifier. There are likely many similar (and potentially cheaper) options out there too, but I used one of these years ago for a halloween decoration, and it worked well.

I agree with @123, if you are close enough to your server, you could play the sound directly from there.

1 Like

The HA green doesn’t come with a pre-installed 3.5 mm port so I’ll be using a USB speaker instead. I’ll connect directly to my main servers since I don’t need the speaker to be too far from the server. I hope this will do the trick!

Question for you both @123 @mwaterbu: I am planning on building new HA platforms at different locations on the same network. I was thinking of using rpis with HA installed + the same infrastructure I am already using (Sonoff Zigbee dongle + light bulb + smart plug + USB speaker). Will I be able to use the speaker and the other appliances the same way I am currently doing with my main server? That is have independent mini smart systems at different locations on a same network, all acting independently of one another.

I hope this was clear enough!! I’ll keep you posted on how things go once I receive the speaker :slight_smile: Thanks a bunch

Be advised there’s no native integration that exposes the host machine’s speaker as a media_player. Here’s how someone else tackled the challenge:

1 Like

Ok thanks this is super helpful. I’m gonna have a read. Do you reckon this would work the same for a USB speaker then?

Just read that thread - it seems super straightforward so that’s good. I’ll have to try once I get my speaker, but this doesn’t to work with newer HA versions… I’ll keep this thread updated with future updates!

Setup the Music Assistant addon and just plug in a usb speaker to the HA host.

Optinally install the VLC integration and then just setup the automatons with the vol level presets for the media player you want to use and timers.