Play Sound or Say Something When Motion Detected

Tags: #<Tag:0x00007f432fb07470> #<Tag:0x00007f432fb073a8> #<Tag:0x00007f432fb072e0>

I’m looking to respond to motion sensed around my house with an audible alert in my bedroom. For example, “Motion Detected In Basement” in the case it’s 2 am, I’d like to know if someone is in the house. For a less serious example, “Child 1 door has opened” in the middle of the night so I know one of my kids are on their way into my bedroom. I’ve looked around a bit and didn’t see much but the AEOTEC Doorbell and Siren 6 seem to come up a lot. I understand to say something I’d need a "text to speech’ binding, but I’d settle for a chime or similar but I’m not sure how to address a ‘speaker’…this seems to be my main sticking point.

Thank you all in advance,
Vinny

1 Like

Read the docs and search the forum before posting, please.

2 Likes

Try search the forum for “audio sink”. Many of the threads will give you a hint.

3 Likes

I’ve read through some of the docs, but was more looking for other’s suggestions and recommended approaches based on others experiences. Perhaps I could have rephrased the post. I have a few requirements:

  1. I’d like to have simple ‘clients’ or ‘audio sinks’ around my house that receive audio events. (My OpenHAB server is running on a Linux server on my LAN).
  2. I’d prefer, if possible that those ‘sinks’ do not require a running PaperUI or OpenHab instance. I know I could throw a Rasberry Pi in each of my rooms with a speaker and have all this work via ‘webaudio’ but rather not have a dedicated mini-computer in each room.
  3. I’d like no reliance on ‘Cloud’ services. I.e., I want to be able to sever my home from the outside internet and have this still work.

Based on particular OH events, “playSound(String sink, String filename, PercentType volume)” is what I’d be calling and types of ‘sink’ is what I’m looking for recommendations on. The docs show the Sonos binding (as other bindings) will add itself as a ‘sink’ to be the final output of the stream, and, therefore, I can address all the different Sonos speaker locations differently based on the event, that’s great.

My question for the group, have others used Sonos or other options to get this exact setup? I’m hesitant to commit to the Sonos ecosystem, especially for this use case in which I’m looking for simple sounds and some text to speech where sound quality is not relevant.

PS: My assumption is that it’s proper to have this open dialog and brainstorm in this forum to socialize ideas with the community. If I’m mistaken, please advise.

Vinny

1 Like

I am using Sonos Play:1 speakers, no other mini-computer needed. Yes, that is not cheap solution, however “cheap solutions” may require a mini-computes which you do not want.
Did you look into the IKEA version of those speakers? I can’t say if they work with the SONOS binding.

2 Likes

PulseAudio can accomplish your goal, I’m not familiar enough with it to give advice, but I believe worse case you end up having the text to speech in all the rooms you have a Pi location in. I did some testing with it and managed to get another linux host (not my OH system) to play music to a bluetooth speaker; but I was never able to get the OH system to kick off pandora cli to the speaker as a feature for the spouse…and then I started working on my rule conversion to Node Red.

I would think worse case if the speech to text doesn’t work out, you could record an audio clip (or find one online) of what you want said and just send that media file to the pulse audio server for the client(s) to play.

2 Likes

I’ve done something very similar - I have the front gate and back gates set up with sensors, and use the Chromecast extension in a rule to play a chime sound to notify me of this event.

It is pretty straightforward - you will have to set up your audio sinks though to then have playback in the appropriate areas/zones.

1 Like

Should you happen to have an Alexa around then you can use the amazonechocontrol binding.