bahamas10 / hueadm

A command line management interface to Philips hue
206 stars 13 forks source link

Flash Lights indefinitely? #10

Open thehauntedmattress opened 5 years ago

thehauntedmattress commented 5 years ago

Is there a way to flash the lights indefinitely or for a set period of time? Kind of like using the lselect command (but I need it longer than 15 seconds)? Thanks.

thehauntedmattress commented 3 years ago

Hey @bahamas10, I noticed that I posted this almost two years ago. I redownloaded hueadm again and found a purpose for it. But I wanted to re-open my question above. Is there a way to make the "lselect" command flash the lights longer than 15 seconds? Is there a value in one of the files of the code that I can edit to change that? Thanks.

DaveTSG commented 3 years ago

You could create a BASH script that runs it three times, and then run that script via cron every minute...:

nano ~/myscript.sh

#!/bin/bash
hueadm light 69 select
sleep 15
hueadm light 69 select
sleep 15
hueadm light 69 select

chmod +x ~/myscript.sh
crontab -e

* * * * * ~/myscript.sh
(Save and exit)

That would at least satisfy your "indefinitely" requirement in the OP... Run it on a $10 RPi Zero headless, then just turn the Pi off/on when you want the lights flashing... (actually, better yet would be to run it on a proper RPi with an Ethernet port, and then just plug in/unplug the ethernet cable, that way you're not power-cycling the Pi without allowing it to safely shut down...)

thehauntedmattress commented 2 years ago

@DaveTSG I just saw your response even though it was a year ago. Adding the sleep 15 and then two && in my command actually makes this work! Thanks!