Comments (4)
Extract with Trace
2020-07-11 16:58:55 DEBUG (ZiGate-Listen) [zigate] Raw packet received, b'\x01\x81\x02\x12\x02\x10,\x88\x8f\x19k\x02\x11\x02\x10\x02\x10\xff\x02\x11\x02\x10B\x02\x10\x1f\x02\x11!\x9f\x02\x1b\x02\x14!\xa8\x13\x02\x15!\x02\x1d\x02\x10\x02\x16$\x02\x12\x02\x10\x02\x10\x02\x10\x02\x10d)\x93\x02\x18e!E\x18\x02\x1a!5\xb5?\x03'
2020-07-11 16:58:55 DEBUG (ZiGate-Event Loop) [zigate] Dispatch ZIGATE_PACKET_RECEIVED
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Received response 0x8102: b'8f196b010000ff010042001f01219f0b0421a81305210d000624020000000064299308652145180a2135b5'
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] RESPONSE 0x8102 - Individual Attribute Report : sequence:143, addr:196b, endpoint:1, cluster:0, attribute:65281, status:0, data_type:66, size:31, data:01219f0b0421a81305210d000624020000000064299308652145180a2135b5, lqi:63
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Acquire Lock on device LUMI lumi.sensor_ht (196b) 00158d00034f8c03
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Release Lock on device LUMI lumi.sensor_ht (196b) 00158d00034f8c03
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Acquire Lock on device LUMI lumi.sensor_ht (196b) 00158d00034f8c03
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Release Lock on device LUMI lumi.sensor_ht (196b) 00158d00034f8c03
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Acquire Lock on device LUMI lumi.sensor_ht (196b) 00158d00034f8c03
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Release Lock on device LUMI lumi.sensor_ht (196b) 00158d00034f8c03
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Dispatch ZIGATE_ATTRIBUTE_UPDATED
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Handle special xiaomi attribute {'endpoint': 1, 'cluster': 0, 'addr': '196b', 'attribute': 65281, 'data': '01219f0b0421a81305210d000624020000000064299308652145180a2135b5', 'name': 'xiaomi', 'type': <class 'dict'>, 'value': {1: 2975, 4: 5032, 5: 13, 6: b'\x02\x00\x00\x00\x00', 100: 2195, 101: 6213, 10: 46389}}
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Acquire Lock on device LUMI lumi.sensor_ht (196b) 00158d00034f8c03
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Release Lock on device LUMI lumi.sensor_ht (196b) 00158d00034f8c03
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Acquire Lock on device LUMI lumi.sensor_ht (196b) 00158d00034f8c03
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Release Lock on device LUMI lumi.sensor_ht (196b) 00158d00034f8c03
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Acquire Lock on device LUMI lumi.sensor_ht (196b) 00158d00034f8c03
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Release Lock on device LUMI lumi.sensor_ht (196b) 00158d00034f8c03
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Dispatch ZIGATE_ATTRIBUTE_UPDATED
2020-07-11 16:58:55 DEBUG (ZiGate-Decode data) [zigate] Dispatch ZIGATE_RESPONSE_RECEIVED
2020-07-11 16:58:55 WARNING (Recorder) [homeassistant.components.recorder] Event is not JSON serializable: <Event zigate.attribute_updated[L]: endpoint=1, cluster=0, addr=196b, attribute=65281, data=01219f0b0421a81305210d000624020000000064299308652145180a2135b5, name=xiaomi, type=dict, value=1=2975, 4=5032, 5=13, 6=b'\x02\x00\x00\x00\x00', 100=2195, 101=6213, 10=46389, ieee=00158d00034f8c03, device_type=lumi.sensor_ht, entity_id=zigate.00158d00034f8c03>
2020-07-11 16:58:55 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1670276688] Unable to serialize to JSON. Bad data found at $.event.data.value.6=b'\x02\x00\x00\x00\x00'(<class 'bytes'>
from zigate.
Problem is coming when updating XIAOMI specific attribute 65281 as the "value" is not serializable in JSON as it contains json attributes as numeric value and not as string.
'value': {1: 2975, 4: 5032, 5: 13, 6: b'\x02\x00\x00\x00\x00', 100: 2195, 101: 6213, 10: 46389}
To fix this temporarily, I have changed my copy of init.py
I am not sure of the consequence but for a few days now it seems to work correctly.
def attribute_updated(**kwargs):
device = kwargs['device']
ieee = device.ieee
attribute = kwargs['attribute']
_LOGGER.debug('Update attribute for device {} {}'.format(device,
attribute))
entity = hass.data[DATA_ZIGATE_DEVICES].get(ieee)
event_data = attribute.copy()
if type(event_data.get('type')) == type:
event_data['type'] = event_data['type'].__name__
event_data['ieee'] = device.ieee
event_data['addr'] = device.addr
event_data['device_type'] = device.get_property_value('type')
if entity:
event_data['entity_id'] = entity.entity_id
#CS temp fix
if str(event_data['attribute']) != "65281":
hass.bus.fire('zigate.attribute_updated', event_data)
else:
_LOGGER.warning('ZIGATE CS SKIP ATTRIBUTE 65281')
from zigate.
it should be fixed in 0.40.1
from zigate.
It works! Thank you!
from zigate.
Related Issues (20)
- Question sur le SmartButton HUE HOT 1
- Erreur lors de l'installation des dépendances HOT 2
- Error when clicking a lot on xiaomi switch button HOT 1
- [New feature]&[Bug] "Permit join" for specific router HOT 3
- Unknown response 0x8035 on Aqara Window Door Sensor HOT 4
- Erreur JavaScript HOT 1
- Failed to eval "decode_xiaomi(value)
- How to join an existing network ? HOT 4
- Adding new devices HOT 1
- Uncaught TypeError: Cannot read property 'id' of undefined
- Probleme switch IKEA E1743
- Support for firmware 3.1d HOT 1
- Supprimer toutes les données pour migration Homeassistante --> ZHA HOT 2
- Zigate2zigpy utilisable ? HOT 2
- installation zigate HOT 5
- No available actions on Sunricher Micro Smart Dimmer HOT 13
- struct.error: unpack requires a buffer of 9 bytes
- Problem with MQTT publishing
- Erreur de dépendance Zigate HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zigate.