Hi all,
Very new to all of this so bear with me.
Below is my script, ive commented out a few colors.
What i am trying to do is the following;
A second script reads motion from a sensor. Wich triggers the script below.
Wich atm will turn my hue light strip on at full white. Great!
But say if i want the color to change to full red (just for example purposes) if the time is between 24:00 and 02:00
How would i go about achieving this?
The goal here is to have the light gradually change to a darker white during the time of day.
Just using theese colors to test.
Very new to all of this so bear with me.
Below is my script, ive commented out a few colors.
What i am trying to do is the following;
A second script reads motion from a sensor. Wich triggers the script below.
Wich atm will turn my hue light strip on at full white. Great!
But say if i want the color to change to full red (just for example purposes) if the time is between 24:00 and 02:00
How would i go about achieving this?
The goal here is to have the light gradually change to a darker white during the time of day.
Just using theese colors to test.
import requests import time time.sleep(0.1) headers = { 'Accept': 'application/json', } # White data = '{"on":true,"bri":255,"sat":0,"hue":0}' # Blue #data = '{"on":true,"bri":255,"sat":255,"hue":46920}' # Red #data = '{"on":true,"bri":255,"sat":255,"hue":0}' # Yellow #data = '{"on":true,"bri":255,"sat":255,"hue":12750}' requests.put('http://192.168.1.47/api/xxxxxxxxxxxxxxxxxxx/lights/2/state', headers=headers, data=data)