Set up speakers

Can someone tell me (a beginner) how to connect and setup a simple announcing system for openhab running on raspberry Pi 3? So text messages can be announced on a speaker.

Thanks,

Here are what I found so far:
https://www.raspberrypi.org/documentation/configuration/audio-config.md

https://groups.google.com/forum/#!topic/openhab/088BfYvMLmw

There is no native mechanism I’m aware of to get the text messages into openHAB in the first place. You will need to set something up to forward the texts to openHAB somehow. If you are on Android, Tasker would be a good place to start looking.

Can you elaborate what you mean by “text messages”?

Are you looking for something to announce SMS type text messages that come from a mobile device, or a way to configure openHAB to announce things related to the house?

Have you had the Pi outputting any sound at all? and have you set up openHAB yet?

Thanks for replying. It is the latter. I am trying to allow openhab to announce to a speaker whatever it is upto on PI.

Thanks for helping. I am trying to go the other way: generating a text message in openhab and announce it to a speaker connected to Pi.

Have you made audio come out of your Pi yet and do you have openHAB setup ?

That would be the first step, to setup the audio output and play an mp3 from the command line. Which in itself can be very confusing.

Once that is working openHAB has built in actions to make it speak whatever you want https://github.com/openhab/openhab/wiki/Actions#audio-actions

There are also many other ways to get it to speak using third party services or other scripts you have setup on your Pi. But the first step is getting the Pi to play something :slight_smile:

Recently, I have returned to this challenge. The goal is to reduce our daily grind of getting kids out the door ON TIME, which has me thinking that I can send rule based announcements over Bluetooth. Ideally, I want to send BT actions to the various Echo & Dots in our home. I should be able to define each as a Sink, and then action them as individual BT speakers. What I’m not trying to do is create some whole home Audio network.

With the advent of the RPi3 on-board BT support, I have successfully Paired and Played audio files over BT from the command line using paplay and mpg123 to a JamBox speaker. Where things fall down is between OH2 and the Java side (I think!). I have also successfully used the 3.5mm Jack Line Out for OH2 Say and Play methods so I know it’s possible. I probably just need to send to the correct sink. So I’m having successes, just not together. I have tried to make sure that I’ve switched what the default Pulse Audio Sink is for BT or Jack output in my testing.

I know that OH thinks it’s playing the audio file because if I use an incorrect filename it will complain. I’m not sure what Java Category I should be setting to DEBUG, but something is falling down on the outbound.

I know the documentation of Audio and Sinks is “coming”, but it’s very difficult to piece all of the details together. So I challenge the community back here to say, all of the pieces appear to be there now. Why don’t we have this figured out? It’s not clear to me if I, should, can, or how to create an Audio Sink in OH. Or if I should be using only the enhancedjavasound sink directly.

RPi3
OH2 -> Rules -> JavaSound / CmdLine -> PulseAudio Sink -> BT -> Speaker

This should be do-able at this point.

For those who are interested, the things I know and have been testing. Most of this is simply found under BT Headset pairing.

On RPi3, PulseAudio is used.
The BT modules need to be added.
Reconnect can also be added.
Created a PulseAudio Service running in headless server mode. Making sure to edit the server config file, not that user file.
Go through the bluetoothctl to scan trust pair and connect.
Set the PulseAudio default sink
Test with paplay or other players. BT Audio out works.

Set up the OH2 Rules or Console commands. This is where it all falls down. I can only get OH to pass Audio to the 3.5 line out jack.

There is something that I am missing about passing from OH java to the PulseAudio BT sink.

Suggestions?

I’m happy to help with documentation, but I need some more support at the java layer.

1 Like