A Menubar Indicator for macOS Camera Usage

Blake Bradford Avatar

·

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:

  1. Go to http://futurehome-smarthub.local:8081/fimp/timeline.
  2. Set the Service filter to out_bin_switch.
  3. 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.
  4. Note the actual message format, for example:

{
"serv": "out_bin_switch",
"type": "cmd.binary.set",
"val_t": "bool",
"val": true,
"props": null,
"tags": null
}

  1. 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 to true or false. Please note that MQTT version 5 is not supported; use version 3 instead.

Building the App

To build the OnAir app, follow these steps:

  1. Install the required dependencies by running pip3 install -r requirements.txt.
  2. Run ./setup.py py2app.
  3. 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

Your email address will not be published. Required fields are marked *