Philips hue automations have one large disadvantage - if the light isn't reachable when the automation is supposed to run, it never does. This app checks every time a light is reachable again, if it corresponds to a scene and sets this scene. Open an issue if you find anything missing :)
What's even better is, that you can keep using your physical switches without replacing them!
Currently, the only way to install this app is to clone this repository and build it on the platform of your choice. Pre-compiled binaries are planned, but not prioritized since platforms may vary heavily.
- Download the rust compiler.
- Clone this repo via
git clone https://github.com/simonwep/hue-scheduler
. - Copy
.env.example
to.env
and fill out missing values. - Run
cargo build --release
. - You can now execute
/target/release/hue-scheduler
as you want, a service is recommended. Make sure to specify the working directory where your.env
lies.
Tip
After installation and setup (e.g. the app is running) nothing needs to be done anymore.
Anything else is configured in your Philips Hue app!
You will probably want to run this as a service in the background, for this you could use .service
file like this (assuming you downloaded and compiled the source under /home/ubuntu/hue-scheduler
):
[Unit]
Description=Philips hue automation
After=network.target
[Service]
ExecStart=/home/ubuntu/hue-scheduler/target/release/hue-scheduler
WorkingDirectory=/home/ubuntu/hue-scheduler
User=ubuntu
Restart=always
[Install]
WantedBy=multi-user.target
You can then start the service via:
sudo systemctl enable hue-scheduler
And to make it automatically start on reboot:
sudo systemctl enable hue-scheduler
When which scene should be turned on is solely specified by the name of your scenes.
The format is as follows: {name of your scene} ({timestamp}-{timestamp}, ...)
, where {timestamp}
can be:
- In the 24h format:
12h
,13:45h
,0h
,9:20h
- In the 12h format:
3AM
,8PM
,11PM
- A variable:
sunrise
,sunset
(depending onHOME_LATITUDE
andHOME_LONGITUDE
in your.env
)
Example scene names with time-frames:
- Natural light (8AM-10:30h, 17h-sunset) - The "Natural light" scene should be turned on from 8:00 AM to 10:30 AM and from 5:00 PM until sunset.
- Night light (sunset-11PM) - The "Night light" scene should be turned on from sunset until 11:00 PM.
- Wake up (sunrise-8:30h) - The "Wake up" scene should be turned on from sunrise until 8:30 AM.
- Work (8:30h-17h) - The "Work" scene should be turned on from 8:30 AM until 5:00 PM.
- Sleep (11PM-8AM) - The "Sleep" scene should be turned on from 11:00 PM until 8:00 AM.
Some lights may always be reachable and should be turned on when a scene is activated due to another light that is controlled by a physical switch.
To mark a light to be turned on/off as well whenever the corresponding scene is activated/deactivated, prepend a (att)
for "attached" to the lights name.
Now, if you flip the physical switch and the light is turned off the lights that are always "on" (connected to a power source) will be turned off as well. Since it takes some time for the hue bridge to recognize no longer reachable lights this may take up to a minute. Still better than doing it manually ;)
This is how it will usually look like in the app.
A scene will be picked up and turned on if all corresponding lights became (e.g. were not) reachable again.
The timeframe for that (and much more) can be configured in the .env
file.