Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kuuhhl/homebridgetoggle
script to automatically toggle lights when you leave home
https://github.com/kuuhhl/homebridgetoggle
automation homebridge iot python
Last synced: 7 days ago
JSON representation
script to automatically toggle lights when you leave home
- Host: GitHub
- URL: https://github.com/kuuhhl/homebridgetoggle
- Owner: Kuuhhl
- License: gpl-2.0
- Created: 2024-01-26T12:00:43.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-13T12:46:31.000Z (8 months ago)
- Last Synced: 2024-10-17T02:20:22.617Z (22 days ago)
- Topics: automation, homebridge, iot, python
- Language: Python
- Homepage:
- Size: 214 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
homebridgeToggle
Gone? So are the lights.
This script interacts with the Homebridge API to toggle your lights based on whether your phone is at home or not. Your lights must be connected to Homebridge for this to function.
## How does it work?
The script operates by continuously checking a Dropbox file and switches the lights on or off based on your home status. Using iOS shortcuts, you can set up an automation to add a '0' to the text file when you leave home, and a '1' when you return home.
## How to use?
1. Create a text file on Dropbox and generate a publicly accessible link.
2. Configure iOS shortcuts to append `0` when your phone leaves your house and `1` when it arrives.
3. Install `python3` and the `requests`-module.
4. Clone the project repository to your local machine.
5. Define the required environment variables in `/etc/environment` and in the `config.py` file.
6. Add the script to a cronjob to ensure it executes on boot. You can do this using the `crontab -e` command.**Note:** You will need to supply a list of unique light IDs. These can be found by running the script with the `--list` or `-L` flag.
## Environment Variables
* `HOMEBRIDGE_BASE_URL`: Your Homebridge server's base URL.
* `LOCATION_SYNC_FILE_URL`: The URL of the Dropbox file that the script will check.
* `HOMEBRIDGE_USERNAME`: Your Homebridge username.
* `HOMEBRIDGE_PASSWORD`: Your Homebridge password.