Noise sensor to use USB microphone

Hi,

Anybody can help me on how to setup USB attached microphone with noise sensor component?

I can see device when SSH to hassio and use hassio he audio command … But I have no idea how to point noise sensor configuration to use it.

Before I used audio stream from camera but it started to mess with my Shinobi CCTV.

Any help or ideas much appreciated

Hey MrUkleja,

I spent some time researching the same problem and finally managed to configure it. I have the Logitech C310 webcam with built-in MIC.

First install the arecord via CLI and check your hardware ID for your MIC using arecord -l command.
In my case it was Card: 0 and Subdevice #0

Then create a binary sensor and use the command shown at the bottom of this topic using your hardware ID as YOUR_INPUT

In my case it looks like this:

- platform: ffmpeg_noise
  initial_state: true
  name: Noise Sensor
  input: -f alsa -ac 1 -i hw:0,0 -vn -filter:a silencedetect=n=-30dB:d=1 -f null -
  peak: -100
  duration: 1
  reset: 5

Good luck!

2 Likes

Hi vitaalz,

I am trying to follow your instructions but I just realised CLI cannot be used in hassio to install arecord or any other application, do you know if there is any add-on or other alternative to get this working in hassio?

Hi heisenberg,

arecord is included in alsa-utils package. Install it this way:

apk add alsa-utils

Hi All,

my solution that I went with was ESPHome on ESP8266 with additional LM393 sound sensor.
Works perfectly :slight_smile:

Thank you vitaalz, that worked, but after that I executed the command “arecord -l” and it returns “arecord: device_list:272: no soundcards found…”, and that’s strange because I am using a usb microphone that works in another raspberry pi I have with raspbian.

Hmm,
It is just a guess, but maybe try to restart your ssh terminal with “Protection mode” disabled and then try again.

Is that “Protection mode” one setting of the terminal I am using to connect to Home Assistant (putty in this case)? because if that is the case I am not sure how one option of the terminal can affect the execution of the commands in the raspberry pi, or am I missing something?

Hi there! How would the command go if the webcam was running from another pi and what would the noise sensor input look like in home assistant? Cheers!

Also, are you using RTP?

Hi. Can you please share the details for the setup?