kane610 / deconz Goto Github PK
View Code? Open in Web Editor NEWPython library wrapping deconz rest api for home-assistant
License: MIT License
Python library wrapping deconz rest api for home-assistant
License: MIT License
I have 13 IKEA fyrtur blinds, in different sizes. All have been upgraded to 2.2.009 firmware.
I can only ready battery status from half of them. I can seem to find any pattern on which works and which dont
I have tried pretty much everything within VNC, and the settings. So im not sure if its deCONZ or ikea software that are failing here. I can see lot of other issues have been reporterd regarding the Fyrtur battery, but none are simular to my issue, where some works and others dont.
Hi!
Recently an HA update has broken quiet a few USB device integrations. All the devices brought in via my Conbee II through your integration are now "unavailable". However, the integration itself still see's all the devices and will update as needed if the integration or removed, or if a new device is added. See error log below:
I'm quiet dependent on this integration as all of the lights/sensors in my home are controlled via HA or Google Home. I can still control the lights via Phoscons, though.
Logger: pydeconz.websocket
Source: /usr/local/lib/python3.8/site-packages/pydeconz/websocket.py:92
First occurred: 11:01:36 AM (136 occurrences)
Last logged: 11:35:21 AM
Unexpected error [Errno 104] Connection reset by peer
Should be nice if the Ikea Shortcut Button supported with triggers within Home Assistent.
See also my issue at deconz-rest-plugin git repo; dresden-elektronik/deconz-rest-plugin#4985
The Ikea Shortcut Button only contains one button. Next of that support of the battery level should be a nice add-on.
20:24:58:226 [INFO] - Button 1002 - TRADFRI SHORTCUT Button, broadcast to: 0x0015, endpoint: 0x01, cluster: ONOFF (0x0006), action: On, payload: None, zclSeq: 3
20:24:58:227 enqueue event state/buttonevent for /sensors/47
20:24:58:228 enqueue event state/lastupdated for /sensors/47
20:24:58:228 binding for attribute reporting of ep: 0x01 cluster 0x0001 seems to be active
20:24:58:229 Force binding of attribute reporting for sensor TRADFRI SHORTCUT Button
20:24:58:233 0x680AE2FFFE1473A9 [TRADFRI SHORTCUT Button] create binding for client cluster 0x0006 on endpoint 0x01
20:24:58:234 queue binding task for 0x680AE2FFFE1473A9, cluster 0x0006
08:56:46:913 enqueue event event/validgroup for /sensors/50
08:56:46:914 [INFO] - Button 1002 - TRADFRI SHORTCUT Button, broadcast to: 0x0018, endpoint: 0x01, cluster: ONOFF (0x0006), action: On, payload: None, zclSeq: 28
08:56:46:915 enqueue event state/buttonevent for /sensors/50
08:56:46:916 enqueue event state/lastupdated for /sensors/50
08:56:46:916 0x680AE2FFFE34CF23 (TRADFRI SHORTCUT Button) create binding for attribute reporting of cluster 0x0001 on endpoint 0x01
08:56:46:917 queue binding task for 0x680AE2FFFE34CF23, cluster 0x0001
08:56:46:918 Force binding of attribute reporting for sensor TRADFRI SHORTCUT Button
08:56:46:921 Websocket 172.19.0.3:48226 send message: {"e":"changed","id":"50","r":"sensors","state":{"buttonevent":1002,"lastupdated":"2021-06-08T06:56:46.916"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"} (ret = 165)
08:56:46:922 Websocket 172.19.0.3:43012 send message: {"e":"changed","id":"50","r":"sensors","state":{"buttonevent":1002,"lastupdated":"2021-06-08T06:56:46.916"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"} (ret = 165)
08:56:46:925 discard sensor state push for 50: state/lastupdated (already pushed)
08:56:47:249 enqueue event config/localtime for /config/
Thank you very much for your help! 😄
Right now the switches (like the Osram Smart Plug) are exposed to Hass as bulbs, is this something that can be changed?
I understand they are listed under lights in DeCONZ, but they have a different icon (so DeCONZ knows they are not lights) and it's particularly annoying to have them together with the lights in Hass.
Please have a look at this issue:
dresden-elektronik/deconz-rest-plugin#565
The heiman alarm is a light in home assistant so it does not work.
When you turn it on it flips back to off and no light or sirene is on.
Hopefully you can fix this. If you need any help let me know.
Possible implementations:
true
to state 'on' and flag false
to state 'off'PUT /sensors/#/state {"flag": true}
PUT /sensors/#/state {"flag": false}
I would prefer the second one.
Hi,
I have a fyrtur blind in deconz. It works fine, except whenever it's not 100% open the state reads as closed. I think it should be the other way around i.e the state should be open if the blind is not 100% closed.
Certainly that's how this card https://github.com/thomasloven/lovelace-slider-entity-row expects it to be.
I'm using home assistant 0.100.1 and deconz 2.05.69.
thanks
Thanks for your work with adding deconz support to HA!
I noticed that deconz now reports temperature from the xiaomi aqara door/window sensors. Would it be possible to bring this data into home assistant?
json from the deconz
https://pastebin.com/Ac7vkp1j
As discussed over Discord already,
the HA component does not cope with Unknown sensor types, in this case the Philips Hue Tap switch.
A catch_all mechanism would be nice to cope with unknown sensors/lights/etc.
In this case, my priority is off course the Philips Hue Tap switch :)
Error messages during deCONZ component init:
2018-01-04 15:26:34 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform deconz
Traceback (most recent call last):
File "/usr/src/app/homeassistant/helpers/entity_component.py", line 171, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/local/lib/python3.6/asyncio/futures.py", line 243, in result
raise self._exception
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 212, in coro
res = func(*args, **kw)
File "/usr/src/app/homeassistant/components/sensor/deconz.py", line 34, in async_setup_platform
if sensor.type in DECONZ_SENSOR:
AttributeError: 'NoneType' object has no attribute 'type'
2018-01-04 15:26:34 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform deconz
Traceback (most recent call last):
File "/usr/src/app/homeassistant/helpers/entity_component.py", line 171, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/local/lib/python3.6/asyncio/futures.py", line 243, in result
raise self._exception
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 212, in coro
res = func(*args, **kw)
File "/usr/src/app/homeassistant/components/binary_sensor/deconz.py", line 29, in async_setup_platform
if sensor.type in DECONZ_BINARY_SENSOR:
AttributeError: 'NoneType' object has no attribute 'type'
And when tapping the TAP switch:
2018-01-04 15:28:52 DEBUG (MainThread) [pydeconz.websocket] Websocket data: b'\x81r{"e":"changed","id":"25","r":"sensors","state":{"buttonevent":34,"lastupdated":"2018-01-04T14:28:52"},"t":"event"}'
2018-01-04 15:28:52 ERROR (MainThread) [asyncio] Unhandled error in exception handler
context: {'exception': AttributeError("'NoneType' object has no attribute 'async_update'",)}
Traceback (most recent call last):
File "uvloop/handles/stream.pyx", line 784, in uvloop.loop.__uv_stream_on_read_impl
File "uvloop/handles/stream.pyx", line 563, in uvloop.loop.UVStream._on_read
File "/usr/local/lib/python3.6/site-packages/pydeconz/websocket.py", line 97, in data_received
self.async_callback(payload)
File "/usr/local/lib/python3.6/site-packages/pydeconz/__init__.py", line 139, in async_event_handler
self.sensors[event['id']].async_update(event)
AttributeError: 'NoneType' object has no attribute 'async_update'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "uvloop/loop.pyx", line 2062, in uvloop.loop.Loop.call_exception_handler
File "/usr/src/app/homeassistant/core.py", line 94, in async_loop_exception_handler
_LOGGER.error("Error doing job: %s", context['message'], **kwargs)
KeyError: 'message'
The json of the switches (sensors) in deCONZ:
"24": {
"config": {
"on": true
},
"ep": 242,
"etag": "fcdd940931497c1eaaea39876d6fd61a",
"manufacturername": "Philips",
"modelid": "ZGPSWITCH",
"name": "moodswitch_bedroom",
"state": {
"buttonevent": 224,
"lastupdated": "1970-01-01T00:00:00"
},
"type": "ZGPSwitch",
"uniqueid": "00:00:00:00:00:47:9a:0b-f2"
},
"25": {
"config": {
"on": true
},
"ep": 242,
"etag": "d154d65a8d5bbb6380b8ba414d180d1c",
"manufacturername": "Philips",
"modelid": "ZGPSWITCH",
"name": "moodswitch_livingroom",
"state": {
"buttonevent": 34,
"lastupdated": "2018-01-04T14:23:13"
},
"type": "ZGPSwitch",
"uniqueid": "00:00:00:00:00:47:96:c9-f2"
}
https://community.home-assistant.io/t/lidl-melinera-christmas-string-hg06467-lidl-livarno-lux/367639
I bought today this nice Lidl Melinera Christmas String with Zigbee. I am using DECONZ. Genrally all fine, except setting uup effects.
Those effects are avaible: “steady”,“snow”,“rainbow”,“snake”,“twinkle”,“firework”,“horizontal_flag”,“waves”,“updown”,“vintage”,“fading”,“collide”,“strobe”,“sparkles”,“carnaval”,“glow”.
I can set them via REST-API with success:
curl -H ‘Content-Type: application/json’ -X PUT -d ‘{“effect”:“sparkles”}’ http://172.30.33.2:40850/api/33E7B7A7B7/lights/14/state 4
Or with error and success:
curl -H ‘Content-Type: application/json’ -X PUT -d ‘{“effect”:“snow”,“speed”:100,“colors”:[{“r”:164,“g”:168,“b”:50},{“r”:168,“g”:50,“b”:153},{“r”:102,“g”:50,“b”:168},{“r”:50,“g”:155,“b”:168},{“r”:50,“g”:168,“b”:72},{“r”:168,“g”:88,“b”:50}]}’ http://172.30.33.2:40850/api/33E7B7A7B7/lights/14/state 4
On GUI of Hassio for effect only “colorloop” is shown. Please integrate a feature to overwrite standrad effect “colorloop”.
Greetings Kane,
just found this project and it looks exactly like the thing I was searching for. I already own an RaspBee gateway running DECONZ and some IKEA Tradfri equipment. This seems to be the solution to integrate a broad range of ZigBee devices into HA.
Hence I would like to try your solution, but I can't figure out, how to install it on HASS.IO on RPI3. Can I simply copy the files to config/custom_components using the configurator component? What else is required for setup?
Thanks in advance for your support
Carsten
If a light/switch/sensor is added to the deconz network while home assistant is already running; it doesn't get reported. Home-assistant needs to be restarted for it to recognize the newly added component.
This is particularly painful, if deconz and home-assistant are started one after the other. Because the deconz rest plugin does not report any lights unless it has been discovered first. (even if they are already registered in the db to belong to the network) As a result, any component that was not discovered yet during startup, will never show on home-assistant.
I have a device in deCONZ that behaves as a bridge, representing different physical devices as endpoints with their own sets of clusters. The deCONZ REST API creates a sensor node for each of these endpoints (in this case they're ZHAThermostat
s) like this:
{
"35": {
"config": {
"battery": 70,
"heatsetpoint": 2300,
"offset": 0,
"on": true,
"reachable": true,
"schedule": {},
"schedule_on": false
},
"ep": 1,
"etag": "982d9acc38bee5b251e24a9be26558e4",
"lastseen": "2021-02-15T12:23Z",
"manufacturername": "Danfoss",
"modelid": "0x8030",
"name": "0x8030",
"state": {
"lastupdated": "2021-02-15T12:23:07.994",
"on": false,
"temperature": 2307
},
"swversion": "YYYYMMDD",
"type": "ZHAThermostat",
"uniqueid": "58:8e:81:ff:fe:6b:98:8c-01-0201"
},
"36": {
"config": {
"battery": 86,
"heatsetpoint": 2300,
"offset": 0,
"on": true,
"reachable": true,
"schedule": {},
"schedule_on": false
},
"ep": 2,
"etag": "62f12749f9f51c950086aff37dd02b61",
"lastseen": "2021-02-15T12:23Z",
"manufacturername": "Danfoss",
"modelid": "0x8030",
"name": "0x8030",
"state": {
"lastupdated": "2021-02-15T12:23:22.399",
"on": false,
"temperature": 2316
},
"swversion": "YYYYMMDD",
"type": "ZHAThermostat",
"uniqueid": "58:8e:81:ff:fe:6b:98:8c-02-0201"
},
"37": {
"config": {
"battery": 86,
"heatsetpoint": 2350,
"offset": 0,
"on": true,
"reachable": true,
"schedule": {},
"schedule_on": false
},
"ep": 3,
"etag": "f50061174bb7f18a3d95789bab8b646d",
"lastseen": "2021-02-15T12:23Z",
"manufacturername": "Danfoss",
"modelid": "0x8030",
"name": "0x8030",
"state": {
"lastupdated": "2021-02-15T12:23:25.466",
"on": false,
"temperature": 2337
},
"swversion": "YYYYMMDD",
"type": "ZHAThermostat",
"uniqueid": "58:8e:81:ff:fe:6b:98:8c-03-0201"
},
"38": {
"config": {
"battery": 85,
"heatsetpoint": 2300,
"offset": 0,
"on": true,
"reachable": true,
"schedule": {},
"schedule_on": false
},
"ep": 4,
"etag": "eea97adf8ce1b971b8b6a3a31793f96b",
"lastseen": "2021-02-15T12:23Z",
"manufacturername": "Danfoss",
"modelid": "0x8030",
"name": "0x8030",
"state": {
"lastupdated": "2021-02-15T12:23:41.939",
"on": false,
"temperature": 2333
},
"swversion": "YYYYMMDD",
"type": "ZHAThermostat",
"uniqueid": "58:8e:81:ff:fe:6b:98:8c-04-0201"
},
"39": {
"config": {
"battery": 83,
"heatsetpoint": 2300,
"offset": 0,
"on": true,
"reachable": true,
"schedule": {},
"schedule_on": false
},
"ep": 5,
"etag": "1f7cd1a5d66dc27ac5eb44b8c47362fb",
"lastseen": "2021-02-15T12:23Z",
"manufacturername": "Danfoss",
"modelid": "0x8030",
"name": "0x8030",
"state": {
"lastupdated": "none",
"on": false,
"temperature": 2325
},
"swversion": "YYYYMMDD",
"type": "ZHAThermostat",
"uniqueid": "58:8e:81:ff:fe:6b:98:8c-05-0201"
}
}
Each node has a "config/battery" entry for the battery level of the device represented by the endpoint.
Currently, the integration seems to just take the value for the first node and expose that to Home Assistant as a sensor with the battery level for the whole "device". Since each node has distinct "ep" and "uniqueid" entries, would it be possible to instead create a sensor with the battery level per-node - just like it creates climate entities per-node?
Possible implementations:
true
to state 'on' and config.on false
to state 'off'PUT /sensors/#/config {"on": true}
PUT /sensors/#/config {"on": false}
Use case: I'm using the rule engine of deCONZ and sometimes I disable a motion sensor the prevent triggering all rules related to the sensor.
I would prefer the second implementation.
MY CONFIGURATION
On Home Assistant I see "Entity Unavailable"
ERROR ON HA
2021-12-30 15:54:21 ERROR (MainThread) [homeassistant.util.logging] Exception in async_update_connection_state when dispatching 'deconz-reachable-cdff0daea53abc75ef6f11b350a7fb3b': ()
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/deconz/deconz_device.py", line 85, in async_update_connection_state
self.async_write_ha_state()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 505, in async_write_ha_state
self._async_write_ha_state()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 540, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/light/__init__.py", line 906, in state_attributes
data.update(self._light_internal_convert_color(color_mode))
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/light/__init__.py", line 833, in _light_internal_convert_color
if color_mode == COLOR_MODE_HS and self.hs_color:
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/deconz/light.py", line 186, in hs_color
return (self._device.hue / 65535 * 360, self._device.saturation / 255 * 100)
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
With Version 2.05.83 deCONZ added support for Tuya Thermostats (as Sensors). Would it be possible to add support for the config variables "preset" and "windowopen_set" which are Tuya only?
Thanks!
I know this library exposes them to Hass, but how do I get them in Hass? My DeCONZ exposed light groups don't have such attributes, and neither the Hass light groups.
Since release 2.05.70 battery status of the Fyrtur is included:
Add ZHABattery resource for IKEA FYRTUR and KADRILJ smart blinds #1827
Can this be added :)?
Asynctest doesn't work with Python 3.8 and above.
Asynctest upstream is aware of this breakage and recommends using the built-in AsyncMock instead.
See also Martiusweb/asynctest#144 and Martiusweb/asynctest#126
I would like to have a property for each sensor that it will return the timestamp of the lastest message received.
It will be very useful in order to understand if a sensor is available or not.
What do you think?
Should be nice if the Lidl Smart Wireless Door Bell supported with triggers within Home Assistent.
See also my issue at deconz-rest-plugin git repo; dresden-elektronik/deconz-rest-plugin#4450
The Lidl Smart Wireless Door Bell only contains one button.
Device registry;
2021-06-16 11:07:50 DEBUG (MainThread) [pydeconz.websocket] {"attr":{"id":"14","lastannounced":"2021-05-18T10:56:46Z","lastseen":"2021-06-16T09:07Z","manufacturername":"EcoDim BV","modelid":"Dimmer-Switch-ZB3.0","name":"Slaapkamer T&I spotjes","swversion":"3.09","type":"Dimmable light","uniqueid":"08:6b:d7:ff:fe:5d:75:98-01"},"e":"changed","id":"14","r":"lights","t":"event","uniqueid":"08:6b:d7:ff:fe:5d:75:98-01"}
2021-06-16 11:07:52 DEBUG (MainThread) [pydeconz.websocket] {"e":"added","id":"53","r":"sensors","sensor":{"config":
{"battery":null,"enrolled":0,"on":true,"pending":[],"reachable":true},"ep":1,"etag":"c0d25a498684b0634797d3d79aa45ef1","id":"53","lastseen":"2021-06-16T09:07Z","manufacturername":"LIDL Silvercrest","mode":1,"modelid":"HG06668","name":"Switch 53","state":
{"buttonevent":null,"lastupdated":"none","lowbattery":false,"tampered":false},"type":"ZHASwitch","uniqueid":"84:2e:14:ff:fe:f9:4a:ca-01-0500"},"t":"event","uniqueid":"84:2e:14:ff:fe:f9:4a:ca-01-0500"}
2021-06-16 11:07:52 DEBUG (MainThread) [pydeconz.deconzdevice] Switch 53 created as
{'config': {'battery': None,
'enrolled': 0,
'on': True,
'pending': [],
'reachable': True},
'ep': 1,
'etag': 'c0d25a498684b0634797d3d79aa45ef1',
'id': '53',
'lastseen': '2021-06-16T09:07Z',
'manufacturername': 'LIDL Silvercrest',
'mode': 1,
'modelid': 'HG06668',
'name': 'Switch 53',
'state': {'buttonevent': None,
'lastupdated': 'none',
'lowbattery': False,
'tampered': False},
'type': 'ZHASwitch',
'uniqueid': '84:2e:14:ff:fe:f9:4a:ca-01-0500'}
On button press
2021-06-16 11:08:01 DEBUG (MainThread) [pydeconz.websocket] {"e":"changed","id":"53","r":"sensors","state":
{"buttonevent":1002,"lastupdated":"2021-06-16T09:08:01.838","lowbattery":false,"tampered":false},"t":"event","uniqueid":"84:2e:14:ff:fe:f9:4a:ca-01-0500"}
Typical scenario when hass starts just as deconz does and deconz hasn't yet loaded all devices, can happen to only lights or sometimes even all of them.
Initial thought: do a gateway.refresh_state if this happens
Reference: home-assistant/core#36787
Hi
I just made a post on the HA forum about the sensor values of deCONZ being rounded to 1 decimal even though the deCONZ REST API contains 2 decimals: https://community.home-assistant.io/t/deconz-sensors-precision-rounded-to-1-decimal/318506
But now I found this repo and I assume this is where the rounding is taking place?
Would it be an option to include the two available decimals for temperature and humidity?
I just updated deconz to latest version but it looks like event bundling is not working anymore.
Not one deconz_event is coming to my logfile. When i press a button i only see:
2018-05-07 11:42:31 DEBUG (MainThread) [pydeconz.websocket] Websocket data: b'\x81z{"config":{"battery":100,"on":true,"reachable":true,"temperature":3000},"e":"changed","id":"16","r":"sensors","t":"event"}'
2018-05-07 11:42:31 DEBUG (MainThread) [pydeconz.deconzdevice] schakelaar_kantoor_beneden: update battery with 100
2018-05-07 11:42:31 DEBUG (MainThread) [pydeconz.deconzdevice] schakelaar_kantoor_beneden: update on with True
2018-05-07 11:42:31 DEBUG (MainThread) [pydeconz.deconzdevice] schakelaar_kantoor_beneden: update reachable with True
2018-05-07 11:42:31 DEBUG (MainThread) [pydeconz.deconzdevice] schakelaar_kantoor_beneden: update temperature with 3000
But the 1002 code is not send, so i can not use anything atm...
Unfortunalety the battery levels of devices like Philips motion sensor and Xiaomi/Aqara ambience, door/window and vibration sensors are modelled only as attributes named {{battery_level}} of their sensor values/entities like temperature and humidity so they aren't directly accessible as own entities in Home Assistant and need to be integrated complicatedly and error-prone by using template sensors like following snippet demonstrates:
- platform: template
sensors:
amb_battery:
device_class: battery
unit_of_measurement: '%'
value_template: >
{% if is_state('sensor.amb_temp', 'unknown') %}
110
{% else %}
{{ states.sensor.amb_temp.attributes["battery_level"] | float}}
{% endif %}
Contrary ZHA component of Home Assistent directly exports these battery levels correctly as own entities.
In addition current implementation provides the values redundantly for each entity/value of a single device but in fact its only one unique device entity/value which should be exposed as such one.
Note:
In my setup only battery levels of IKEA devices are exposed correctly since these provide "Power Consumption" ZigBee cluster
Looking forward to receive a reply.
Users have on occasion gotten multiple entries of a device from deconz. This usually happens when the users re-add a device a second time.
This will generate a unique id already exists error by Home Assistant.
homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.stue_knaptryk_battery_level. Platform deconz does not generate unique IDs
Create a method that will generate a warning upon identifying multiple instances of the same unique id.
I think it would be good if it were clear how to use this package. It would be beneficial if there was a "quick start" section in the readme that shows an example of how to achieve a common task, i.e. what we need to run and what code we need to write.
Later on we can evaluate writing more detailed documentation that explains how to use the more advanced features.
Not sure if it should be requested here or in HA core project. The doc says there is some kind of whitelist for the Climate device of this kind because there are seen as sensor? https://www.home-assistant.io/integrations/deconz/#climate
Sorry if I did not understand well.
Danfoss Ally were added by Swoop since a couple release dresden-elektronik/deconz-rest-plugin#2983
I own some of these devices, already set in deconz, but they do not appear in HA.
I have some time to help if needed.
When a new light gets added to deconz an added event is sent
{"e":"added","id":"43","r":"lights","t":"event","uniqueid":"00:17:88:00:00:00:00:00-0b"}
Since pydeconz expects the added event to hold a "light" dictionary in the event we instead get a value error. This needs to be handled some way, maybe add to poll a light resource when an added event is sent; GET /api//lights/
This error came up on my test system today. Running your deconz-component branch of HA (0.60.0.dev0). Currently I have a Tradfri motion sensor and Tradfri 5 button dimmer paired with the gateway through deCONZ. Not sure what provoked it (not sure if it was a motion event or button event, I can test more to reproduce if you think it’s relevant).
2017-12-08 16:46:57 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _SelectorSocketTransport._read_ready()
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
self._callback(*self._args)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 730, in _read_ready
self._protocol.data_received(data)
File "/opt/home-assistant/homeassistant/lib/python3.5/site-packages/pydeconz/websocket.py", line 96, in data_received
payload, extra_data = self.get_payload(data)
File "/opt/home-assistant/homeassistant/lib/python3.5/site-packages/pydeconz/websocket.py", line 122, in get_payload
payload = json.loads(data[start:end].decode())
File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 38 (char 37)
hello there,
i am trying to implement a python code in order to connect a usb Conbee II, to some sensors, but i don´t see any getting started doc or similar.
Looking at the code i can see that all I want to implement in my code is possible, except to search new devices, where can I find more information about it?
Thanks a lot for you work
Running latest stable version of all components: HA (2021.3.4), Deconz (2.09.03), and Conbee II (26680700).
At some random point in the day, the websocket connection seems to die.
This causes entities coming from Deconz to not get updated in HA (sensors, lights, etc).
Insights:
2021-03-21 10:40:29 DEBUG (MainThread) [pydeconz.websocket] {"attr":{"id":"53","lastannounced":"2021-03-15T11:53:13Z","lastseen":"2021-03-21T10:40Z","manufacturername":"LUMI","modelid":"lumi.plug","name":"REDACTED","swversion":"09-04-2018","type":"Smart plug","uniqueid":"REDACTED"},"e":"changed","id":"53","r":"lights","t":"event","uniqueid":"REDACTED"}
deConz-Log for a scene-switch:
21:18:15:097 Node data 0x680ae2fffe7941f7 profileId: 0x0104, clusterId: 0x0001
21:18:15:098 0x680AE2FFFE7941F7: added ZCL value 0x01/0x0001/0x0021
21:18:15:098 enqueue event config/battery for /sensors/7
21:18:15:098 Force binding of attribute reporting for sensor Fernbedienung PC
21:18:15:098 [INFO] - No button handler for: TRADFRI remote control endpoint: 0x01 cluster: 0x0001 command: 0x0A payload[0]: 021
21:18:15:098 ZCL attribute report 0x680AE2FFFE7941F7 for cluster: 0x0001, ep: 0x01, frame control: 0x08, mfcode: 0x0000
21:18:15:098 payload: 2100204a
21:18:15:100 Websocket 172.22.0.3:39874 send message: {"config":{"alert":"none","battery":74,"group":"12","on":true,"reachable":true},"e":"changed","id":"7","r":"sensors","t":"event","uniqueid":"68:0a:e2:ff:fe:79:41:f7-01-1000"} (ret = 174)
21:18:15:100 Websocket 192.168.1.101:44032 send message: {"config":{"alert":"none","battery":74,"group":"12","on":true,"reachable":true},"e":"changed","id":"7","r":"sensors","t":"event","uniqueid":"68:0a:e2:ff:fe:79:41:f7-01-1000"} (ret = 174)
21:18:15:100 Websocket 192.168.1.101:44076 send message: {"config":{"alert":"none","battery":74,"group":"12","on":true,"reachable":true},"e":"changed","id":"7","r":"sensors","t":"event","uniqueid":"68:0a:e2:ff:fe:79:41:f7-01-1000"} (ret = 174)
21:18:15:100 Websocket 192.168.1.10:42254 send message: {"config":{"alert":"none","battery":74,"group":"12","on":true,"reachable":true},"e":"changed","id":"7","r":"sensors","t":"event","uniqueid":"68:0a:e2:ff:fe:79:41:f7-01-1000"} (ret = 174)
21:18:15:287 enqueue event event/validgroup for /sensors/7
21:18:15:287 [INFO] - Button 2002 Step up (with on/off) TRADFRI remote control
21:18:15:287 enqueue event state/buttonevent for /sensors/7
21:18:15:287 enqueue event state/lastupdated for /sensors/7
21:18:15:287 Force binding of attribute reporting for sensor Fernbedienung PC
21:18:15:290 Websocket 172.22.0.3:39874 send message: {"e":"changed","id":"7","r":"sensors","state":{"buttonevent":2002,"lastupdated":"2020-12-17T20:18:15.287"},"t":"event","uniqueid":"68:0a:e2:ff:fe:79:41:f7-01-1000"} (ret = 164)
21:18:15:290 Websocket 192.168.1.101:44032 send message: {"e":"changed","id":"7","r":"sensors","state":{"buttonevent":2002,"lastupdated":"2020-12-17T20:18:15.287"},"t":"event","uniqueid":"68:0a:e2:ff:fe:79:41:f7-01-1000"} (ret = 164)
21:18:15:290 Websocket 192.168.1.101:44076 send message: {"e":"changed","id":"7","r":"sensors","state":{"buttonevent":2002,"lastupdated":"2020-12-17T20:18:15.287"},"t":"event","uniqueid":"68:0a:e2:ff:fe:79:41:f7-01-1000"} (ret = 164)
21:18:15:290 Websocket 192.168.1.10:42254 send message: {"e":"changed","id":"7","r":"sensors","state":{"buttonevent":2002,"lastupdated":"2020-12-17T20:18:15.287"},"t":"event","uniqueid":"68:0a:e2:ff:fe:79:41:f7-01-1000"} (ret = 164)
21:18:15:292 discard sensor state push for 7: state/lastupdated (already pushed)
21:18:15:292 rule event /sensors/7/state/lastupdated: 0 -> 0
21:18:15:292 trigger rule 112 - Rule CALL_SCENE
21:18:15:293 add task 1037 type 25 to group 0x0006 cluster 0x0005 req.id 96
21:18:15:293 enqueue event state/on for /lights/6
21:18:15:293 enqueue event state/on for /lights/9
21:18:15:293 enqueue event state/bri for /lights/9
21:18:15:293 enqueue event state/ct for /lights/9
21:18:15:293 enqueue event state/bri for /lights/10
21:18:15:293 enqueue event state/colormode for /lights/10
21:18:15:293 enqueue event state/on for /lights/4
21:18:15:293 enqueue event state/on for /lights/5
21:18:15:293 enqueue event state/bri for /lights/5
21:18:15:296 Websocket 172.22.0.3:39874 send message: {"e":"changed","id":"6","r":"lights","state":{"alert":null,"bri":35,"colormode":"xy","effect":"1","hue":0,"on":true,"reachable":true,"sat":0,"xy":[0.4876,0.4074]},"t":"event","uniqueid":"cc:cc:cc:ff:fe:5c:41:59-01"} (ret = 215)
21:18:15:296 Websocket 192.168.1.101:44032 send message: {"e":"changed","id":"6","r":"lights","state":{"alert":null,"bri":35,"colormode":"xy","effect":"1","hue":0,"on":true,"reachable":true,"sat":0,"xy":[0.4876,0.4074]},"t":"event","uniqueid":"cc:cc:cc:ff:fe:5c:41:59-01"} (ret = 215)
21:18:15:296 Websocket 192.168.1.101:44076 send message: {"e":"changed","id":"6","r":"lights","state":{"alert":null,"bri":35,"colormode":"xy","effect":"1","hue":0,"on":true,"reachable":true,"sat":0,"xy":[0.4876,0.4074]},"t":"event","uniqueid":"cc:cc:cc:ff:fe:5c:41:59-01"} (ret = 215)
21:18:15:296 Websocket 192.168.1.10:42254 send message: {"e":"changed","id":"6","r":"lights","state":{"alert":null,"bri":35,"colormode":"xy","effect":"1","hue":0,"on":true,"reachable":true,"sat":0,"xy":[0.4876,0.4074]},"t":"event","uniqueid":"cc:cc:cc:ff:fe:5c:41:59-01"} (ret = 215)
21:18:15:296 enqueue event event/checkgroupanyon for /groups/65520
21:18:15:296 enqueue event event/checkgroupanyon for /groups/1
21:18:15:296 enqueue event event/checkgroupanyon for /groups/6
21:18:15:296 enqueue event event/checkgroupanyon for /groups/8
21:18:15:298 Websocket 172.22.0.3:39874 send message: {"e":"changed","id":"9","r":"lights","state":{"alert":null,"bri":53,"colormode":"ct","ct":410,"on":true,"reachable":true},"t":"event","uniqueid":"ec:1b:bd:ff:fe:43:4d:02-01"} (ret = 174)
21:18:15:298 Websocket 192.168.1.101:44032 send message: {"e":"changed","id":"9","r":"lights","state":{"alert":null,"bri":53,"colormode":"ct","ct":410,"on":true,"reachable":true},"t":"event","uniqueid":"ec:1b:bd:ff:fe:43:4d:02-01"} (ret = 174)
21:18:15:298 Websocket 192.168.1.101:44076 send message: {"e":"changed","id":"9","r":"lights","state":{"alert":null,"bri":53,"colormode":"ct","ct":410,"on":true,"reachable":true},"t":"event","uniqueid":"ec:1b:bd:ff:fe:43:4d:02-01"} (ret = 174)
21:18:15:298 Websocket 192.168.1.10:42254 send message: {"e":"changed","id":"9","r":"lights","state":{"alert":null,"bri":53,"colormode":"ct","ct":410,"on":true,"reachable":true},"t":"event","uniqueid":"ec:1b:bd:ff:fe:43:4d:02-01"} (ret = 174)
21:18:15:298 enqueue event event/checkgroupanyon for /groups/65520
21:18:15:298 enqueue event event/checkgroupanyon for /groups/5
21:18:15:298 enqueue event event/checkgroupanyon for /groups/6
21:18:15:300 discard light state push for 9: state/bri (already pushed)
21:18:15:301 discard light state push for 9: state/ct (already pushed)
21:18:15:303 Websocket 172.22.0.3:39874 send message: {"e":"changed","id":"10","r":"lights","state":{"alert":null,"bri":1,"colormode":"xy","ct":250,"on":false,"reachable":true},"t":"event","uniqueid":"ec:1b:bd:ff:fe:f1:f7:c3-01"} (ret = 175)
21:18:15:304 Websocket 192.168.1.101:44032 send message: {"e":"changed","id":"10","r":"lights","state":{"alert":null,"bri":1,"colormode":"xy","ct":250,"on":false,"reachable":true},"t":"event","uniqueid":"ec:1b:bd:ff:fe:f1:f7:c3-01"} (ret = 175)
21:18:15:304 Websocket 192.168.1.101:44076 send message: {"e":"changed","id":"10","r":"lights","state":{"alert":null,"bri":1,"colormode":"xy","ct":250,"on":false,"reachable":true},"t":"event","uniqueid":"ec:1b:bd:ff:fe:f1:f7:c3-01"} (ret = 175)
21:18:15:304 Websocket 192.168.1.10:42254 send message: {"e":"changed","id":"10","r":"lights","state":{"alert":null,"bri":1,"colormode":"xy","ct":250,"on":false,"reachable":true},"t":"event","uniqueid":"ec:1b:bd:ff:fe:f1:f7:c3-01"} (ret = 175)
21:18:15:305 discard light state push for 10: state/colormode (already pushed)
21:18:15:307 Websocket 172.22.0.3:39874 send message: {"e":"changed","id":"4","r":"lights","state":{"alert":null,"bri":254,"colormode":"xy","ct":153,"effect":"1","hue":37153,"on":true,"reachable":true,"sat":49,"xy":[0.3096,0.3222]},"t":"event","uniqueid":"00:15:8d:00:04:18:1d:66-01"} (ret = 230)
21:18:15:307 Websocket 192.168.1.101:44032 send message: {"e":"changed","id":"4","r":"lights","state":{"alert":null,"bri":254,"colormode":"xy","ct":153,"effect":"1","hue":37153,"on":true,"reachable":true,"sat":49,"xy":[0.3096,0.3222]},"t":"event","uniqueid":"00:15:8d:00:04:18:1d:66-01"} (ret = 230)
21:18:15:308 Websocket 192.168.1.101:44076 send message: {"e":"changed","id":"4","r":"lights","state":{"alert":null,"bri":254,"colormode":"xy","ct":153,"effect":"1","hue":37153,"on":true,"reachable":true,"sat":49,"xy":[0.3096,0.3222]},"t":"event","uniqueid":"00:15:8d:00:04:18:1d:66-01"} (ret = 230)
21:18:15:308 Websocket 192.168.1.10:42254 send message: {"e":"changed","id":"4","r":"lights","state":{"alert":null,"bri":254,"colormode":"xy","ct":153,"effect":"1","hue":37153,"on":true,"reachable":true,"sat":49,"xy":[0.3096,0.3222]},"t":"event","uniqueid":"00:15:8d:00:04:18:1d:66-01"} (ret = 230)
21:18:15:308 enqueue event event/checkgroupanyon for /groups/65520
21:18:15:308 enqueue event event/checkgroupanyon for /groups/1
21:18:15:308 enqueue event event/checkgroupanyon for /groups/8
21:18:15:308 enqueue event event/checkgroupanyon for /groups/6
21:18:15:309 Websocket 172.22.0.3:39874 send message: {"e":"scene-called","gid":"6","r":"scenes","scid":"6","t":"event"} (ret = 66)
21:18:15:309 Websocket 192.168.1.101:44032 send message: {"e":"scene-called","gid":"6","r":"scenes","scid":"6","t":"event"} (ret = 66)
21:18:15:309 Websocket 192.168.1.101:44076 send message: {"e":"scene-called","gid":"6","r":"scenes","scid":"6","t":"event"} (ret = 66)
21:18:15:309 Websocket 192.168.1.10:42254 send message: {"e":"scene-called","gid":"6","r":"scenes","scid":"6","t":"event"} (ret = 66)
21:18:15:310 Websocket 172.22.0.3:39874 send message: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":207,"on":true,"reachable":true},"t":"event","uniqueid":"58:8e:81:ff:fe:52:1f:0e-01"} (ret = 149)
21:18:15:310 Websocket 192.168.1.101:44032 send message: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":207,"on":true,"reachable":true},"t":"event","uniqueid":"58:8e:81:ff:fe:52:1f:0e-01"} (ret = 149)
21:18:15:310 Websocket 192.168.1.101:44076 send message: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":207,"on":true,"reachable":true},"t":"event","uniqueid":"58:8e:81:ff:fe:52:1f:0e-01"} (ret = 149)
21:18:15:310 Websocket 192.168.1.10:42254 send message: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":207,"on":true,"reachable":true},"t":"event","uniqueid":"58:8e:81:ff:fe:52:1f:0e-01"} (ret = 149)
21:18:15:310 enqueue event event/checkgroupanyon for /groups/65520
21:18:15:310 enqueue event event/checkgroupanyon for /groups/1
21:18:15:310 enqueue event event/checkgroupanyon for /groups/6
21:18:15:312 discard light state push for 5: state/bri (already pushed)
21:18:15:315 enqueue event state/any_on for /groups/1
21:18:15:316 enqueue event state/any_on for /groups/6
21:18:15:318 enqueue event state/any_on for /groups/8
21:18:15:331 Websocket 172.22.0.3:39874 send message: {"e":"changed","id":"1","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"} (ret = 88)
21:18:15:332 Websocket 192.168.1.101:44032 send message: {"e":"changed","id":"1","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"} (ret = 88)
21:18:15:332 Websocket 192.168.1.101:44076 send message: {"e":"changed","id":"1","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"} (ret = 88)
21:18:15:332 Websocket 192.168.1.10:42254 send message: {"e":"changed","id":"1","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"} (ret = 88)
21:18:15:333 Websocket 172.22.0.3:39874 send message: {"e":"changed","id":"6","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"} (ret = 88)
21:18:15:333 Websocket 192.168.1.101:44032 send message: {"e":"changed","id":"6","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"} (ret = 88)
21:18:15:333 Websocket 192.168.1.101:44076 send message: {"e":"changed","id":"6","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"} (ret = 88)
21:18:15:333 Websocket 192.168.1.10:42254 send message: {"e":"changed","id":"6","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"} (ret = 88)
21:18:15:334 Websocket 172.22.0.3:39874 send message: {"e":"changed","id":"8","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"} (ret = 88)
21:18:15:334 Websocket 192.168.1.101:44032 send message: {"e":"changed","id":"8","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"} (ret = 88)
21:18:15:335 Websocket 192.168.1.101:44076 send message: {"e":"changed","id":"8","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"} (ret = 88)
21:18:15:335 Websocket 192.168.1.10:42254 send message: {"e":"changed","id":"8","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"} (ret = 88)
21:18:15:438 Websocket 172.22.0.3:39874 send message: {"attr":{"colorcapabilities":8,"id":"6","lastannounced":"2020-12-17T17:27:47Z","lastseen":"2020-12-17T20:18Z","manufacturername":"IKEA of Sweden","modelid":"TRADFRI bulb E27 CWS opal 600lm","name":"Schlafzimmer","swversion":"1.3.002","type":"Color light","uniqueid":"cc:cc:cc:ff:fe:5c:41:59-01"},"e":"changed","id":"6","r":"lights","t":"event","uniqueid":"cc:cc:cc:ff:fe:5c:41:59-01"} (ret = 384)
21:18:15:439 Websocket 192.168.1.101:44032 send message: {"attr":{"colorcapabilities":8,"id":"6","lastannounced":"2020-12-17T17:27:47Z","lastseen":"2020-12-17T20:18Z","manufacturername":"IKEA of Sweden","modelid":"TRADFRI bulb E27 CWS opal 600lm","name":"Schlafzimmer","swversion":"1.3.002","type":"Color light","uniqueid":"cc:cc:cc:ff:fe:5c:41:59-01"},"e":"changed","id":"6","r":"lights","t":"event","uniqueid":"cc:cc:cc:ff:fe:5c:41:59-01"} (ret = 384)
21:18:15:439 Websocket 192.168.1.101:44076 send message: {"attr":{"colorcapabilities":8,"id":"6","lastannounced":"2020-12-17T17:27:47Z","lastseen":"2020-12-17T20:18Z","manufacturername":"IKEA of Sweden","modelid":"TRADFRI bulb E27 CWS opal 600lm","name":"Schlafzimmer","swversion":"1.3.002","type":"Color light","uniqueid":"cc:cc:cc:ff:fe:5c:41:59-01"},"e":"changed","id":"6","r":"lights","t":"event","uniqueid":"cc:cc:cc:ff:fe:5c:41:59-01"} (ret = 384)
21:18:15:439 Websocket 192.168.1.10:42254 send message: {"attr":{"colorcapabilities":8,"id":"6","lastannounced":"2020-12-17T17:27:47Z","lastseen":"2020-12-17T20:18Z","manufacturername":"IKEA of Sweden","modelid":"TRADFRI bulb E27 CWS opal 600lm","name":"Schlafzimmer","swversion":"1.3.002","type":"Color light","uniqueid":"cc:cc:cc:ff:fe:5c:41:59-01"},"e":"changed","id":"6","r":"lights","t":"event","uniqueid":"cc:cc:cc:ff:fe:5c:41:59-01"} (ret = 384)
21:18:15:446 Websocket 172.22.0.3:39874 send message: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":232,"on":true,"reachable":true},"t":"event","uniqueid":"58:8e:81:ff:fe:52:1f:0e-01"} (ret = 149)
21:18:15:446 Websocket 192.168.1.101:44032 send message: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":232,"on":true,"reachable":true},"t":"event","uniqueid":"58:8e:81:ff:fe:52:1f:0e-01"} (ret = 149)
21:18:15:446 Websocket 192.168.1.101:44076 send message: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":232,"on":true,"reachable":true},"t":"event","uniqueid":"58:8e:81:ff:fe:52:1f:0e-01"} (ret = 149)
21:18:15:446 Websocket 192.168.1.10:42254 send message: {"e":"changed","id":"5","r":"lights","state":{"alert":null,"bri":232,"on":true,"reachable":true},"t":"event","uniqueid":"58:8e:81:ff:fe:52:1f:0e-01"} (ret = 149)
21:18:15:517 Websocket 172.22.0.3:39874 send message: {"e":"changed","id":"9","r":"lights","state":{"alert":null,"bri":53,"colormode":"ct","ct":250,"on":true,"reachable":true},"t":"event","uniqueid":"ec:1b:bd:ff:fe:43:4d:02-01"} (ret = 174)
21:18:15:518 Websocket 192.168.1.101:44032 send message: {"e":"changed","id":"9","r":"lights","state":{"alert":null,"bri":53,"colormode":"ct","ct":250,"on":true,"reachable":true},"t":"event","uniqueid":"ec:1b:bd:ff:fe:43:4d:02-01"} (ret = 174)
21:18:15:518 Websocket 192.168.1.101:44076 send message: {"e":"changed","id":"9","r":"lights","state":{"alert":null,"bri":53,"colormode":"ct","ct":250,"on":true,"reachable":true},"t":"event","uniqueid":"ec:1b:bd:ff:fe:43:4d:02-01"} (ret = 174)
21:18:15:518 Websocket 192.168.1.10:42254 send message: {"e":"changed","id":"9","r":"lights","state":{"alert":null,"bri":53,"colormode":"ct","ct":250,"on":true,"reachable":true},"t":"event","uniqueid":"ec:1b:bd:ff:fe:43:4d:02-01"} (ret = 174)
The Heiman HS1CA Smart Carbon Monoxide is supported by deconz but isn't by the home assistant deconz wrapping library.
2019-04-22 19:40:46 INFO (MainThread) [pydeconz.sensor] Unsupported sensor type ZHACarbonMonoxide
Here is the json/rest call result
{
'config': {
'battery': 100,
'on': True,
'pending': [],
'reachable': True
},
'ep': 1,
'etag': 'XXX',
'manufacturername': 'Heiman',
'modelid': 'CO_V16',
'name': 'Cave, CO',
'state': {
'carbonmonoxide': False,
'lastupdated': 'none',
'lowbattery': False,
'tampered': False
},
'swversion': '20150330',
'type': 'ZHACarbonMonoxide',
'uniqueid': 'XXX'
}
2020-11-28 13:24:32 DEBUG (MainThread) [pydeconz.gateway] Sending "put" "{'mode': 'off'}" to "172.30.33.0 /sensors/30/config"
2020-11-28 13:24:32 DEBUG (MainThread) [pydeconz.gateway] HTTP request response: [{'error': {'address': '/sensors/30/config/mode',
'description': 'parameter, mode, not available',
'type': 6}}]
2020-11-28 13:24:32 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139702468536832] /sensors/30/config/mode parameter, mode, not available
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1451, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1486, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 499, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 664, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 536, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/deconz/climate.py", line 115, in async_set_hvac_mode
await self._device.async_set_config(data)
File "/usr/local/lib/python3.8/site-packages/pydeconz/deconzdevice.py", line 30, in async_set_config
await self.async_set(field, data)
File "/usr/local/lib/python3.8/site-packages/pydeconz/api.py", line 112, in async_set
await self._request("put", field, json=data)
File "/usr/local/lib/python3.8/site-packages/pydeconz/gateway.py", line 106, in request
_raise_on_error(response)
File "/usr/local/lib/python3.8/site-packages/pydeconz/gateway.py", line 220, in _raise_on_error
raise_error(data["error"])
File "/usr/local/lib/python3.8/site-packages/pydeconz/errors.py", line 58, in raise_error
raise cls("{} {}".format(error["address"], error["description"]))
pydeconz.errors.RequestError: /sensors/30/config/mode parameter, mode, not available
The data in HA seems to be off for some entities:
{
"brightness": 126,
"xy_color": [
29035,
0.406578
],
"effect_list": [
"colorloop"
],
"rgb_color": [
255,
0,
0
],
"friendly_name": "Panthella",
"supported_features": 125
}
Compared to the deconz API:
{
"ctmax": 454,
"ctmin": 250,
"etag": "dcf18ae24dbc407e045999a588772d13",
"hascolor": true,
"manufacturername": "IKEA of Sweden",
"modelid": "TRADFRI bulb E27 CWS opal 600lm",
"name": "Panthella",
"state": {
"alert": "none",
"bri": 126,
"colormode": "xy",
"effect": "none",
"hue": 0,
"on": true,
"reachable": true,
"sat": 0,
"xy": [
0.444783,
0.406578
]
},
"swversion": "1.3.002",
"type": "Color light",
"uniqueid": "00:0b:57:ff:fe:9c:2f:f5-01"
}
Hi !
Thanks for your work on that integration ! I get the following error in HA Error doing job: Task exception was never retrieved
.
Logger: homeassistant
Source: /usr/src/homeassistant/homeassistant/runner.py:98
First occurred: 2:45:51 PM (10580 occurrences)
Last logged: 4:05:48 PM
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pydeconz/gateway.py", line 183, in session_handler
self.event_handler(self.websocket.data) # type: ignore
File "/usr/local/lib/python3.9/site-packages/pydeconz/gateway.py", line 193, in event_handler
if (event_type := event[EVENT_TYPE]) not in SUPPORTED_EVENT_TYPES:
KeyError: 'e'
Not sure where the issue is, but I tried to find the correlation with the Deconz log, I guess this could be related to the following lines:
[...]
16:07:42:822 Websocket 172.16.1.133:63146 send message: {"e":"changed","id":"149","r":"sensors","state":{"consumption":5695,"lastupdated":"2022-01-02T15:07:42.819","power":240},"t":"event","uniqueid":"00:1f:ee:00:00:00:56:f5-05-0702"} (ret = 178)
16:07:42:821 Websocket 172.16.1.20:47856 send message: {"e":"changed","id":"149","r":"sensors","state":{"consumption":5695,"lastupdated":"2022-01-02T15:07:42.819","power":240},"t":"event","uniqueid":"00:1f:ee:00:00:00:56:f5-05-0702"} (ret = 178)
16:07:20:813 Websocket 172.16.1.20:42276 send message: {"e":"changed","id":"149","r":"sensors","state":{"consumption":5695,"lastupdated":"2022-01-02T15:07:20.812","power":240},"t":"event","uniqueid":"00:1f:ee:00:00:00:56:f5-05-0702"} (ret = 178)
16:07:41:810 Websocket 172.16.1.133:63146 send message: {"e":"changed","id":"149","r":"sensors","state":{"consumption":5695,"lastupdated":"2022-01-02T15:07:41.807","power":241},"t":"event","uniqueid":"00:1f:ee:00:00:00:56:f5-05-0702"} (ret = 178)
16:07:42:821 Websocket 172.16.1.20:43948 send message: {"e":"changed","id":"149","r":"sensors","state":{"consumption":5695,"lastupdated":"2022-01-02T15:07:42.819","power":240},"t":"event","uniqueid":"00:1f:ee:00:00:00:56:f5-05-0702"} (ret = 178)
16:07:42:820 Websocket 172.16.1.20:42276 send message: {"e":"changed","id":"149","r":"sensors","state":{"consumption":5695,"lastupdated":"2022-01-02T15:07:42.819","power":240},"t":"event","uniqueid":"00:1f:ee:00:00:00:56:f5-05-0702"} (ret = 178)
16:07:20:813 Websocket 172.16.1.20:43948 send message: {"e":"changed","id":"149","r":"sensors","state":{"consumption":5695,"lastupdated":"2022-01-02T15:07:20.812","power":240},"t":"event","uniqueid":"00:1f:ee:00:00:00:56:f5-05-0702"} (ret = 178)
16:07:20:814 Websocket 172.16.1.20:47856 send message: {"e":"changed","id":"149","r":"sensors","state":{"consumption":5695,"lastupdated":"2022-01-02T15:07:20.812","power":240},"t":"event","uniqueid":"00:1f:ee:00:00:00:56:f5-05-0702"} (ret = 178)
16:07:20:814 Websocket 172.16.1.100:61475 send message: {"e":"changed","id":"149","r":"sensors","state":{"consumption":5695,"lastupdated":"2022-01-02T15:07:20.812","power":240},"t":"event","uniqueid":"00:1f:ee:00:00:00:56:f5-05-0702"} (ret = 178)
16:07:20:814 Websocket 172.16.1.133:63146 send message: {"e":"changed","id":"149","r":"sensors","state":{"consumption":5695,"lastupdated":"2022-01-02T15:07:20.812","power":240},"t":"event","uniqueid":"00:1f:ee:00:00:00:56:f5-05-0702"} (ret = 178)
[...]
Thanks !
Kind regards,
WM
Dear,I use Deconz with home assistant and I'm not able to use the Heiman siren.
I try to follow the #17 instructions but I don't understand wich is the number\field of my siren.
And also I'm not able to enable debug per component documentation and post relevant part .
Can anyone help me?
Thank you and regards.
Hi,
Recently encountered an issue with HA in combination with Google Assistant and Deconz. I initially registered this issue; home-assistant/core#15295 and did a commit to fix it here home-assistant/core#15305 (with my very limited knowledge of HA and Github)
After digging a bit deeper I found it is being caused because Deconz groups exposed as light can have a color temperature attribute which can be 0 which is not a valid value and causes the ZeroDivisionError. For more details look in the link above.
Hope you can fix it.
I get the following error when starting Home Assistant: Unsupported sensor type ZHAPower (Plug)
. I guess it is from my osram smart+ plug :-)
Is it possible to somehow forward received reachable events to HomeAssistant?
Whenever a light is powered on I see these prints in the HomeAssistant logs:
[pydeconz.deconzdevice] my_deconz_light: update reachable with True
[pydeconz.websocket] Websocket data: {"e":"changed","id":"1","r":"lights","state":{"reachable":true},"t":"event","uniqueid":":aa:bb:cc:dd:ee:ff-01"}
From the looks of it deCONZ is always sending an updated reachable: true
when the light is powered on, even if the light's previous reachable state was true
in the Rest API. But it appears as if HomeAssistant is unaware of this reachable update.
I would like to be able to trigger an automation in HomeAssistant when a reachable change message is received. Is it possible to forward this to HomeAssistant somehow, trigger a state update or something?
can we add support for extra states in ZHApresence like 'tampered' and lowbattery'. These states are supported and reported by deconz api but not exposed as binary_sensors in HA. Only 'presence' is exposed in HA.
e.g. deconz api state report:
"state":{"lastupdated":"2020-10-11T14:43:57.887","lowbattery":false,"presence":false,"tampered":true},"swversion":"20140929","type":"ZHAPresence","uniqueid":"xxx"}
a. 'lowbattery' should be exposed as binary_sensor with device class battery
b. 'tampered' i think should be exposed as Binary_sensor with device class problem or safety. Or even better a new device class tamper?
In deconz, I have a Xiaomi aqura motion sensor which reports motion, light intensity (lux) and temperature. In home assistant, I can read the light intensity under "sensor" and motion under "binary_sensor" component. However, the temperature is not reported to hass. This would be desirable.
I'm running home-assistant v0.79.3, and deconz 2.05.39 with firmware 26240500 on conbee
Please could you find time to add support for Home Assistant Long Term Statistics, for Deconz Sensors?
https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics
Sadly deconz exposes my Osram Smart+ Plugs (https://www.osram-lamps.com/ecatalog/smart-home/smart-home-components/smart-plug/index.jsp) as lights, but they have the type On/Off plug-in unit
. It would be awesome if this project would expose these entites as switches instead of lights.
Example from deconz API:
"23": {
"etag": "318bed1a0d0894ffc04b63a264f1d79d",
"hascolor": false,
"manufacturername": "OSRAM",
"modelid": "Plug 01",
"name": "Power Plug 1",
"state": {
"alert": "none",
"on": false,
"reachable": true
},
"swversion": "V1.04.12",
"type": "On/Off plug-in unit",
"uniqueid": "80:18:76:00:00:0d:36:ac-03"
},
Let me know if I can help you with that.
Thanks in advance!
Hi,
First of all thanks for your work on Deconz integration with HA.
One of the annoying bits of the Deconz REST API by dresden elektronik is that state updates are still sent for binary sensors which are turned on as mentioned here: dresden-elektronik/deconz-rest-plugin#90
My use-case is that I have a Philips motion sensor (SML001) in the living room which I want to silence when I am at home during the day and use it only in the night and early morning to trigger some automations. If it's not silenced it spams the log and pollutes HA.
I managed to get this to work by editing the DeconzBinarySensor class in /homeassistant/components/deconz/binary_sensor.py and changed async_update_callback to check 'on':
if self._device.on and ( force_update or self._device.changed_keys.intersection(keys) ):
This works but it seems better if it was implemented in pydeconz/sensor.py class Presence and the state method returns true and considers the config.on
I am happy to make a PR for either pydeconz or homeassistant if you're OK with the suggested modification. It's cleaner if it's implemented in Deconz REST API directly but that seems to take forever and I my C++ skills are rusty.
I use REST commands to turn the config.on to true / false so it's a bit more cumbersome but it works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.