hellqvio86 / home_assistant_casambi

Home assistant Integration for Casambi Cloud lights
MIT License
25 stars 9 forks source link

Inconsistent state detection #20

Closed nils-hde closed 3 years ago

nils-hde commented 3 years ago

Unfortunately the entity state detection seems to be rather inconsistent for me. Shortly after it‘s turned off, the detected light state will switch back to ‚on‘. When it‘s turned on, it seems to detect that correctly.

However, sometimes after a restart of HA the entity will simply disappear entirely making it unusable.

Did you observe any similar behavior?

I should note this cannot be directly caused by the gateway because I am using a 2nd integration in parallel (Homebridge) which consistently works throughout all of the described issues.

hellqvio86 commented 3 years ago

I have seen it and I am affected it the same thing, but I have not had the time yet to iron it out.

Casambi are sending new unit event, that I haven't seen before.

They where giving another user an exception caused by a none defined variable, new json structure of the new useen event. That is now handled with a safe guard.

But the underlying library aiocasambi needs to handle the new unit events in a proper way.

Some of it needs to be rewritten anyway to handle colors and temperature.

But this is affecting all the installation and I will try to adress irlt when I have time 🙂

hellqvio86 commented 3 years ago

I have worked on the code base a bit and I have not been able to replicate it, please update to the latest version and if you still have th issue please open up a issue and provide logs.

nils-hde commented 3 years ago

I have uploaded a very recent log with v0.41 of the HACS plugin showing the weird behavior. The lamp or gateway seems to be reported as "offline" in between even though it is permanently connected.

Unfortunately there are some unrelated HTTP Sensor errors in between, sorry about that.

