OnAir: A Menubar Indicator for macOS Camera Usage
Are you concerned about your privacy when using your macOS camera? OnAir is here to help. OnAir is a menubar indicator that visually indicates the status of your camera, letting you know when it’s in use. In addition to its camera usage indicator, OnAir also allows you to control a light bulb through a Futurehome MQTT message. This article will guide you through the setup and usage of OnAir, ensuring a seamless integration with your macOS system.
Configuration
To start using OnAir, you need to configure the MQTT settings. The configuration file, ~/.onair.ini
, will be automatically created on the first run. Here’s an example configuration:
[DEFAULT]
user=myuser
password=mypass
host=futurehome-smarthub.local
port=1884
topic=pt:j1/mt:cmd/rt:dev/rn:zw/ad:1/sv:out_bin_switch/ad:19_0
debug=False
You can find the detailed instructions for setting up the MQTT user and password on the Futurehome support page: link.
Futurehome and MQTT Testing
To test the integration of OnAir with your Futurehome system using MQTT, you can follow these steps:
- Go to http://futurehome-smarthub.local:8081/fimp/timeline.
- Set the Service filter to
out_bin_switch
. - Turn off and on your desired light to discover the corresponding topic, e.g.,
pt:j1/mt:cmd/rt:dev/rn:zw/ad:1/sv:out_bin_switch/ad:19_0
. - Note the actual message format, for example:
{
"serv": "out_bin_switch",
"type": "cmd.binary.set",
"val_t": "bool",
"val": true,
"props": null,
"tags": null
}
- You can use a MQTT client like mqtt-cli or MQTT Explorer to send a message to turn the light on or off. Set the
val
field totrue
orfalse
. Please note that MQTT version 5 is not supported; use version 3 instead.
Building the App
To build the OnAir app, follow these steps:
- Install the required dependencies by running
pip3 install -r requirements.txt
. - Run
./setup.py py2app
. - This will create the OnAir.app in the
dist/
directory.
Acknowledgements
OnAir wouldn’t be possible without the contributions from the following projects:
Now that you have a clear understanding of OnAir, its configuration, MQTT testing, and app-building process, you can start using this handy menubar indicator to keep track of your macOS camera usage and control your Futurehome light bulb. Enjoy the peace of mind knowing your privacy is protected with OnAir!
Source: OnAir GitHub Repository
Leave a Reply