Hi, from working with the Casambi consoles I can confirm that it is enough to have a network session. Controlling the lights via the console works after having the session id.
Regarding the HA integration: First of all thanks to @hellqvio for your work I have Hass.iO running. Therefore i created two new folders under …/config/custom_components: one folder “aiocasambi” where I stored the files out of the “src” subfolder from here: GitHub - hellqvio86/aiocasambi: aio library for Casambi lights. The second folder is “casambi” where I stored the files from here: GitHub - hellqvio86/home_assistant_casambi: Home assistant Integration for Casambi Cloud lights.
To the configuration.yaml I added:
# Light
light:
# Casambi
- platform: casambi
email: !secret casambi_email
api_key: !secret casambi_api_key
network_password: !secret casambi_network_password # The network password
user_password: !secret casambi_user_password # The site password for your user
After a HA restart I am receiving the following error entry in the home-assistant.log file:
2020-06-12 12:46:18 ERROR (MainThread) [custom_components.casambi.light] Error connecting to the Casambi
Traceback (most recent call last):
File “/config/custom_components/casambi/light.py”, line 97, in async_setup_platform
await controller.create_user_session()
File “/usr/local/lib/python3.7/site-packages/aiocasambi/controller.py”, line 80, in create_user_session
data = await self.request(“post”, url=url, json=auth, headers=headers)
File “/usr/local/lib/python3.7/site-packages/aiocasambi/controller.py”, line 215, in request
**kwargs,
File “/usr/local/lib/python3.7/site-packages/aiohttp/client.py”, line 1012, in aenter
self._resp = await self._coro
File “/usr/local/lib/python3.7/site-packages/aiohttp/client.py”, line 483, in _request
timeout=real_timeout
File “/usr/local/lib/python3.7/site-packages/aiohttp/connector.py”, line 523, in connect
proto = await self._create_connection(req, traces, timeout)
File “/usr/local/lib/python3.7/site-packages/aiohttp/connector.py”, line 859, in _create_connection
req, traces, timeout)
File “/usr/local/lib/python3.7/site-packages/aiohttp/connector.py”, line 986, in _create_direct_connection
req=req, client_error=client_error)
File “/usr/local/lib/python3.7/site-packages/aiohttp/connector.py”, line 936, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa
File “/usr/local/lib/python3.7/asyncio/base_events.py”, line 989, in create_connection
ssl_handshake_timeout=ssl_handshake_timeout)
File “/usr/local/lib/python3.7/asyncio/base_events.py”, line 1017, in _create_connection_transport
await waiter
concurrent.futures._base.CancelledErrorDuring handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/config/custom_components/casambi/light.py”, line 99, in async_setup_platform
await controller.start_websocket()
File “/usr/local/lib/python3.7/site-packages/async_timeout/init.py”, line 45, in exit
self._do_exit(exc_type)
File “/usr/local/lib/python3.7/site-packages/async_timeout/init.py”, line 92, in _do_exit
raise asyncio.TimeoutError
concurrent.futures._base.TimeoutError
Seems to be a timeout issue. Several restarts did not show any difference. Any idea from this protocol? Since I cannot use pip
with Hass.iO I made the manual copy&paste as described earlier. Maybe that doesn’t work?