Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any support for HUE sensors using API ? #91

Open
gibman opened this issue Nov 2, 2017 · 2 comments
Open

Any support for HUE sensors using API ? #91

gibman opened this issue Nov 2, 2017 · 2 comments

Comments

@gibman
Copy link

gibman commented Nov 2, 2017

I have a temp. humid sensor attached to the arduino.
It would be cool to see the readouts using HUE.

Example call:

all : /api//sensors
or one specific : /api//sensors/

JSON =>

{
"5":{
"state":{
"temperature":1796,
"lastupdated":"2016-10-15T12:10:46"
},
"config":{
"on":true,
"battery":100,
"reachable":true,
"alert":"none",
"ledindication":false,
"usertest":false,
"pending":[

     ]
  },
  "name":"Hue temperature sensor 1",
  "type":"ZLLTemperature",
  "modelid":"SML001",
  "manufacturername":"Philips",
  "swversion":"6.1.0.18912",
  "uniqueid":"##:##:##:##:##:##:##:##-##-####"

},
"6":{
"state":{
"presence":false,
"lastupdated":"2016-10-15T12:05:35"
},
"config":{
"on":true,
"battery":100,
"reachable":true,
"alert":"none",
"ledindication":false,
"usertest":false,
"sensitivity":2,
"sensitivitymax":2,
"pending":[

     ]
  },
  "name":"Landing MS",
  "type":"ZLLPresence",
  "modelid":"SML001",
  "manufacturername":"Philips",
  "swversion":"6.1.0.18912",
  "uniqueid":"##:##:##:##:##:##:##:##-##-####"

},
"7":{
"state":{
"lightlevel":15351,
"dark":false,
"daylight":true,
"lastupdated":"2016-10-15T12:15:09"
},
"config":{
"on":true,
"battery":100,
"reachable":true,
"alert":"none",
"tholddark":2054,
"tholdoffset":7000,
"ledindication":false,
"usertest":false,
"pending":[

     ]
  },
  "name":"Hue ambient light sensor 1",
  "type":"ZLLLightLevel",
  "modelid":"SML001",
  "manufacturername":"Philips",
  "swversion":"6.1.0.18912",
  "uniqueid":"##:##:##:##:##:##:##:##-##-####"

},
"8":{
"state":{
"status":0,
"lastupdated":"2016-10-15T12:05:35"
},
"config":{
"on":true,
"reachable":true
},
"name":"MotionSensor 6.Companion",
"type":"CLIPGenericStatus",
"modelid":"PHA_STATE",
"manufacturername":"Philips",
"swversion":"1.0",
"uniqueid":"MotionSensor 6.Companion",
"recycle":true
}
}

Is support for this planned ?

regards
gibman

@probonopd
Copy link
Owner

I am not working on it but I'd be happy to merge Pull Requests that implement it.

@gibman
Copy link
Author

gibman commented Nov 2, 2017

thanks!!

I already started working on it.

Although I am unable to see the sensors within the android HUE app.
There is a section called "accessory setup" in the app where I can add stuff like hue tap switch, hue dimmer switch and hue motion sensor. All these requires me to press the button on the physical accessory - which ofcourse is a bit hard being it is an emulator hehe.

I have no idea how to have the sensors added to the HUE app.
The access. setup menu might not be the way.

Ive listed the various HTTP GET Requests along with the corresponding JSON response.
If anyone could review. obviously something is wrong.

http://192.168.1.144:80/api/A020A6FFFE21065E/
=>
{"groups":{"1":{"name":"Living room","lights":["1","2"]}},"scenes":{},"config":{"name":"hue emulator","swversion":"81012917","bridgeid":"A020A6FFFE21065E","portalservices":false,"linkbutton":true,"mac":"A0:20:A6:21:06:5E","dhcp":true,"ipaddress":"192.168.1.144","netmask":"255.255.255.0","gateway":"192.168.1.1","apiversion":"1.3.0","localtime":"2017-11-02T19:48:48","timezone":"Europe/London","whitelist":{"api":{"name":"clientname#devicename"}},"swupdate":{"text":"","notify":false,"updatestate":0,"url":""}},"lights":{"1":{"type":"Extended color light","manufacturername":"OpenSource","swversion":"0.1","name":"Hue LightStrips 1","uniqueid":"A0:20:A6:21:06:5E-1","modelid":"LST001","state":{"on":false,"bri":0,"xy":[0.00000,0.00000],"colormode":"hs","effect":"none","ct":500,"hue":0,"sat":0,"alert":"none","reachable":true}},"2":{"type":"Extended color light","manufacturername":"OpenSource","swversion":"0.1","name":"Hue LightStrips 2","uniqueid":"A0:20:A6:21:06:5E-2","modelid":"LST001","state":{"on":false,"bri":0,"xy":[0.00000,0.00000],"colormode":"hs","effect":"none","ct":500,"hue":0,"sat":0,"alert":"none","reachable":true}}},"schedules":{},"sensors":{"1":{"manufacturername":"OpenSource","name":"Hue Sensor 1","swversion":"0.1","type":"ZLLTemperature","uniqueid":"1","modelid":"LST001","state":{"temperature":1,"humidity":2,"light":3,"lastupdated":"2016-10-15T12:10:46"},"config":{"on":true,"alert":"none","reachable":true,"ledindication":true,"usertest":true,"battery":100,"pending":{}}},"2":{"manufacturername":"OpenSource","name":"Hue Sensor 2","swversion":"0.1","type":"ZLLTemperature","uniqueid":"2","modelid":"LST001","state":{"temperature":0,"humidity":0,"light":0,"lastupdated":"2016-10-15T12:10:46"},"config":{"on":true,"alert":"none","reachable":true,"ledindication":true,"usertest":true,"battery":100,"pending":{}}}},"rules":{}}

http://192.168.1.144:80/api/A020A6FFFE21065E/sensors
=>
{"1":{"manufacturername":"OpenSource","name":"Hue Sensor 1","swversion":"0.1","type":"ZLLTemperature","uniqueid":"1","modelid":"LST001","state":{"temperature":1,"humidity":2,"light":3,"lastupdated":"2016-10-15T12:10:46"},"config":{"on":true,"alert":"none","reachable":true,"ledindication":true,"usertest":true,"battery":100,"pending":{}}},"2":{"manufacturername":"OpenSource","name":"Hue Sensor 2","swversion":"0.1","type":"ZLLTemperature","uniqueid":"2","modelid":"LST001","state":{"temperature":0,"humidity":0,"light":0,"lastupdated":"2016-10-15T12:10:46"},"config":{"on":true,"alert":"none","reachable":true,"ledindication":true,"usertest":true,"battery":100,"pending":{}}}}

http://192.168.1.144:80/api/A020A6FFFE21065E/sensors/1
=>
{"manufacturername":"OpenSource","name":"Hue Sensor 1","swversion":"0.1","type":"ZLLTemperature","uniqueid":"1","modelid":"LST001","state":{"temperature":1,"humidity":2,"light":3,"lastupdated":"2016-10-15T12:10:46"},"config":{"on":true,"alert":"none","reachable":true,"ledindication":true,"usertest":true,"battery":100,"pending":{}}}

You can use : https://jsonformatter.curiousconcept.com
in order to have more readable JSON output.

regards
gibman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants