Closed uditaghosh closed 8 years ago
You can change the state of your lights as you would with a normal bridge, by sending an HTTP Put. This is documented in the developers meethue website at the below URL (registration is required though). http://www.developers.meethue.com/documentation/lights-api#16_set_light_state
I didn't understand your last sentence, maybe providing an example of what you tried would help.
thank you for replying. there is an option under 'file' called 'save config' by which i saved the present configuration, like 2 bulbs on and 1 off with other info, as json file. However when i created another json file with a new configuration, like 1 bulb on and 2 off, and tried to load('Load config'), it is not happenning. can you help?
i figured out the 'Load config' and 'Save config'. however i cant send the HTTP Put. can you please mention the steps or upload a video?
Hi,
I suggest you watch some tutorials on sending HTTP requests. There is nothing specific to the emulator here.
There are many free HTTP clients out there, so just find one you like. Personally I use the free 'Poster' plugin for Firefox.
So for example to turn off the first light in the emulator (light id 1), you can run the emulator (using the default 8000 port if you like).
Open up the Firefox Poster plugin (or other HTTP client). For the URL you can use:
http://localhost:8000/api/newdeveloper/lights/1/state
(or use 127.0.0.1 if localhost is not configured in your hosts file).
and in the body (or Content to Send) use the JSON: {"on": false} And click the 'PUT' button, and voila!
To change the colour you turn it back on (using "on": true) and send a hue/xy value. eg. {"hue": 40000}
In the URL I sent you before, this details most of the commands you can use. Note however, the Emulator is developed up to 1.3 of the Hue API, so some of the later features won't work (e.g. multi-source luminaires).
Steve
hi, it worked!! thanks a lot!!
Great!. I will close the issue in github.
how can we change the state of the lights? when we save the json file the present state is can be deciphered but json file I want to load to change these states can't be done.