{"id":270,"date":"2018-11-30T17:08:50","date_gmt":"2018-11-30T16:08:50","guid":{"rendered":"http:\/\/wp.bizoir.dk\/?p=270"},"modified":"2018-12-23T11:04:42","modified_gmt":"2018-12-23T10:04:42","slug":"add-hue-lights-by-serial-no","status":"publish","type":"post","link":"https:\/\/wp.bizoir.dk\/?p=270","title":{"rendered":"Add Hue lights by serial no"},"content":{"rendered":"<p>It can be a pain to add new devices to Philips Hue &#8211; it takes quite some time and sometimes, it does not seem to want to work &#8211; even with &#8220;touchlink&#8221;.<\/p>\n<p>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?.<\/p>\n<p><a href=\"https:\/\/www.reddit.com\/r\/Hue\/comments\/726izq\/any_way_to_get_the_build_serials_without\/\">This<\/a> Reddit page suggest you can add lights using the Hue API by sending<\/p>\n<p><i>{&#8220;deviceid&#8221;:[&#8220;SN&#8221;,&#8221;SN&#8221;,&#8221;SN&#8221;,&#8221;SN&#8221;,&#8221;SN&#8221;,&#8221;SN&#8221;,&#8221;SN&#8221;,&#8221;SN&#8221;,&#8221;SN&#8221;,&#8221;SN&#8221;]}<\/i><\/p>\n<p>with most likely PUT (but it may be POST)<\/p>\n<p>it is not clear, which object the json should be PUT to<\/p>\n<hr \/>\n<p><a href=\"https:\/\/www.drashsmith.com\/post\/running-philips-hue-lights-locally\/\">This<\/a> page says that you can POST this Json<br \/>\n<i>{&#8220;deviceid&#8221;: &#8220;light_id&#8221;}<br \/>\n(&#8230;where light_id is the serial number printed on the side of the Hue bulb.) to this object<br \/>\n\/api\/[hash]\/lights<\/i><\/p>\n<hr \/>\n<p><a href=\"https:\/\/www.drashsmith.com\/post\/running-philips-hue-lights-locally\/\">drashsmith.com<\/a><\/p>\n<hr \/>\n<p>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.<br \/>\nPUT was also not accessible on the &#8220;lights&#8221; object, but when trying to POST &#8220;{&#8220;deviceid&#8221;:[&#8220;SN1&#8243;,&#8221;SN2&#8243;]}&#8221; to the lights object (http:\/\/[ip-address]\/api\/[username]\/lights), I got this reply<\/p>\n<p><i>[<br \/>\n{<br \/>\n&#8220;error&#8221;: {<br \/>\n&#8220;type&#8221;: 7,<br \/>\n&#8220;address&#8221;: &#8220;\/lights\/deviceid&#8221;,<br \/>\n&#8220;description&#8221;: &#8220;invalid value, SN1, for parameter, deviceid&#8221;<br \/>\n}<br \/>\n}<br \/>\n]<\/i><\/p>\n<p>which seems to suggest, that the serials for new devices should be POST&#8217;ed to the &#8220;lights&#8221; object. When I try to post the same Json to the &#8220;sensors&#8221; object, I get the same error, but I am not sure, that you can use the same method for the &#8220;sensors&#8221; object &#8211; I cannot seem to find serials on my sensors.<\/p>\n<p>Happy hunting.<\/p>\n<p>[srs_total_visitors]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It can be a pain to add new devices to Philips Hue &#8211; it takes quite some time and sometimes, it does not seem to want to work &#8211; even with &#8220;touchlink&#8221;. Anyhow, it is always nice to have an alternative, and in the Hue app, you can also add devices by serial-number. But how &hellip; <a href=\"https:\/\/wp.bizoir.dk\/?p=270\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Add Hue lights by serial no&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[26],"class_list":["post-270","post","type-post","status-publish","format-standard","hentry","category-hardware","tag-philips-hue"],"_links":{"self":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts\/270","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=270"}],"version-history":[{"count":9,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts\/270\/revisions"}],"predecessor-version":[{"id":336,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts\/270\/revisions\/336"}],"wp:attachment":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}