-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SENSOR] Webcam in use #71
Comments
For completeness, here's the script I run:
Output:
Note that it's important that "false" be the raw value and not put in quotes. Ask me how I know! |
Hey @Jay2645 I like this idea, I can easily see knowing when the microphone or webcam is in use as being useful to automate some action with Home Assistant. I will have to think about whether it is possible to get this info without polling directly. I'll see if I can find it somewhere on D-Bus... I also like the idea of collecting example scripts. I'm wondering where would be a good place to put them? In the go-hass-agent repo? In another separate repo? I can also see a docs improvement I should make around binary sensors and their values 😉 I will add that in the next release. |
Sorry - for some reason Github has stopped sending me emails! Somewhere like |
Thanks for the script, it works very well :) I updated this line to detect if any camera is active: From:
To:
|
This should be easy enough to do, I think - you should be able to look at
fuser /dev/video0
. If it reports something, then the webcam is on - otherwise it's off. (You might be able to get fancy and check video1 as well.)Microphone might be handy, too, but I don't think you can get there from /dev/ - Google says you need to look at
find /proc/asound -name status -exec grep -v closed {} +
and see if it reports an output or not.Even if it isn't natively built-in, it might be handy as an example script for people who want to write their own scripts?
The text was updated successfully, but these errors were encountered: