-
Notifications
You must be signed in to change notification settings - Fork 4
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
KeyError: Presence #2
Comments
Also my automations with hue does no longer work after I have added the custom component. Even if I remove the sensor and lines in configuration.yaml and restart my hassio it still does not work, I have no idea why. But if I restore my hassio to a snapshot from before the change the automatons start working again. |
Need to see what’s returned by the API. Could you post? I’m wondering if there’s just no presence data in your case. Cheers |
Sorry - I am not really sure how I can find that information. Can you point me in the right direction? Should be able to figure it out with a little pointer. |
Sure, in your browser go to |
Ahhh, thats what you mean...Will post it asap. \kcdc80 |
Ok, I got it now, hope this gives you a clue to why I am getting the
strange issue.
\kcdc80
================= Begin Sensors ================
{
"1": {
"state": {
"daylight": false,
"lastupdated": "2017-11-29T13:29:00"
},
"config": {
"on": true,
"configured": true,
"sunriseoffset": 30,
"sunsetoffset": -30
},
"name": "Daylight",
"type": "Daylight",
"modelid": "PHDL00",
"manufacturername": "Philips",
"swversion": "1.0"
},
"4": {
"state": {
"status": 0,
"lastupdated": "2017-11-29T19:07:48"
},
"config": {
"on": true,
"reachable": true
},
"name": "XFDani[2]sn:state",
"type": "CLIPGenericStatus",
"modelid": "AnimationSensor",
"manufacturername": "xfiredesigns",
"swversion": "1.0",
"uniqueid": "XFDani[2]sn:state",
"recycle": false
},
"5": {
"state": {
"status": 2,
"lastupdated": "2017-11-28T20:14:44"
},
"config": {
"on": true,
"reachable": true
},
"name": "XFDani[2][1]sn:step",
"type": "CLIPGenericStatus",
"modelid": "AnimationSensor",
"manufacturername": "xfiredesigns",
"swversion": "1.0",
"uniqueid": "XFDani[2][1]sn:step",
"recycle": false
},
"6": {
"state": {
"presence": false,
"lastupdated": "none"
},
"config": {
"on": true,
"reachable": true
},
"name": "HomeAway",
"type": "CLIPPresence",
"modelid": "HOMEAWAY",
"manufacturername": "cV31IrxKsn08RIB0gMMrRICYhcDCSwHi",
"swversion": "A_1",
"uniqueid": "L_01_BVb3w",
"recycle": false
},
"8": {
"state": {
"flag": false,
"lastupdated": "none"
},
"config": {
"on": true,
"reachable": true
},
"name": "Go to sleep",
"type": "CLIPGenericFlag",
"modelid": "GOTOSLEEP",
"manufacturername": "cV31IrxKsn08RIB0gMMrRICYhcDCSwHi",
"swversion": "A_01036659",
"uniqueid": "L_05_AYUiS",
"recycle": true
},
"9": {
"state": {
"flag": false,
"lastupdated": "none"
},
"config": {
"on": true,
"reachable": true
},
"name": "Wake up 1",
"type": "CLIPGenericFlag",
"modelid": "WAKEUP",
"manufacturername": "cV31IrxKsn08RIB0gMMrRICYhcDCSwHi",
"swversion": "A_01036659",
"uniqueid": "L_04_o7AJc",
"recycle": false
},
"11": {
"state": {
"status": 0,
"lastupdated": "2017-11-29T21:35:01"
},
"config": {
"on": true,
"reachable": true
},
"name": "Motion Sensor 52 Activity State",
"type": "CLIPGenericStatus",
"modelid": "MotionSensorState",
"manufacturername": "xfiredesigns",
"swversion": "1.0",
"uniqueid": "FC888B06-938B-4850-BF4C-148648AC",
"recycle": false
},
"12": {
"state": {
"status": 0,
"lastupdated": "2017-11-29T21:30:01"
},
"config": {
"on": true,
"reachable": true
},
"name": "XFDani[14]sn:state",
"type": "CLIPGenericStatus",
"modelid": "AnimationSensor",
"manufacturername": "xfiredesigns",
"swversion": "1.0",
"uniqueid": "XFDani[14]sn:state",
"recycle": false
},
"13": {
"state": {
"status": 1,
"lastupdated": "2017-11-28T20:49:14"
},
"config": {
"on": true,
"reachable": true
},
"name": "XFDani[14][1]sn:step",
"type": "CLIPGenericStatus",
"modelid": "AnimationSensor",
"manufacturername": "xfiredesigns",
"swversion": "1.0",
"uniqueid": "XFDani[14][1]sn:step",
"recycle": false
},
"24": {
"state": {
"status": 0,
"lastupdated": "none"
},
"config": {
"on": true,
"reachable": true
},
"name": "Light status",
"type": "CLIPGenericStatus",
"modelid": "Model 2015",
"manufacturername": "all 4 hue",
"swversion": "1.0",
"uniqueid": "PFHS-LIGHT-STATE",
"recycle": false
},
"31": {
"state": {
"status": 0,
"lastupdated": "none"
},
"config": {
"on": true,
"reachable": true
},
"name": "LivR.Presence",
"type": "CLIPGenericStatus",
"modelid": "PHA_STATE",
"manufacturername": "Philips",
"swversion": "1.0",
"uniqueid": "LivR.Presence",
"recycle": false
},
"35": {
"state": {
"status": 0,
"lastupdated": "2017-11-29T09:21:24"
},
"config": {
"on": true,
"reachable": true
},
"name": "Motion Sensor 3 Activity State",
"type": "CLIPGenericStatus",
"modelid": "MotionSensorState",
"manufacturername": "xfiredesigns",
"swversion": "1.0",
"uniqueid": "B5CA6016-5C81-4433-9DB8-7F670530",
"recycle": false
},
"36": {
"state": {
"status": 0,
"lastupdated": "2017-11-29T21:35:01"
},
"config": {
"on": true,
"reachable": true
},
"name": "XFDani[1]sn:state",
"type": "CLIPGenericStatus",
"modelid": "AnimationSensor",
"manufacturername": "xfiredesigns",
"swversion": "1.0",
"uniqueid": "XFDani[1]sn:state",
"recycle": false
},
"37": {
"state": {
"status": 0,
"lastupdated": "none"
},
"config": {
"on": true,
"reachable": true
},
"name": "XFDani[1][1]sn:step",
"type": "CLIPGenericStatus",
"modelid": "AnimationSensor",
"manufacturername": "xfiredesigns",
"swversion": "1.0",
"uniqueid": "XFDani[1][1]sn:step",
"recycle": false
},
"38": {
"state": {
"flag": false,
"lastupdated": "none"
},
"config": {
"on": true,
"reachable": true
},
"name": "Routine.companion",
"type": "CLIPGenericFlag",
"modelid": "PHA_CTRL_START",
"manufacturername": "Philips",
"swversion": "1.0",
"uniqueid": "vgSP6HZCUWXU",
"recycle": true
},
"39": {
"state": {
"buttonevent": 4000,
"lastupdated": "2017-11-29T13:05:34"
},
"swupdate": {
"state": "noupdates",
"lastinstall": null
},
"config": {
"on": true,
"battery": 100,
"reachable": true,
"pending": [
]
},
"name": "Hue dimmer switch",
"type": "ZLLSwitch",
"modelid": "RWL021",
"manufacturername": "Philips",
"swversion": "5.45.1.17846",
"uniqueid": "00:17:88:01:02:0f:f4:85-02-fc00"
},
"45": {
"state": {
"buttonevent": null,
"lastupdated": "none"
},
"swupdate": {
"state": "notupdatable",
"lastinstall": null
},
"config": {
"on": true
},
"name": "Hue tap switch",
"type": "ZGPSwitch",
"modelid": "ZGPSWITCH",
"manufacturername": "Philips",
"uniqueid": "00:00:00:00:00:47:d5:22-f2"
},
"48": {
"state": {
"status": 0,
"lastupdated": "none"
},
"config": {
"on": true,
"reachable": true
},
"name": "XFDHueTap45Btn16State",
"type": "CLIPGenericStatus",
"modelid": "ButtonState",
"manufacturername": "xfiredesigns",
"swversion": "1.0",
"uniqueid": "CBC5FB7E-5AE5-45C1-B3BF-8C3E8793",
"recycle": false
},
"49": {
"state": {
"status": 0,
"lastupdated": "none"
},
"config": {
"on": true,
"reachable": true
},
"name": "XFDHueTap45Btn17State",
"type": "CLIPGenericStatus",
"modelid": "ButtonState",
"manufacturername": "xfiredesigns",
"swversion": "1.0",
"uniqueid": "D4E28746-B750-4D00-9549-2FE8C1A8",
"recycle": false
},
"50": {
"state": {
"status": 0,
"lastupdated": "none"
},
"config": {
"on": true,
"reachable": true
},
"name": "XFDHueTap45Btn18State",
"type": "CLIPGenericStatus",
"modelid": "ButtonState",
"manufacturername": "xfiredesigns",
"swversion": "1.0",
"uniqueid": "DD1627B7-C0EA-47C0-98FE-A2C86B49",
"recycle": false
},
"51": {
"state": {
"temperature": 2235,
"lastupdated": "2017-11-29T21:40:23"
},
"swupdate": {
"state": "noupdates",
"lastinstall": null
},
"config": {
"on": true,
"battery": 100,
"reachable": true,
"alert": "none",
"ledindication": false,
"usertest": false,
"pending": [
]
},
"name": "Hue motion sensor Temp",
"type": "ZLLTemperature",
"modelid": "SML001",
"manufacturername": "Philips",
"swversion": "6.1.0.18912",
"uniqueid": "00:17:88:01:02:02:5d:30-02-0402"
},
"52": {
"state": {
"presence": false,
"lastupdated": "2017-11-29T21:39:26"
},
"swupdate": {
"state": "noupdates",
"lastinstall": null
},
"config": {
"on": true,
"battery": 100,
"reachable": true,
"alert": "none",
"ledindication": false,
"usertest": false,
"sensitivity": 2,
"sensitivitymax": 2,
"pending": [
]
},
"name": "Hue motion sensor",
"type": "ZLLPresence",
"modelid": "SML001",
"manufacturername": "Philips",
"swversion": "6.1.0.18912",
"uniqueid": "00:17:88:01:02:02:5d:30-02-0406"
},
"53": {
"state": {
"lightlevel": 6551,
"dark": false,
"daylight": false,
"lastupdated": "2017-11-29T21:36:50"
},
"swupdate": {
"state": "noupdates",
"lastinstall": null
},
"config": {
"on": true,
"battery": 100,
"reachable": true,
"alert": "none",
"tholddark": 4082,
"tholdoffset": 7000,
"ledindication": false,
"usertest": false,
"pending": [
]
},
"name": "Hue motion sensor Light",
"type": "ZLLLightLevel",
"modelid": "SML001",
"manufacturername": "Philips",
"swversion": "6.1.0.18912",
"uniqueid": "00:17:88:01:02:02:5d:30-02-0400"
},
"61": {
"state": {
"status": 0,
"lastupdated": "none"
},
"config": {
"on": true,
"reachable": true
},
"name": "Motion Sensor 52 Activity State",
"type": "CLIPGenericStatus",
"modelid": "MotionSensorState",
"manufacturername": "xfiredesigns",
"swversion": "1.0",
"uniqueid": "B41E47FE-7291-4E10-B6F7-47EDCC85",
"recycle": false
}
}
================= End Sensors ================
…On Tue, Nov 28, 2017 at 6:03 AM, Robin ***@***.***> wrote:
Sure, in your browser go to http://<bridge ip address>/api/<username>/
sensors as per the instructions here
<https://www.hackster.io/robin-cole/hijack-a-hue-remote-to-control-anything-with-home-assistant-5239a4>,
and save the results to a text file.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADBWsdlryevCLyoeLeYlF7qHrD86pjI4ks5s65QxgaJpZM4Qk-OT>
.
--
Kim Christensen
|
OK so the issue is that you SML data is not in the format that hue_sensors expects. For example, hue_sensors searches the 'name' field for 'ambient light' to determine the lightlevel, but your API data has the name 'Hue motion sensor Light'. I'm guessing that either you renamed the 'name' or this is the result of a firmware update. Either way hue_sensors should try, except to allow for the case when data is incomplete or in an unknown format, so I will create an issue for that. In the meantime you could try resetting the SML to default settings to return the 'name' field to default. |
Currently for this user the API is returning:
So it is safer to get the sensor type from "type" than "name" as name can be edited by the user but type cannot. |
This is moved to #4 |
I keep getting this error when trying to setup hue with the custom component
[homeassistant.components.sensor] Error while setting up platform hue
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py”, line 170, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 352, in wait_for
return fut.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 244, in result
raise self._exception
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/sensor/hue.py”, line 27, in setup_platform
data.update()
File “/usr/lib/python3.6/site-packages/homeassistant/util/init.py”, line 306, in wrapper
result = method(*args, **kwargs)
File “/config/custom_components/sensor/hue.py”, line 51, in update
self.data = self.parse_hue_api_response(response.json())
File “/config/deps/lib/python3.6/site-packages/hue_sensors.py”, line 52, in parse_hue_api_response
data_dict[_key] = parse_sml(sensor)
File “/config/deps/lib/python3.6/site-packages/hue_sensors.py”, line 81, in parse_sml
hue_state = response[‘state’][‘presence’]
KeyError: ‘presence’
I hope this is the info you need. If you need something else just let me know.
The text was updated successfully, but these errors were encountered: