Open henri opened 6 years ago
hm, that's interesting. Unfortunately there is no debug/verbose options for this step... you can however run it manually:
$ echo '{"devicetype":"hueadm#username"}' | curl -d@- -X POST http://10.0.1.80/api
(substitute username
for the username you want, and 10.0.1.80
with the IP of your bridge)
You should get an error message (type 101) saying "link button not pressed". Once you get that, press the button, wait a second or two, and then run the curl command again (same exact command) and it should return a randomly generated string for you to use.
I did manage to get a key for the Philips Hue bridge. Also, I put together the following script which may be of interest to people using the hue motion sensors : https://gist.github.com/henri/fd7e367d853a3970bdf6c077cf7765da
It may even be possible to monitor lights (for sure) and even switches (not sure). I ended up creating another script which reads this scripts output and that can send push notifications when certain motion events take place and other criteria such as time of day / device presses and more are meet.
I will revisit the registration thing and maybe add an option in the script so that it uses the users saved details rather than including them in the file / separate config file.
I can confirm it seems possible to pull the data from the switches so this could be added to the script as could the status changes of lights.
I am having some difficulty with registering with the bridge. Is there a way to setup more verbose interaction during this process or perhaps to manually make a request which you are able to suggest?