2021-05-20 07:23:23 DEBUG (MainThread) [custom_components.casambi.light] async_update_data started
2021-05-20 07:23:23 DEBUG (MainThread) [aiocasambi.controller] get_network_state request url: https://door.casambi.com/v1/networks/<REMOVED_NETWORK_ID>/state headers= {'Content-type': 'application/json', 'X-Casambi-Key': '<REMOVED_CASAMBI_KEY>', 'X-Casambi-Session': '<REMOVED_CASAMBI_SESSION>'}
2021-05-20 07:23:23 DEBUG (MainThread) [aiocasambi.controller] Not sending websocket ping, current_time: 1621488203.005397, last websocket ping: 1621488023.0034325
2021-05-20 07:23:23 DEBUG (MainThread) [aiocasambi.controller] request url: https://door.casambi.com/v1/networks/<REMOVED_NETWORK_ID>/state
2021-05-20 07:23:23 DEBUG (MainThread) [aiocasambi.controller] request: 200 application/json <ClientResponse(https://door.casambi.com/v1/networks/<REMOVED_NETWORK_ID>/state) [200 OK]>
<CIMultiDictProxy('Date': 'Thu, 20 May 2021 05:23:23 GMT', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'POST,GET,OPTIONS,PUT,DELETE,HEAD', 'Access-Control-Allow-Headers': '*', 'Access-Control-Max-Age': '728000', 'Access-Control-Allow-Credentials': 'true', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '717', 'Server': 'Jetty(9.2.11.v20150529)')>

2021-05-20 07:23:23 DEBUG (MainThread) [aiocasambi.controller] get_network_state response: {'dimLevel': 0.4627450980392157, 'activeScenes': [], 'id': '<REMOVED_NETWORK_ID>', 'revision': 14, 'grade': 'EVOLUTION', 'address': '78a15f649b5f', 'name': 'Home', 'type': 'PROTECTED', 'timezone': 'Europe/Berlin', 'gateway': {'name': '<REMOVED_PERSON_NAME>s G5'}, 'units': {'1': {'priority': 3, 'on': False, 'online': False, 'condition': 0, 'status': 'ok', 'activeSceneId': 0, 'controls': [[{'type': 'Dimmer', 'value': 0.0}, {'type': 'Vertical', 'value': 0.9254901960784314}, {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}]], 'dimLevel': 0.4627450980392157, 'id': 1, 'address': '<REMOVED_UNIT_ADDRESS>', 'name': 'Mito sospeso', 'firmwareVersion': '33.0', 'position': 0, 'fixtureId': 3098, 'groupId': 0, 'type': 'Luminaire'}}, 'photos': [], 'scenes': {}, 'groups': {}}
2021-05-20 07:23:23 DEBUG (MainThread) [custom_components.casambi.light] signalling_callback signal: unit pull update data: ['<REMOVED_KEY>']
2021-05-20 07:23:23 DEBUG (MainThread) [custom_components.casambi.light] update_unit_state: unit: <REMOVED_KEY> units: {'<REMOVED_KEY>': <Casambi light Mito sospeso: unit=<Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=0.4627450980392157 state=on online=False network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 0.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}} >}
2021-05-20 07:23:23 DEBUG (MainThread) [custom_components.casambi.light] Finished fetching light data in 0.134 seconds
2021-05-20 07:23:23 DEBUG (MainThread) [aiocasambi.units] get_min_mired returning 250 (in kv 4000)
2021-05-20 07:23:23 DEBUG (MainThread) [aiocasambi.units] get_max_mired returning 370 (in kv 2700)
2021-05-20 07:23:23 DEBUG (MainThread) [custom_components.casambi.light] async_update <Casambi light Mito sospeso: unit=<Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=0.4627450980392157 state=on online=False network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 0.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}} >
2021-05-20 07:23:23 INFO (MainThread) [custom_components.casambi.light] async_update: unit is not online: <Casambi light Mito sospeso: unit=<Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=0.4627450980392157 state=on online=False network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 0.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}} >
2021-05-20 07:23:23 DEBUG (MainThread) [aiocasambi.units] get_min_mired returning 250 (in kv 4000)
2021-05-20 07:23:23 DEBUG (MainThread) [aiocasambi.units] get_max_mired returning 370 (in kv 2700)
2021-05-20 07:23:24 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.total }}'
2021-05-20 07:23:31 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.total }}'
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.websocket] websocket running: wire_id: 9 msg: WSMessage(type=<WSMsgType.BINARY: 2>, data=b'{"address":"<REMOVED_UNIT_ADDRESS>","controls":[{"type":"Dimmer","value":1.0},{"type":"Vertical","value":0.9254901960784314},{"min":2700,"max":4000,"level":0.6692307692307692,"type":"CCT","value":3570.0}],"method":"unitChanged","fixtureId":3098,"priority":3.0,"condition":0.0,"wire":9,"activeSceneId":0,"sensors":{},"name":"Mito sospeso","online":true,"id":1,"dimLevel":0.9627450980392157,"on":true,"status":"ok"}', extra='')
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.controller] session_handler is handling SIGNAL_DATA: data
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.controller] message_handler recieved websocket message: {'address': '<REMOVED_UNIT_ADDRESS>', 'controls': [{'type': 'Dimmer', 'value': 1.0}, {'type': 'Vertical', 'value': 0.9254901960784314}, {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}], 'method': 'unitChanged', 'fixtureId': 3098, 'priority': 3.0, 'condition': 0.0, 'wire': 9, 'activeSceneId': 0, 'sensors': {}, 'name': 'Mito sospeso', 'online': True, 'id': 1, 'dimLevel': 0.9627450980392157, 'on': True, 'status': 'ok'}
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.units] process_unit_event Processing msg: {'address': '<REMOVED_UNIT_ADDRESS>', 'controls': [{'type': 'Dimmer', 'value': 1.0}, {'type': 'Vertical', 'value': 0.9254901960784314}, {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}], 'method': 'unitChanged', 'fixtureId': 3098, 'priority': 3.0, 'condition': 0.0, 'wire': 9, 'activeSceneId': 0, 'sensors': {}, 'name': 'Mito sospeso', 'online': True, 'id': 1, 'dimLevel': 0.9627450980392157, 'on': True, 'status': 'ok'}
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.units] method "unitChanged" control: {'type': 'Dimmer', 'value': 1.0}
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.units] key: <REMOVED_KEY> name: Mito sospeso msg: {'address': '<REMOVED_UNIT_ADDRESS>', 'controls': [{'type': 'Dimmer', 'value': 1.0}, {'type': 'Vertical', 'value': 0.9254901960784314}, {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}], 'method': 'unitChanged', 'fixtureId': 3098, 'priority': 3.0, 'condition': 0.0, 'wire': 9, 'activeSceneId': 0, 'sensors': {}, 'name': 'Mito sospeso', 'online': True, 'id': 1, 'dimLevel': 0.9627450980392157, 'on': True, 'status': 'ok'} method unit changed control value: 1.0
2021-05-20 07:23:36 INFO (MainThread) [aiocasambi.units] unit is back online: <Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=1.0 state=on online=False network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 0.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}} >
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.units] Adding following control to controls: {'type': 'Dimmer', 'value': 1.0}
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.units] Adding following control to controls: {'type': 'Vertical', 'value': 0.9254901960784314}
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.units] Adding following control to controls: {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.units] method "unitChanged" control: {'type': 'Vertical', 'value': 0.9254901960784314}
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.units] method "unitChanged" control: {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}
2021-05-20 07:23:36 DEBUG (MainThread) [custom_components.casambi.light] signalling_callback signal: data data: {'<REMOVED_KEY>': <Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=1.0 state=on online=True network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 1.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}} >}
2021-05-20 07:23:36 DEBUG (MainThread) [custom_components.casambi.light] process_update: self: <Casambi light Mito sospeso: unit=<Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=1.0 state=on online=True network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 1.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}} > data: <Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=1.0 state=on online=True network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 1.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}} >
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.websocket] websocket recived msg.type: aiohttp.WSMsgType.BINARY data: {'address': '<REMOVED_UNIT_ADDRESS>', 'controls': [{'type': 'Dimmer', 'value': 1.0}, {'type': 'Vertical', 'value': 0.9254901960784314}, {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}], 'method': 'unitChanged', 'fixtureId': 3098, 'priority': 3.0, 'condition': 0.0, 'wire': 9, 'activeSceneId': 0, 'sensors': {}, 'name': 'Mito sospeso', 'online': True, 'id': 1, 'dimLevel': 0.9627450980392157, 'on': True, 'status': 'ok'}
2021-05-20 07:23:36 DEBUG (MainThread) [custom_components.casambi.light] async_update <Casambi light Mito sospeso: unit=<Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=1.0 state=on online=True network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 1.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}} >
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.units] get_min_mired returning 250 (in kv 4000)
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.units] get_max_mired returning 370 (in kv 2700)
2021-05-20 07:23:36 DEBUG (MainThread) [aiocasambi.units] get_color_temp returning 280 (in kv 3570.0)
2021-05-20 07:23:38 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.total }}'
2021-05-20 07:23:42 DEBUG (MainThread) [custom_components.casambi.light] async_turn_on <Casambi light Mito sospeso: unit=<Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=1.0 state=on online=True network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 1.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}} > unit: <Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=1.0 state=on online=True network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 1.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.6692307692307692, 'type': 'CCT', 'value': 3570.0}} > kwargs: {'brightness': 255, 'color_temp': 276}
2021-05-20 07:23:42 DEBUG (MainThread) [custom_components.casambi.light] ATTR_COLOR_TEMP: 276
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] get_supported_color_temperature returning min=2700 max=4000 current=3570.0
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] set_unit_color_temperature value: 276, source: mired sending: {'wire': 9, 'method': 'controlUnit', 'id': 1, 'targetControls': {'ColorTemperature': {'value': 3672.9999999999995}, 'Colorsource': {'source': 'TW'}}}
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.controller] Not sending websocket ping, current_time: 1621488222.489971, last websocket ping: 1621488023.0034325
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.controller] Sending websocket message: msg {'wire': 9, 'method': 'controlUnit', 'id': 1, 'targetControls': {'ColorTemperature': {'value': 3672.9999999999995}, 'Colorsource': {'source': 'TW'}}}
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.websocket] send_message message {'wire': 9, 'method': 'controlUnit', 'id': 1, 'targetControls': {'ColorTemperature': {'value': 3672.9999999999995}, 'Colorsource': {'source': 'TW'}}}
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.websocket] websocket running: wire_id: 9 msg: WSMessage(type=<WSMsgType.BINARY: 2>, data=b'{"address":"<REMOVED_UNIT_ADDRESS>","controls":[{"type":"Dimmer","value":1.0},{"type":"Vertical","value":0.9254901960784314},{"min":2700,"max":4000,"level":0.7461538461538462,"type":"CCT","value":3670.0}],"method":"unitChanged","fixtureId":3098,"priority":3.0,"condition":0.0,"wire":9,"activeSceneId":0,"sensors":{},"name":"Mito sospeso","online":true,"id":1,"dimLevel":0.9627450980392157,"on":true,"status":"ok"}', extra='')
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.controller] session_handler is handling SIGNAL_DATA: data
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.controller] message_handler recieved websocket message: {'address': '<REMOVED_UNIT_ADDRESS>', 'controls': [{'type': 'Dimmer', 'value': 1.0}, {'type': 'Vertical', 'value': 0.9254901960784314}, {'min': 2700, 'max': 4000, 'level': 0.7461538461538462, 'type': 'CCT', 'value': 3670.0}], 'method': 'unitChanged', 'fixtureId': 3098, 'priority': 3.0, 'condition': 0.0, 'wire': 9, 'activeSceneId': 0, 'sensors': {}, 'name': 'Mito sospeso', 'online': True, 'id': 1, 'dimLevel': 0.9627450980392157, 'on': True, 'status': 'ok'}
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] process_unit_event Processing msg: {'address': '<REMOVED_UNIT_ADDRESS>', 'controls': [{'type': 'Dimmer', 'value': 1.0}, {'type': 'Vertical', 'value': 0.9254901960784314}, {'min': 2700, 'max': 4000, 'level': 0.7461538461538462, 'type': 'CCT', 'value': 3670.0}], 'method': 'unitChanged', 'fixtureId': 3098, 'priority': 3.0, 'condition': 0.0, 'wire': 9, 'activeSceneId': 0, 'sensors': {}, 'name': 'Mito sospeso', 'online': True, 'id': 1, 'dimLevel': 0.9627450980392157, 'on': True, 'status': 'ok'}
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] method "unitChanged" control: {'type': 'Dimmer', 'value': 1.0}
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] key: <REMOVED_KEY> name: Mito sospeso msg: {'address': '<REMOVED_UNIT_ADDRESS>', 'controls': [{'type': 'Dimmer', 'value': 1.0}, {'type': 'Vertical', 'value': 0.9254901960784314}, {'min': 2700, 'max': 4000, 'level': 0.7461538461538462, 'type': 'CCT', 'value': 3670.0}], 'method': 'unitChanged', 'fixtureId': 3098, 'priority': 3.0, 'condition': 0.0, 'wire': 9, 'activeSceneId': 0, 'sensors': {}, 'name': 'Mito sospeso', 'online': True, 'id': 1, 'dimLevel': 0.9627450980392157, 'on': True, 'status': 'ok'} method unit changed control value: 1.0
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] Adding following control to controls: {'type': 'Dimmer', 'value': 1.0}
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] Adding following control to controls: {'type': 'Vertical', 'value': 0.9254901960784314}
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] Adding following control to controls: {'min': 2700, 'max': 4000, 'level': 0.7461538461538462, 'type': 'CCT', 'value': 3670.0}
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] method "unitChanged" control: {'type': 'Vertical', 'value': 0.9254901960784314}
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] method "unitChanged" control: {'min': 2700, 'max': 4000, 'level': 0.7461538461538462, 'type': 'CCT', 'value': 3670.0}
2021-05-20 07:23:42 DEBUG (MainThread) [custom_components.casambi.light] signalling_callback signal: data data: {'<REMOVED_KEY>': <Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=1.0 state=on online=True network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 1.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.7461538461538462, 'type': 'CCT', 'value': 3670.0}} >}
2021-05-20 07:23:42 DEBUG (MainThread) [custom_components.casambi.light] process_update: self: <Casambi light Mito sospeso: unit=<Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=1.0 state=on online=True network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 1.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.7461538461538462, 'type': 'CCT', 'value': 3670.0}} > data: <Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=1.0 state=on online=True network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 1.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.7461538461538462, 'type': 'CCT', 'value': 3670.0}} >
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.websocket] websocket recived msg.type: aiohttp.WSMsgType.BINARY data: {'address': '<REMOVED_UNIT_ADDRESS>', 'controls': [{'type': 'Dimmer', 'value': 1.0}, {'type': 'Vertical', 'value': 0.9254901960784314}, {'min': 2700, 'max': 4000, 'level': 0.7461538461538462, 'type': 'CCT', 'value': 3670.0}], 'method': 'unitChanged', 'fixtureId': 3098, 'priority': 3.0, 'condition': 0.0, 'wire': 9, 'activeSceneId': 0, 'sensors': {}, 'name': 'Mito sospeso', 'online': True, 'id': 1, 'dimLevel': 0.9627450980392157, 'on': True, 'status': 'ok'}
2021-05-20 07:23:42 DEBUG (MainThread) [custom_components.casambi.light] async_update <Casambi light Mito sospeso: unit=<Unit Mito sospeso:unit_id=1 address=<REMOVED_UNIT_ADDRESS> value=1.0 state=on online=True network_id=<REMOVED_NETWORK_ID> wire_id=9 supports_brightness=True supports_color_temperature=True controls={'Dimmer': {'type': 'Dimmer', 'value': 1.0}, 'Vertical': {'type': 'Vertical', 'value': 0.9254901960784314}, 'CCT': {'min': 2700, 'max': 4000, 'level': 0.7461538461538462, 'type': 'CCT', 'value': 3670.0}} >
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] get_min_mired returning 250 (in kv 4000)
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] get_max_mired returning 370 (in kv 2700)
2021-05-20 07:23:42 DEBUG (MainThread) [aiocasambi.units] get_color_temp returning 272 (in kv 3670.0)

The complete log is in the attachment. home-assistant_casambi_marked.log

I think it is related to issue #3 which was fixed in v0.16 before?