Add Hue lights by serial no

It can be a pain to add new devices to Philips Hue – it takes quite some time and sometimes, it does not seem to want to work – even with “touchlink”.

Anyhow, it is always nice to have an alternative, and in the Hue app, you can also add devices by serial-number. But how does this work with the Hue API?.

This Reddit page suggest you can add lights using the Hue API by sending


with most likely PUT (but it may be POST)

it is not clear, which object the json should be PUT to

This page says that you can POST this Json
{“deviceid”: “light_id”}
(…where light_id is the serial number printed on the side of the Hue bulb.) to this object

After a little trial-and-error, I get an error if I try to either PUT or POST on the root object (ie http://[ip-address]/api/[username]) saying that neither PUT nor POST were accessible on this object.
PUT was also not accessible on the “lights” object, but when trying to POST “{“deviceid”:[“SN1″,”SN2″]}” to the lights object (http://[ip-address]/api/[username]/lights), I got this reply

“error”: {
“type”: 7,
“address”: “/lights/deviceid”,
“description”: “invalid value, SN1, for parameter, deviceid”

which seems to suggest, that the serials for new devices should be POST’ed to the “lights” object. When I try to post the same Json to the “sensors” object, I get the same error, but I am not sure, that you can use the same method for the “sensors” object – I cannot seem to find serials on my sensors.

Happy hunting.