hassio-onair
v0.1.1
Published
A script to trigger a sensor in you homeassistant when your webcam becomes in use.
Downloads
6
Readme
HASSIO OnAir
A script to trigger a sensor in you homeassistant when your webcam becomes in use.
Installation instructions
- You have to buy a third party app in order to identify if your webcam is in use. There is other free applications that do a similar thing, but I've had the most consistent luck with https://obdev.at/microsnitch
- Install hassio-onair
npm install hassio-onair -g
- Make sure you're using a version of node that's 12 or greater, check with
node --version
. There's a problem with earlier versions of node where it won't pick up on file changes correctly.
Testing it works
- Create a long lived access token from the profile settings in home assistant.
- Run the script with
onair -h <HOME_ASSISTANT_URL> -k <LONG_LIVED_ACCESS_TOKEN>
- Have micro snitch running
- Open photobooth
- Check that the
sensor.on_air
entity is updated in home assistant
Creating a shortcut to make it easier to start
- Create an automater script to make it easier to start up
- Open Automator
- File -> New
- Type: Application
- Add action: Run Shell Script
- Use the following command
onair -h <HOME_ASSISTANT_URL> -k <LONG_LIVED_ACCESS_TOKEN> >/dev/null 2>&1 &
- Save
- Start from applications folder (the app icon will immediately disappear, this is because the script runs in the brackground)