-
Notifications
You must be signed in to change notification settings - Fork 22
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
Event is not JSON serializable: <Event zigate.attribute_updated[L] ...> #193
Comments
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 |
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
|
it should be fixed in 0.40.1 |
It works! Thank you! |
Thank you for your work first ;-)
Since latest HassIO Upgrade I notice that AppDaemon4 is disconnected every 5 or 6 min from Hassio.
Looking further in the main log, I notice that apparently there are some "events" from Zigate that cannot be serialized in JSON. This seems to come from all my zigbees.
Here are 3 of these errors
`
2020-07-07 12:22:09 WARNING (Recorder) [homeassistant.components.recorder] Event is not JSON serializable: <Event zigate.attribute_updated[L]: endpoint=1, cluster=0, addr=b668, attribute=65281, data=0121b30b0421a81305210700062402000000006429070965215c180a210000, name=xiaomi, type=dict, value=1=2995, 4=5032, 5=7, 6=b'\x02\x00\x00\x00\x00', 100=2311, 101=6236, 10=0, ieee=00158d0003a28772, device_type=lumi.sensor_ht, entity_id=zigate.00158d0003a28772>
2020-07-07 12:22:09 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1667796816] Unable to serialize to JSON. Bad data found at $.event.data.value.6=b'\x02\x00\x00\x00\x00'(<class 'bytes'>
2020-07-07 12:28:02 WARNING (Recorder) [homeassistant.components.recorder] Event is not JSON serializable: <Event zigate.attribute_updated[L]: endpoint=1, cluster=0, addr=e843, attribute=65281, data=0121a90b0421a81305211100062402000000006429b408652138170a2114ba, name=xiaomi, type=dict, value=1=2985, 4=5032, 5=17, 6=b'\x02\x00\x00\x00\x00', 100=2228, 101=5944, 10=47636, ieee=00158d0003a27993, device_type=lumi.sensor_ht, entity_id=zigate.00158d0003a27993>
2020-07-07 12:28:02 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1690188336] Unable to serialize to JSON. Bad data found at $.event.data.value.6=b'\x02\x00\x00\x00\x00'(<class 'bytes'>
2020-07-07 12:34:34 WARNING (Recorder) [homeassistant.components.recorder] Event is not JSON serializable: <Event zigate.attribute_updated[L]: endpoint=1, cluster=0, addr=a5db, attribute=65281, data=0121a90b0421a813052115000624010000000064293f09652188180a2114ba, name=xiaomi, type=dict, value=1=2985, 4=5032, 5=21, 6=b'\x01\x00\x00\x00\x00', 100=2367, 101=6280, 10=47636, ieee=00158d0003590e7a, device_type=lumi.sensor_ht, entity_id=zigate.00158d0003590e7a>
2020-07-07 12:34:34 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1669093520] Unable to serialize to JSON. Bad data found at $.event.data.value.6=b'\x01\x00\x00\x00\x00'(<class 'bytes'>
`
The text was updated successfully, but these errors were encountered: