Giter Site home page Giter Site logo

casambi-bt-hass's People

Contributors

cfenner avatar jakobjuelich avatar lkempf avatar luap99 avatar mintnl avatar tjorim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

casambi-bt-hass's Issues

How to determine integration status

Thanks a lot for this great job.
When this integration works it is exactly what I was looking for to control my Occhio/Casambi lights.
Unfortunately every now and then - hours or minutes - it disconnect or even stops.
Running it with debug-log enabled doesn't give me a glue what was going wrong and how to deal with that.
While it sometimes seems to recover by itself, when it completely stops I have to "re-load" it. Trying to automate this, I found that sometimes the re-load works immediately, sometimes the integration is "re-trying" itself a couple of times or it "fails to initialize". To not to reload it while it is still working/retrying, I would like to get an information about the current state/phase of the integration - like working, initializing, stopped.
Is this possible ? How / where to look for ?

-sb

Packet type 9 not implemented.

Logger: CasambiBt._client
Source: runner.py:120
First occurred: 12:02:08 AM (4 occurrences)
Last logged: 12:15:48 AM

Packet type 9 not implemented. Ignoring!
Invalid signature for packet b'010a9e000200f2d5654b348c1e8944503ac02a5b983cc8'!

PS: I also notice HA discovering the device again after the integration is already set up.

Unexpected error creating network 6D:2A:B2:63:D8:B0

Describe the bug
Updated integration, restarted HA and was greeted with an error (setting up entry Evolution for casambi_bt).
I turned the light on and off in the Casambi app directly without issues.
Afterwards I reloaded the integration and it worked all of a sudden, not sure why.

To Reproduce
Steps to reproduce the behavior:

  1. Install the latest version
  2. Restart Home Assistant
  3. See error

Expected behavior
I can control the light via HA.

Versions

  • HA version: 2023.12.0b2
  • Integration version: 18179d8

Logs

Logger: homeassistant.config_entries
Source: config_entries.py:402
First occurred: 00:05:58 (1 occurrences)
Last logged: 00:05:58

Error setting up entry Evolution for casambi_bt: Unexpected error creating network 6D:2A:B2:63:D8:B0
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 79, in _async_wrap_bluetooth_operation
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 539, in read_gatt_char
    return await self._client.bluetooth_gatt_read(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aioesphomeapi/client.py", line 753, in bluetooth_gatt_read
    return await self._bluetooth_gatt_read(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aioesphomeapi/client.py", line 783, in _bluetooth_gatt_read
    resp = await self._send_bluetooth_message_await_response(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aioesphomeapi/client.py", line 465, in _send_bluetooth_message_await_response
    raise BluetoothGATTAPIError(BluetoothGATTError.from_pb(resp))
aioesphomeapi.core.BluetoothGATTAPIError: Bluetooth GATT Error address=6D:2A:B2:63:D8:B0 handle=9 error=133 description=Error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/casambi_bt/__init__.py", line 83, in async_casmbi_api_setup
    await casa.connect(device, password)
  File "/usr/local/lib/python3.11/site-packages/CasambiBt/_casambi.py", line 139, in connect
    await self._connectClient()
  File "/usr/local/lib/python3.11/site-packages/CasambiBt/_casambi.py", line 146, in _connectClient
    await self._casaClient.exchangeKey(self._casaNetwork.getKeyStore())  # type: ignore[union-attr]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/CasambiBt/_client.py", line 148, in exchangeKey
    firstResp = await self._gattClient.read_gatt_char(CASA_AUTH_CHAR_UUID)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak/__init__.py", line 711, in read_gatt_char
    return await self._backend.read_gatt_char(char_specifier, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 106, in _async_wrap_bluetooth_operation
    raise BleakError(str(ex)) from ex
bleak.exc.BleakError: Bluetooth GATT Error address=6D:2A:B2:63:D8:B0 handle=9 error=133 description=Error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/casambi_bt/__init__.py", line 31, in async_setup_entry
    casa_api = await async_casmbi_api_setup(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/casambi_bt/__init__.py", line 95, in async_casmbi_api_setup
    raise ConfigEntryError(f"Unexpected error creating network {address}") from err
homeassistant.exceptions.ConfigEntryError: Unexpected error creating network 6D:2A:B2:63:D8:B0

Full (debug) log attached, including reload of integration.

home-assistant_2023-12-04T23-11-30.818Z.log

Issues with initial setup

Description of the bug
When homeassistant starts, casambi is being discovered, then I enter (what I think) is the correct password and I immediately get an unexpected error in return.
Thanks for any help in advance!

To Reproduce
Steps to reproduce the behavior:

  1. Boot homeassistant and go to devices.
  2. Click on casambi_bt
  3. Enter the password and check the MAC address is correct.
  4. be greeted with the error explained.

Screenshots
picture of the error
Unexpected error

Versions

  • HA version: v0.1.0
  • Integration version:

Logs
home-assistant_2023-12-27T17-41-16.959Z.log

'h' format requires -32768 <= number <= 32767

Hi there. Great job. Some of my lights dont turn on with error 'h' format requires -32768 <= number <= 32767

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/casambi_bt/light.py:230
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 11:12:34 AM (10 occurrences)
Last logged: 11:16:49 AM

[547396467968] 'h' format requires -32768 <= number <= 32767
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1808, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1845, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 686, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 961, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 726, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 572, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/config/custom_components/casambi_bt/light.py", line 230, in async_turn_on
    await self._api.casa.turnOn(self._obj)
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_casambi.py", line 246, in turnOn
    await self._send(target, b"\xff\x05", OpCode.SetLevel)
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_casambi.py", line 277, in _send
    opPkt = self._opContext.prepareOperation(opcode, targetCode, state)
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_operation.py", line 26, in prepareOperation
    packet = struct.pack(">hbhhh", flags, op, self.origin, target, 0)
struct.error: 'h' format requires -32768 <= number <= 32767

remove luminaires

I hade an issue with my light and got them replaced. Now I have a bunch of unused lights that I cannot remove. I removed them in the casaba app but they're still there in the integration.

Bildschirmfoto 2023-07-26 um 22 37 29

I can disable them, but I really would like to remove them.

feature request: support tunable white

My luminaries come a tunable white and I would like to control this via HA:

Unit(
  _typeId=22133, deviceId=1, uuid='x', address='x', name='CURVED ', 
  firmwareVersion='9472', 
  unitType=UnitType(
    id=22133, model='CURVED ', manufacturer='OLIGO', 
    mode='PWM/4ch/Dim,Dim,TW', stateLength=3, 
    controls=[
      UnitControl(type=<UnitControlType.DIMMER: 0>, offset=0, length=8, default=128, readonly=False), 
      UnitControl(type=<UnitControlType.DIMMER: 0>, offset=8, length=8, default=128, readonly=False), 
      UnitControl(type=<UnitControlType.UNKOWN: 99>, offset=16, length=8, default=46, readonly=False)]
    ),
    _state=None, _on=False, _online=True
  )

The third control is stated here as UNKNOWN which is the TW control. It's also mentioned in the mode: PWM/4ch/Dim,Dim,TW

HA 2023.2.0b0 async_setup_platforms instead of async_forward_entry_setups

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:77
First occurred: 11:16:53 PM (3 occurrences)
Last logged: 11:18:03 PM

Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups; this will fail in version 2023.3. Please report issue to the custom integration author for casambi_bt using this method at custom_components/casambi_bt/__init__.py, line 38: hass.config_entries.async_setup_platforms(entry, PLATFORMS)

Add support for CBU-ASD RELAY

Amazing job! With version 7 everything works well. Can you add support for cbu-asd-relay also? I have 2 of them in my home and are the only that the integration can not find.

Thank you!
cbu-asd-relay

Connection setup to Casambi network fails

Describe the bug
My Casambi network is automatically discovered, but when trying to setup the connection, the spinner keeps spinning forever and nothing else happens.

To Reproduce
Steps to reproduce the behavior:

  1. Wait for the network to be discovered automatically.
  2. Click on "Configure".
  3. Enter the network password.
  4. Get hypnotised by the spinner.

Versions

  • HA version: 2023.5.3
  • Integration version: v0.0.7

Logs
2023-05-21 15:39:24.643 INFO (MainThread) [CasambiBt._casambi] Trying to connect to casambi network 63:CA:83:AC:XX:XX...
2023-05-21 15:39:24.646 INFO (MainThread) [CasambiBt._keystore] Loading keys...
2023-05-21 15:39:24.656 INFO (MainThread) [CasambiBt._keystore] Loaded 1 keys.
2023-05-21 15:39:24.657 INFO (MainThread) [CasambiBt._network] Loading session...
2023-05-21 15:39:24.660 INFO (MainThread) [CasambiBt._network] Loading unit type cache...
2023-05-21 15:39:24.663 INFO (MainThread) [CasambiBt._network] Getting network id...
2023-05-21 15:39:24.789 INFO (MainThread) [CasambiBt._network] Got network id TYqXXXXXwKrArqkOQVtXcw1QOgdLIjkU.
2023-05-21 15:39:24.790 INFO (MainThread) [CasambiBt._network] Updating network...
2023-05-21 15:39:24.794 INFO (MainThread) [CasambiBt._network] Loaded cached network. Revision: 35
2023-05-21 15:39:24.821 DEBUG (MainThread) [CasambiBt._network] Network: {"status":"UPTODATE","revision":35.0,"role":1}
2023-05-21 15:39:24.822 INFO (MainThread) [CasambiBt._keystore] Key with id 10 already exists. Skipping...
2023-05-21 15:39:24.823 INFO (MainThread) [CasambiBt._network] Fetching unit type for id 6660...
2023-05-21 15:39:24.823 INFO (MainThread) [CasambiBt._network] Using cached type.
2023-05-21 15:39:24.823 INFO (MainThread) [CasambiBt._network] Saving type cache...
2023-05-21 15:39:24.830 INFO (MainThread) [CasambiBt._network] Network updated.
2023-05-21 15:39:24.831 INFO (MainThread) [CasambiBt._client] Connection to 63:CA:83:AC:XX:XX

Unable to import component: cannot import name 'IDENTIFIER_NETWORK_ID'

Describe the bug
Can not setup latest version after updating and restarting HA.
Seems like this bug was introduced in #43.

To Reproduce
Steps to reproduce the behavior:

  1. Install the latest version
  2. Restart Home Assistant
  3. See error

Expected behavior
Casambi keeps working as always and has no issues with the IDENTIFIER_NETWORK_ID on this line:

from .const import DOMAIN, IDENTIFIER_NETWORK_ID
@CFenner

Versions

  • HA version: 2023.12.0b2
  • Integration version: 42bc6c6

Logs

Logger: homeassistant.setup
Source: setup.py:251
First occurred: 21:00:31 (1 occurrences)
Last logged: 21:00:31

Setup failed for custom integration 'casambi_bt': Unable to import component: cannot import name 'IDENTIFIER_NETWORK_ID' from 'custom_components.casambi_bt.const' (/config/custom_components/casambi_bt/const.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 251, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 814, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/casambi_bt/__init__.py", line 22, in <module>
    from .const import DOMAIN, IDENTIFIER_NETWORK_ID
ImportError: cannot import name 'IDENTIFIER_NETWORK_ID' from 'custom_components.casambi_bt.const' (/config/custom_components/casambi_bt/const.py)

Unexpected error creating network

Using a bt proxy I get the following error on HA restart. Reloading the integration afterwards fixes it.

Logs:

This error originated from a custom integration.

Logger: custom_components.casambi_bt
Source: custom_components/casambi_bt/__init__.py:79
Integration: Casambi Bluetooth (documentation)
First occurred: 9:19:04 AM (1 occurrences)
Last logged: 9:19:04 AM

Unexpected error creating network 6D:2A:B2:63:D8:B0
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 130, in _call_sslobject_method
    result = func(*args)
  File "/usr/local/lib/python3.10/ssl.py", line 917, in read
    v = self._sslobj.read(len)
ssl.SSLWantReadError: The operation did not complete (read) (_ssl.c:2548)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 34, in read
    return await self._stream.receive(max_bytes=max_bytes)
  File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 195, in receive
    data = await self._call_sslobject_method(self._ssl_object.read, max_bytes)
  File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 137, in _call_sslobject_method
    data = await self.transport_stream.receive()
  File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 1265, in receive
    await self._protocol.read_event.wait()
  File "/usr/local/lib/python3.10/asyncio/locks.py", line 214, in wait
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
    yield
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 32, in read
    with anyio.fail_after(timeout):
  File "/usr/local/lib/python3.10/site-packages/anyio/_core/_tasks.py", line 118, in __exit__
    raise TimeoutError
TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
    yield
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
    response = await connection.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 90, in handle_async_request
    return await self._connection.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 112, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 91, in handle_async_request
    ) = await self._receive_response_headers(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 155, in _receive_response_headers
    event = await self._receive_event(timeout=timeout)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 191, in _receive_event
    data = await self._network_stream.read(
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 31, in read
    with map_exceptions(exc_map):
  File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc)
httpcore.ReadTimeout

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/casambi_bt/__init__.py", line 79, in async_casmbi_api_setup
    await casa.connect(device, password)
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_casambi.py", line 124, in connect
    await self._casaNetwork.update()
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_network.py", line 129, in update
    res = await self._httpClient.put(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1885, in put
    return await self.request(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1533, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1620, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1648, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1685, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1722, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 352, in handle_async_request
    with map_httpcore_exceptions():
  File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ReadTimeout

I sometimes also notice the controls don't work after a while despite being connected and the device available. I'll enable the debugs and try to reproduce.

Not connecting to Casambi Network

Describe the bug
When trying to connect to a discovered network a non descriptive standard error is given. When looking into the logfile more information is shown (see below).
Seems that no backend connections are available (using a dedicated bluetooth 5.0 dongle).

Thank you for the assistance!

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
I expected that the casammbi devices would be shown, in this case I limited the network to only 1 device Xitanium 20W/m from signify with firmware evolution 39.40.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions

  • HA version: latest version 2023.09.2
  • Integration version: 0.07

Logs
This error originated from a custom integration.

Logger: custom_components.casambi_bt.config_flow
Source: custom_components/casambi_bt/config_flow.py:41
Integration: casambi_bt (documentation)
First occurred: 9:58:27 PM (1 occurrences)
Last logged: 9:58:27 PM

Unexpected exception
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/bleak_retry_connector/init.py", line 350, in establish_connection
await client.connect(
File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 273, in connect
wrapped_backend = self._async_get_best_available_backend_and_device(manager)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 375, in _async_get_best_available_backend_and_device
raise BleakError(
bleak.exc.BleakError: No backend with an available connection slot that can reach address D8:50:5B:98:7F:CE was found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/CasambiBt/_client.py", line 119, in connect
self._gattClient = await establish_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/bleak_retry_connector/init.py", line 438, in establish_connection
_raise_if_needed(name, device.address, exc)
File "/usr/local/lib/python3.11/site-packages/bleak_retry_connector/init.py", line 319, in _raise_if_needed
raise BleakOutOfConnectionSlotsError(
bleak_retry_connector.BleakOutOfConnectionSlotsError: Casambi Network - D8:50:5B:98:7F:CE: Failed to connect after 9 attempt(s): No backend with an available connection slot that can reach address D8:50:5B:98:7F:CE was found: The proxy/adapter is out of connection slots or the device is no longer reachable; Add additional proxies (https://esphome.github.io/bluetooth-proxies/) near this device

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/config/custom_components/casambi_bt/config_flow.py", line 124, in async_step_user
info = await _validate_input(self.hass, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/casambi_bt/config_flow.py", line 41, in _validate_input
await casa.connect(bt_device, data[CONF_PASSWORD])
File "/usr/local/lib/python3.11/site-packages/CasambiBt/_casambi.py", line 139, in connect
await self._connectClient()
File "/usr/local/lib/python3.11/site-packages/CasambiBt/_casambi.py", line 144, in _connectClient
await self._casaClient.connect()
File "/usr/local/lib/python3.11/site-packages/CasambiBt/_client.py", line 128, in connect
raise BluetoothError(e.args) from e
CasambiBt.errors.BluetoothError: ('Casambi Network - D8:50:5B:98:7F:CE: Failed to connect after 9 attempt(s): No backend with an available connection slot that can reach address D8:50:5B:98:7F:CE was found: The proxy/adapter is out of connection slots or the device is no longer reachable; Add additional proxies (https://esphome.github.io/bluetooth-proxies/) near this device',)

'resume automation' feature

You can setup presence detectors to turn on your lights, and then turn off after a defined 'timeout'. If you switch the lights on or off manually, the automation is disabled and no longer reacts to human presence. In the Casambi app, there is a button which resets this behaviour called 'Resume automation'. Is there a way to implement this?

Scenes not working in 0.1.1

Describe the bug
Since upgrading to 0.1.1, all casambi scenes are not working anymore. The scenes are imported correctly from the casambi network, but when activating a scene in HomeAssistant, i get the following error message:

Fehler beim Aufrufen des Diensts scene/turn_on. 'CasambiScene' object has no attribute 'scene'

It was working on 0.1.0

(The blinds of the pergola do act as a casambi light device)

To Reproduce
Steps to reproduce the behavior:

  1. Activate a scene
  2. Error message appears

Expected behavior
Casambi scenes can be activated in HA as it was working before in 0.1.0

Screenshots
casambi-bt-bug

Versions

  • HA version: 2024.3.1
  • Integration version: 0.1.1

Logs

2024-03-15 09:12:14.408 INFO (MainThread) [custom_components.casambi_bt.scene] Switching to scene Lamellen offen
2024-03-15 09:12:14.413 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472578982464] 'CasambiScene' object has no attribute 'scene'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/scene/__init__.py", line 114, in _async_activate
    await self.async_activate(**kwargs)
  File "/config/custom_components/casambi_bt/scene.py", line 50, in async_activate
    await self._api.casa.switchToScene(self.scene, brightness)
                                       ^^^^^^^^^^
AttributeError: 'CasambiScene' object has no attribute 'scene'

Casambi discovers Samsung television

Describe the bug
Last week I noticed my HA instance discovered a new Casambi light.
I tried connecting to it after enabling debug (thinking it was #27 again) but it failed.
Looking into the logs it seems like it found my new Samsung Television.

To Reproduce
Steps to reproduce the behavior:

  1. Buy a Samsung Neo QLED QN85C 55" television.
  2. Wait until HA discovers it
  3. Try to connect to it
  4. See error

Expected behavior
Casambi does not think a television is a light.

Versions

  • HA version: 2023.12.0b2
  • Integration version: b9766d6

Logs

2023-12-04 20:11:04.219 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration casambi_bt which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-12-04 20:15:50.851 DEBUG (MainThread) [custom_components.casambi_bt.config_flow] Discovery: [C8:12:0B:09:81:7D] Television from e8:9f:6d:08:ad:74.Advertisement: AdvertisementData(local_name='Television', manufacturer_data={117: b'\x02\x18\x14\xa1AZ\x88b\xe0\xf9F\x19\xeb\xe9\x00ng\x83', 963: b'm*\xb2c\xd8\xb0\n', 224: b'\x00\x93\xcaX\x93\x08'}, service_data={'0000fe9f-0000-1000-8000-00805f9b34fb': b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'}, service_uuids=['0000fe4d-0000-1000-8000-00805f9b34fb', '0000fe9f-0000-1000-8000-00805f9b34fb', '00000601-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-70).
2023-12-04 20:15:50.852 DEBUG (MainThread) [custom_components.casambi_bt.config_flow] Discovery: [6D:2A:B2:63:D8:B0] CBU-PWM4 RGBW from e8:9f:6d:08:ad:74.Advertisement: AdvertisementData(local_name='CBU-PWM4 RGBW', manufacturer_data={963: b'm*\xb2c\xd8\xb0\n'}, service_uuids=['0000fe4d-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-80).
2023-12-04 20:18:06.084 INFO (MainThread) [CasambiBt._casambi] Trying to connect to casambi network C8:12:0B:09:81:7D...
2023-12-04 20:18:06.092 INFO (MainThread) [CasambiBt._network] Getting network id...
2023-12-04 20:18:10.889 INFO (MainThread) [CasambiBt._casambi] Trying to connect to casambi network 6D:2A:B2:63:D8:B0...
2023-12-04 20:18:10.891 INFO (MainThread) [CasambiBt._keystore] Loading keys...
2023-12-04 20:18:10.900 INFO (MainThread) [CasambiBt._keystore] Loaded 4 keys.
2023-12-04 20:18:10.901 INFO (MainThread) [CasambiBt._network] Loading session...
2023-12-04 20:18:10.902 INFO (MainThread) [CasambiBt._network] Loading unit type cache...
2023-12-04 20:18:10.904 INFO (MainThread) [CasambiBt._network] Getting network id...
2023-12-04 20:18:10.954 INFO (MainThread) [CasambiBt._network] Got network id gQLL7hvDEDwJsw55c6RI25eQXEXzYeSx.
2023-12-04 20:18:10.954 INFO (MainThread) [CasambiBt._network] Updating network...
2023-12-04 20:18:10.958 INFO (MainThread) [CasambiBt._network] Loaded cached network. Revision: 21
2023-12-04 20:18:10.986 DEBUG (MainThread) [CasambiBt._network] Network: {"status":"UPTODATE","revision":21.0,"role":3}
2023-12-04 20:18:10.986 INFO (MainThread) [CasambiBt._keystore] Key with id 3 already exists. Skipping...
2023-12-04 20:18:10.986 INFO (MainThread) [CasambiBt._keystore] Key with id 4 already exists. Skipping...
2023-12-04 20:18:10.987 INFO (MainThread) [CasambiBt._keystore] Key with id 5 already exists. Skipping...
2023-12-04 20:18:10.987 INFO (MainThread) [CasambiBt._keystore] Key with id 6 already exists. Skipping...
2023-12-04 20:18:10.987 INFO (MainThread) [CasambiBt._network] Fetching unit type for id 4027...
2023-12-04 20:18:10.987 INFO (MainThread) [CasambiBt._network] Using cached type.
2023-12-04 20:18:10.987 INFO (MainThread) [CasambiBt._network] Saving type cache...
2023-12-04 20:18:10.993 INFO (MainThread) [CasambiBt._network] Network updated.
2023-12-04 20:18:10.993 INFO (MainThread) [CasambiBt._client] Connection to 6D:2A:B2:63:D8:B0
2023-12-04 20:18:11.410 INFO (MainThread) [CasambiBt._client] Connected to 6D:2A:B2:63:D8:B0
2023-12-04 20:18:11.410 INFO (MainThread) [CasambiBt._client] Starting key exchange...
2023-12-04 20:18:11.494 DEBUG (MainThread) [CasambiBt._client] Got b'010a9e000200f25cfc5df29dfde32f8288e67e5019a0bf'
2023-12-04 20:18:11.494 DEBUG (MainThread) [CasambiBt._client] Parsed mtu 158, unit 2, flags 242, nonce b'5cfc5df29dfde32f8288e67e5019a0bf'
2023-12-04 20:18:11.494 DEBUG (MainThread) [CasambiBt._client] Starting notify
2023-12-04 20:18:11.728 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 9): Unknown: b'0215f539687e72b9d102de893ef673f7326ad9f9ae3ffb676f4a218c303c1b45051d3fbba543d040297e9fc562d4965fc64ea802767225f6af045a7b9fccc0a800'
2023-12-04 20:18:11.729 DEBUG (MainThread) [CasambiBt._client] Got public key 2383664660246839990658164409145232915015893628853366899732760143286939284757, 298160958805870748632873230751916260302610907074547419555643965189452939037
2023-12-04 20:18:12.044 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 9): Unknown: b'03'
2023-12-04 20:18:12.045 INFO (MainThread) [CasambiBt._client] Key exchange sucessful
2023-12-04 20:18:12.045 INFO (MainThread) [CasambiBt._client] Authenicating channel...
2023-12-04 20:18:12.045 DEBUG (MainThread) [CasambiBt._client] Auth digest: b'1f3712eada2b514ab892a74ce433c38607965c57433c4b1622b553b66fd32a25'
2023-12-04 20:18:12.045 INFO (MainThread) [CasambiBt._encryption] Encrypting packet: b'0100000004031f3712eada2b514ab892a74ce433c38607965c57433c4b1622b553b66fd32a25' of len 38 with nonce b'5cfc5df2010000008288e67e5019a0bf'
2023-12-04 20:18:12.048 DEBUG (MainThread) [CasambiBt._encryption] Encrypted packet: b'0100000075f6e192ed3eae47f0ed8ea776e3f8f46ca6cb9da6ca2eac09b85c71f9c74d55aaa8'
2023-12-04 20:18:12.048 DEBUG (MainThread) [CasambiBt._encryption] Authenticated packet: b'0100000075f6e192ed3eae47f0ed8ea776e3f8f46ca6cb9da6ca2eac09b85c71f9c74d55aaa8ba14d1bf109e920693c7ef7ecd50c259'
2023-12-04 20:18:12.415 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 9): Unknown: b'0100008000648ea60a3f7bf557a1a3365167c612e293a594acac278e91a1476d7237e660356f7fa38b6d8f6bf8cba780c29a8393b319'
2023-12-04 20:18:12.415 INFO (MainThread) [CasambiBt._client] Processing authentication response...
2023-12-04 20:18:12.415 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'0100008000648ea60a3f7bf557a1a3365167c612e293a594acac278e91a1476d7237e660356f7fa38b6d8f6bf8cba780c29a8393b319' of len 54 with nonce b'010000809dfde32f8288e67e5019a0bf'
2023-12-04 20:18:12.418 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'05034816816deab7bfd67185372d5c2f7798147dadfbfcfa06e58b2477d148e5bcd1'
2023-12-04 20:18:12.419 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 9): Unknown: b'02000080869a9cb2a13357dbec8aff415d57c78cb3950eed24b2b3d0'
2023-12-04 20:18:12.419 INFO (MainThread) [CasambiBt._client] Processing authentication response...
2023-12-04 20:18:12.419 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'02000080869a9cb2a13357dbec8aff415d57c78cb3950eed24b2b3d0' of len 28 with nonce b'020000809dfde32f8288e67e5019a0bf'
2023-12-04 20:18:12.420 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'0602033300ff0000'
2023-12-04 20:18:12.421 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 9): Unknown: b'030000804ce9f7430a8a7510e2ed2b974b396600de12c9e5430a33a5bc68d5'
2023-12-04 20:18:12.421 INFO (MainThread) [CasambiBt._client] Processing authentication response...
2023-12-04 20:18:12.421 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'030000804ce9f7430a8a7510e2ed2b974b396600de12c9e5430a33a5bc68d5' of len 31 with nonce b'030000809dfde32f8288e67e5019a0bf'
2023-12-04 20:18:12.422 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'09050202830a04840a0400'
2023-12-04 20:18:12.423 INFO (MainThread) [CasambiBt._client] Authentication successful
2023-12-04 20:18:12.423 INFO (MainThread) [CasambiBt._client] Disconnecting...
2023-12-04 20:18:12.516 INFO (MainThread) [CasambiBt._client] Received disconnect callback from 6D:2A:B2:63:D8:B0
2023-12-04 20:18:12.517 INFO (MainThread) [CasambiBt._client] Disconnected.
2023-12-04 20:18:12.521 INFO (MainThread) [CasambiBt._casambi] Trying to connect to casambi network 6D:2A:B2:63:D8:B0...
2023-12-04 20:18:12.524 INFO (MainThread) [CasambiBt._keystore] Loading keys...
2023-12-04 20:18:12.525 INFO (MainThread) [CasambiBt._keystore] Loaded 4 keys.
2023-12-04 20:18:12.526 INFO (MainThread) [CasambiBt._network] Loading session...
2023-12-04 20:18:12.528 INFO (MainThread) [CasambiBt._network] Loading unit type cache...
2023-12-04 20:18:12.529 INFO (MainThread) [CasambiBt._network] Getting network id...
2023-12-04 20:18:12.573 INFO (MainThread) [CasambiBt._network] Got network id gQLL7hvDEDwJsw55c6RI25eQXEXzYeSx.
2023-12-04 20:18:12.573 INFO (MainThread) [CasambiBt._network] Updating network...
2023-12-04 20:18:12.575 INFO (MainThread) [CasambiBt._network] Loaded cached network. Revision: 21
2023-12-04 20:18:12.618 DEBUG (MainThread) [CasambiBt._network] Network: {"status":"UPTODATE","revision":21.0,"role":3}
2023-12-04 20:18:12.619 INFO (MainThread) [CasambiBt._keystore] Key with id 3 already exists. Skipping...
2023-12-04 20:18:12.619 INFO (MainThread) [CasambiBt._keystore] Key with id 4 already exists. Skipping...
2023-12-04 20:18:12.619 INFO (MainThread) [CasambiBt._keystore] Key with id 5 already exists. Skipping...
2023-12-04 20:18:12.619 INFO (MainThread) [CasambiBt._keystore] Key with id 6 already exists. Skipping...
2023-12-04 20:18:12.620 INFO (MainThread) [CasambiBt._network] Fetching unit type for id 4027...
2023-12-04 20:18:12.620 INFO (MainThread) [CasambiBt._network] Using cached type.
2023-12-04 20:18:12.620 INFO (MainThread) [CasambiBt._network] Saving type cache...
2023-12-04 20:18:12.624 INFO (MainThread) [CasambiBt._network] Network updated.
2023-12-04 20:18:12.625 INFO (MainThread) [CasambiBt._client] Connection to 6D:2A:B2:63:D8:B0
2023-12-04 20:18:12.825 INFO (MainThread) [CasambiBt._client] Connected to 6D:2A:B2:63:D8:B0
2023-12-04 20:18:12.825 INFO (MainThread) [CasambiBt._client] Starting key exchange...
2023-12-04 20:18:12.937 DEBUG (MainThread) [CasambiBt._client] Got b'010a9e000200f2938ee36fcefb4553964c208de51d80bf'
2023-12-04 20:18:12.937 DEBUG (MainThread) [CasambiBt._client] Parsed mtu 158, unit 2, flags 242, nonce b'938ee36fcefb4553964c208de51d80bf'
2023-12-04 20:18:12.937 DEBUG (MainThread) [CasambiBt._client] Starting notify
2023-12-04 20:18:13.234 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 9): Unknown: b'02e88be77bef01451514e68d8a574fba25ef4bee8972519680357942e22b8c20a17915c0bebff4062563f960d50f6f0b5c056a7e54375257251fc24f9a4cc65ae6'
2023-12-04 20:18:13.234 DEBUG (MainThread) [CasambiBt._client] Got public key 72879875155572977710692027240374265142041289051430942387021240509210730925032, 104192340020964838724056831772479677799773853177530141337950952625138963584377
2023-12-04 20:18:13.492 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 9): Unknown: b'03'
2023-12-04 20:18:13.493 INFO (MainThread) [CasambiBt._client] Key exchange sucessful
2023-12-04 20:18:13.494 INFO (MainThread) [CasambiBt._client] Authenicating channel...
2023-12-04 20:18:13.494 DEBUG (MainThread) [CasambiBt._client] Auth digest: b'4ef47faad345bc99b50dc9ef7c61d0047a94f93ebc6d57411abc40cf02938d7a'
2023-12-04 20:18:13.495 INFO (MainThread) [CasambiBt._encryption] Encrypting packet: b'0100000004034ef47faad345bc99b50dc9ef7c61d0047a94f93ebc6d57411abc40cf02938d7a' of len 38 with nonce b'938ee36f01000000964c208de51d80bf'
2023-12-04 20:18:13.501 DEBUG (MainThread) [CasambiBt._encryption] Encrypted packet: b'01000000c1511ffc1acf77667284fa6c67f8e440375aa70863c5558a62922a1bcca388f6a47d'
2023-12-04 20:18:13.502 DEBUG (MainThread) [CasambiBt._encryption] Authenticated packet: b'01000000c1511ffc1acf77667284fa6c67f8e440375aa70863c5558a62922a1bcca388f6a47d8f8760b6618e834acb74dfb088f8db1d'
2023-12-04 20:18:13.784 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 9): Unknown: b'010000805b9b69201e0e69f1c15ec4f019189c59e4ff4936bc8a51a57d7c6e965de438ccd7c1e7079af45fdcea87c7cd1c5141884e2d'
2023-12-04 20:18:13.785 INFO (MainThread) [CasambiBt._client] Processing authentication response...
2023-12-04 20:18:13.785 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'010000805b9b69201e0e69f1c15ec4f019189c59e4ff4936bc8a51a57d7c6e965de438ccd7c1e7079af45fdcea87c7cd1c5141884e2d' of len 54 with nonce b'01000080cefb4553964c208de51d80bf'
2023-12-04 20:18:13.787 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'0503ea4c9d140b382e991436db395650a35a213cdc0168ab6d04759baa63b5124c68'
2023-12-04 20:18:13.788 INFO (MainThread) [CasambiBt._client] Authentication successful
2023-12-04 20:18:13.789 INFO (MainThread) [CasambiBt._casambi] Registerd unit changed handler <bound method CasambiApi._unit_changed_handler of <custom_components.casambi_bt.CasambiApi object at 0x7f1ede3610>>
2023-12-04 20:18:13.868 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 9): Unknown: b'02000080e640c5f88933df6e0aa85856474799f98e35e498dce6f74d'
2023-12-04 20:18:13.868 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'02000080e640c5f88933df6e0aa85856474799f98e35e498dce6f74d' of len 28 with nonce b'02000080cefb4553964c208de51d80bf'
2023-12-04 20:18:13.868 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'0602033300ff0000'
2023-12-04 20:18:13.870 DEBUG (MainThread) [CasambiBt._client] Incoming data of type 6: b'0602033300ff0000'
2023-12-04 20:18:13.870 INFO (MainThread) [CasambiBt._client] Parsing incoming unit states...
2023-12-04 20:18:13.870 DEBUG (MainThread) [CasambiBt._client] Incoming unit state: b'02033300ff0000'
2023-12-04 20:18:13.870 DEBUG (MainThread) [CasambiBt._client] Parsed state: Id 2, prio 3, online True, on True, state b'00ff0000'1
2023-12-04 20:18:13.870 INFO (MainThread) [CasambiBt._casambi] Incomming data callback of type 6
2023-12-04 20:18:13.870 DEBUG (MainThread) [CasambiBt._casambi] Handling changed state b'00ff0000' for unit 2
2023-12-04 20:18:13.870 DEBUG (MainThread) [CasambiBt._unit] Parsed b'00ff0000' to UnitState(dimmer=0, vertical=None, rgb=(255, 0, 0), white=0, temperature=None)
2023-12-04 20:18:13.870 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 2
2023-12-04 20:18:13.871 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 9): Unknown: b'03000080fb2aa90228dc0c572c045b433a357c22217e178c5de134fff8b1bf'
2023-12-04 20:18:13.871 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'03000080fb2aa90228dc0c572c045b433a357c22217e178c5de134fff8b1bf' of len 31 with nonce b'03000080cefb4553964c208de51d80bf'
2023-12-04 20:18:13.873 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'09050202830a04840a0400'
2023-12-04 20:18:13.874 DEBUG (MainThread) [CasambiBt._client] Incoming data of type 9: b'09050202830a04840a0400'
2023-12-04 20:18:21.755 INFO (MainThread) [CasambiBt._casambi] Trying to connect to casambi network C8:12:0B:09:81:7D...
2023-12-04 20:18:21.758 INFO (MainThread) [CasambiBt._network] Getting network id...

Logo in dark Mode Not visible

image

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions

  • HA version:
  • Integration version:

Logs
See https://github.com/lkempf/casambi-bt-hass#reporting-issues on how to enable logs. Please make sure to at least include the log of the first connection with the network (be restarting HA or reloading the integration) and the log at the time an error happens (if applicable).

Can't get brightness above 24 %

First; love this integration! works so much better than the integration through the gateway and android app!

Second; I am facing a small issue, that I cannot get the lights to go brighter than 24, which reklates to 23.9% in casambi app.
As soon as I try to go higher through homeassistant I get a "ValueError: byte must be in range(0, 256)" error.

Small issue for me, since I hardly ever want it brighter anyway, but still wondering why it's happening.

Logs: tried to set brightness to 25

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/casambi_bt/light.py:209
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 11:52:01 (1 occurrences)
Last logged: 11:52:01

[547710476608] byte must be in range(0, 256)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1787, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1824, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 968, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 721, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 571, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/config/custom_components/casambi_bt/light.py", line 209, in async_turn_on
    await self._api.casa.setUnitState(self._obj, state)
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_casambi.py", line 150, in setUnitState
    stateBytes = target.getStateAsBytes(state)
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_unit.py", line 265, in getStateAsBytes
    res[off // 8] |= valBytes[i] << (off % 8)
ValueError: byte must be in range(0, 256)

TypeError: Casambi.__init__() takes from 1 to 2 positional arguments but 3 were given

Describe the bug
Casambi fails to set up.

To Reproduce
Steps to reproduce the behavior:

  1. Install the latest version from the main branch.
  2. Reboot Home Assistant
  3. Check the error in the Home Assistant logs

Versions

  • HA version: 2023.12.x
  • Integration version: main, a56abd1

Logs

Logger: homeassistant.config_entries
Source: config_entries.py:402
First occurred: 15:03:27 (1 occurrences)
Last logged: 15:03:27

Error setting up entry Evolution for casambi_bt: Unexpected error creating network 6D:2A:B2:63:D8:B0
Traceback (most recent call last):
  File "/config/custom_components/casambi_bt/__init__.py", line 78, in async_casmbi_api_setup
    casa = Casambi(client, get_config_dir(hass))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Casambi.__init__() takes from 1 to 2 positional arguments but 3 were given

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/casambi_bt/__init__.py", line 32, in async_setup_entry
    casa_api = await async_casmbi_api_setup(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/casambi_bt/__init__.py", line 96, in async_casmbi_api_setup
    raise ConfigEntryError(f"Unexpected error creating network {address}") from err
homeassistant.exceptions.ConfigEntryError: Unexpected error creating network 6D:2A:B2:63:D8:B0

Error doing job: Task exception was never retrieved

Describe the bug
I removed the existing integration, installed version 0.0.6 and set it up once discovered. It creates the entities but does not work.

Expected behavior
No errors and a working light.

Versions

  • HA version: 2023.4.1

System Information

version core-2023.4.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.10
os_name Linux
os_version 6.1.19-v8
arch aarch64
timezone Europe/Brussels
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4998
Installed Version 1.31.0
Stage running
Available Repositories 1252
Downloaded Repositories 67
HACS Data ok
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 10.0.rc3
update_channel beta
supervisor_version supervisor-2023.04.0
agent_version 1.5.1
docker_version 23.0.2
disk_total 458.4 GB
disk_used 32.8 GB
healthy true
supported true
board yellow
supervisor_api ok
version_api ok
installed_addons AirCast (3.5.2), Spotify Connect (0.12.3), SSH & Web Terminal (13.1.0), File editor (5.5.0), Studio Code Server (5.5.6), Zigbee2MQTT (1.30.3-1), Home Assistant Google Drive Backup (0.110.3), MariaDB (2.5.2), phpMyAdmin (0.8.5), JupyterLab (0.10.0), The Lounge (0.17.1), Glances (0.18.1), Tailscale (0.10.1), ZeroTier One (0.16.2), AdGuard Home (4.8.4), Nginx Proxy Manager (0.12.3), Uptime Kuma (0.7.2), WireGuard (0.8.0), CUPS Print Server (2.0.2), ESPHome (2023.3.2), Grafana (8.2.1), Music Assistant BETA (2.0.0b27), Mosquitto broker (6.2.0)
Dashboards
dashboards 2
resources 28
views 14
mode storage
Recorder
oldest_recorder_run June 11, 2022 at 07:18
current_recorder_run April 7, 2023 at 23:53
estimated_db_size 7009.72 MiB
database_engine mysql
database_version 10.6.10
Spotify
api_endpoint_reachable ok
- Integration version: 0.0.6

Logs

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/casambi_bt/__init__.py:179
Integration: Casambi Bluetooth (documentation)
First occurred: April 7, 2023 at 23:55:06 (1 occurrences)
Last logged: April 7, 2023 at 23:55:06

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 111, in connect_tcp
    stream: anyio.abc.ByteStream = await anyio.connect_tcp(
  File "/usr/local/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 213, in connect_tcp
    async with create_task_group() as tg:
  File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 662, in __aexit__
    raise exceptions[0]
  File "/usr/local/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 164, in try_connect
    stream = await asynclib.connect_tcp(remote_host, remote_port, local_address)
  File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 1691, in connect_tcp
    await get_running_loop().create_connection(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1060, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 969, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 501, in sock_connect
    return await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
    yield
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 110, in connect_tcp
    with anyio.fail_after(timeout):
  File "/usr/local/lib/python3.10/site-packages/anyio/_core/_tasks.py", line 118, in __exit__
    raise TimeoutError
TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
    yield
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
    response = await connection.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 86, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 63, in handle_async_request
    stream = await self._connect(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 111, in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/auto.py", line 29, in connect_tcp
    return await self._backend.connect_tcp(
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp
    with map_exceptions(exc_map):
  File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc)
httpcore.ConnectTimeout

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/casambi_bt/__init__.py", line 179, in try_reconnect
    await self.casa.connect(device, self.password)
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_casambi.py", line 129, in connect
    await self._casaNetwork.logIn(password, forceOffline)
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_network.py", line 135, in logIn
    await self.getNetworkId(forceOffline)
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_network.py", line 99, in getNetworkId
    res = await self._httpClient.get(getNetworkIdUrl)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1757, in get
    return await self.request(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1533, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1620, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1648, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1685, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1722, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 352, in handle_async_request
    with map_httpcore_exceptions():
  File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectTimeout

Module mit Farbtemperatur -- corlor_temp_Kelvin

Versions

HA version: latest 
Integration version: 0.07

Ich wollte mal nachfragen ob die Casambi Bluetooth Integration jemand in Verbindung mit Farmtemperatur am laufen hat.
Generell läuft die bei mir bei den reinen "Dimmmodulen" sehr gut.
Bei den Modulen / Leuchten mit Farbtemperatur (color_temp_Kelvin) habe ich jedoch Probleme.
Sobald man über HomeAssistant die Leuchte(n) einschaltet (oder dimmt), geht der Kelvinwert auf maximal-Wert und lässt sich dann nur noch über die App ändern.

Danke

Unten wurde mal der Dimmerwert von 8% auf 13% geändert.

2023-11-04 17:02:19.612 INFO (MainThread) [custom_components.hacs] Stage changed: setup
2023-11-04 17:02:19.614 INFO (MainThread) [custom_components.hacs] Stage changed: waiting
2023-11-04 17:02:19.614 INFO (MainThread) [custom_components.hacs] Setup complete, waiting for Home Assistant before startup tasks starts
2023-11-04 17:02:19.712 INFO (MainThread) [CasambiBt._network] Got network id lMCFsZWf7AJRsLszOtvDlZ0m1yNU72ED.
2023-11-04 17:02:19.712 INFO (MainThread) [CasambiBt._network] Updating network...
2023-11-04 17:02:19.714 INFO (MainThread) [CasambiBt._network] Loaded cached network. Revision: 53
2023-11-04 17:02:19.756 DEBUG (MainThread) [CasambiBt._network] Network: {"status":"UPTODATE","revision":53.0,"role":3}
2023-11-04 17:02:19.757 INFO (MainThread) [CasambiBt._keystore] Key with id 2 already exists. Skipping...
2023-11-04 17:02:19.757 INFO (MainThread) [CasambiBt._network] Fetching unit type for id 11024...
2023-11-04 17:02:19.757 INFO (MainThread) [CasambiBt._network] Using cached type.
2023-11-04 17:02:19.757 INFO (MainThread) [CasambiBt._network] Fetching unit type for id 2531...
2023-11-04 17:02:19.757 INFO (MainThread) [CasambiBt._network] Using cached type.
2023-11-04 17:02:19.758 INFO (MainThread) [CasambiBt._network] Fetching unit type for id 8699...
2023-11-04 17:02:19.758 INFO (MainThread) [CasambiBt._network] Using cached type.
2023-11-04 17:02:19.758 INFO (MainThread) [CasambiBt._network] Saving type cache...
2023-11-04 17:02:19.762 INFO (MainThread) [CasambiBt._network] Network updated.
2023-11-04 17:02:19.763 INFO (MainThread) [CasambiBt._client] Connection to 5A:66:F1:12:BE:F4
2023-11-04 17:02:20.623 INFO (MainThread) [CasambiBt._client] Connected to 5A:66:F1:12:BE:F4
2023-11-04 17:02:20.623 INFO (MainThread) [CasambiBt._client] Starting key exchange...
2023-11-04 17:02:20.935 DEBUG (MainThread) [CasambiBt._client] Got b'010a9e000800f0d462c661d8c66e952be7a1092744cc3e'
2023-11-04 17:02:20.936 DEBUG (MainThread) [CasambiBt._client] Parsed mtu 158, unit 8, flags 240, nonce b'd462c661d8c66e952be7a1092744cc3e'
2023-11-04 17:02:20.936 DEBUG (MainThread) [CasambiBt._client] Starting notify
2023-11-04 17:02:21.049 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 8): Unknown: b'020ad8e906a67c8b4bbcbdfadec7daed0ae45efbbcb83198de07a98e7d9de255ca55a9602eeb65c8ee5d523a54366ef2bbec7cf38763ba3677c178b5b3f93d29be'
2023-11-04 17:02:21.049 DEBUG (MainThread) [CasambiBt._client] Got public key 91518941454934698021774213204192379573923268105660001819209777837694798911498, 86012309698955955230204428445243507324952922016083414273006864030877148555605
2023-11-04 17:02:21.384 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 8): Unknown: b'03'
2023-11-04 17:02:21.385 INFO (MainThread) [CasambiBt._client] Key exchange sucessful
2023-11-04 17:02:21.385 INFO (MainThread) [CasambiBt._client] Authenicating channel...
2023-11-04 17:02:21.386 DEBUG (MainThread) [CasambiBt._client] Auth digest: b'ba233ff19f247313a74680a0bae16301d85fd951785071fe2f2fb59ce458604f'
2023-11-04 17:02:21.386 INFO (MainThread) [CasambiBt._encryption] Encrypting packet: b'010000000402ba233ff19f247313a74680a0bae16301d85fd951785071fe2f2fb59ce458604f' of len 38 with nonce b'd462c661010000002be7a1092744cc3e'
2023-11-04 17:02:21.392 DEBUG (MainThread) [CasambiBt._encryption] Encrypted packet: b'010000008fb9c371d96935fb8242f90c70adb946a88c0e6c7a8e6a714689968a37a198fd3ca9'
2023-11-04 17:02:21.393 DEBUG (MainThread) [CasambiBt._encryption] Authenticated packet: b'010000008fb9c371d96935fb8242f90c70adb946a88c0e6c7a8e6a714689968a37a198fd3ca9e76a753b8f06d7c0bd53686193115452'
2023-11-04 17:02:21.649 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 8): Unknown: b'01000080807b96fecbf2f4a5e86f09e7f596dbae08f65448096f7aa9e2063939641028d8d84206fb3a4f20f7d07cde66767f5b16a922'
2023-11-04 17:02:21.649 INFO (MainThread) [CasambiBt._client] Processing authentication response...
2023-11-04 17:02:21.649 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'01000080807b96fecbf2f4a5e86f09e7f596dbae08f65448096f7aa9e2063939641028d8d84206fb3a4f20f7d07cde66767f5b16a922' of len 54 with nonce b'01000080d8c66e952be7a1092744cc3e'
2023-11-04 17:02:21.655 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'050386767815446604f1c78a4ee0c16839053f1ec69faaeeb8424c1ba995575ed00e'
2023-11-04 17:02:21.658 INFO (MainThread) [CasambiBt._client] Authentication successful
2023-11-04 17:02:21.658 INFO (MainThread) [CasambiBt._casambi] Registerd unit changed handler <bound method CasambiApi._unit_changed_handler of <custom_components.casambi_bt.CasambiApi object at 0x7f77ec9390>>
2023-11-04 17:02:21.663 INFO (MainThread) [homeassistant.components.light] Setting up light.casambi_bt
2023-11-04 17:02:21.666 INFO (MainThread) [homeassistant.components.scene] Setting up scene.casambi_bt
2023-11-04 17:02:21.679 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 15.37s
2023-11-04 17:02:21.680 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2023-11-04 17:02:21.690 INFO (MainThread) [custom_components.hacs] Stage changed: startup
2023-11-04 17:02:23.760 INFO (MainThread) [custom_components.watchman] 222 files parsed and 0 files ignored in 2.05s. due to HA restart
2023-11-04 17:02:23.765 INFO (MainThread) [custom_components.hacs] Loading removed repositories
2023-11-04 17:02:23.789 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 8): Unknown: b'020000807409fe51077f6c163478ce9b0d34b16567679b91573c8f78efc0ca8b134949cb'
2023-11-04 17:02:23.789 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'020000807409fe51077f6c163478ce9b0d34b16567679b91573c8f78efc0ca8b134949cb' of len 36 with nonce b'02000080d8c66e952be7a1092744cc3e'

2023-11-04 17:02:23.792 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'06011f0380040a00081f13800408081c'
2023-11-04 17:02:23.792 DEBUG (MainThread) [CasambiBt._client] Incoming data of type 6: b'06011f0380040a00081f13800408081c'
2023-11-04 17:02:23.792 INFO (MainThread) [CasambiBt._client] Parsing incoming unit states...
2023-11-04 17:02:23.793 DEBUG (MainThread) [CasambiBt._client] Incoming unit state: b'011f0380040a00081f13800408081c'
2023-11-04 17:02:23.793 DEBUG (MainThread) [CasambiBt._client] Parsed state: Id 1, prio 3, online True, on True, state b'00'1
2023-11-04 17:02:23.793 INFO (MainThread) [CasambiBt._casambi] Incomming data callback of type 6
2023-11-04 17:02:23.793 DEBUG (MainThread) [CasambiBt._casambi] Handling changed state b'00' for unit 1
2023-11-04 17:02:23.793 DEBUG (MainThread) [CasambiBt._unit] Parsed b'00' to UnitState(dimmer=0, vertical=None, rgb=None, white=None, temperature=None)
2023-11-04 17:02:23.793 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 1
2023-11-04 17:02:23.793 DEBUG (MainThread) [CasambiBt._client] Parsed state: Id 8, prio 3, online True, on True, state b'081c'1
2023-11-04 17:02:23.794 INFO (MainThread) [CasambiBt._casambi] Incomming data callback of type 6
2023-11-04 17:02:23.794 DEBUG (MainThread) [CasambiBt._casambi] Handling changed state b'081c' for unit 8
**2023-11-04 17:02:23.794 DEBUG (MainThread) [CasambiBt._unit] Parsed b'081c' to UnitState(dimmer=8, vertical=None, rgb=None, white=None, temperature=3117)**
2023-11-04 17:02:23.794 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 8
2023-11-04 17:02:23.795 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 8): Unknown: b'030000805a81919931285f53f784f3308e57b917f5b095b10849c62632dfb3bde19c09f4950531689cffb7c89c2075314200e39870e57447af19fbf8'
2023-11-04 17:02:23.796 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'030000805a81919931285f53f784f3308e57b917f5b095b10849c62632dfb3bde19c09f4950531689cffb7c89c2075314200e39870e57447af19fbf8' of len 60 with nonce b'03000080d8c66e952be7a1092744cc3e'
2023-11-04 17:02:23.799 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'0901060f840a06820a04830a08010602070303040705030704080481020c83020984020682020600'
2023-11-04 17:02:23.800 DEBUG (MainThread) [CasambiBt._client] Incoming data of type 9: b'0901060f840a06820a04830a08010602070303040705030704080481020c83020984020682020600'


2023-11-04 17:05:27.813 DEBUG (MainThread) [CasambiBt._unit] Packing [(0, 8, 13), (8, 8, 255)] as bytearray(b'\r\xff')
2023-11-04 17:05:27.813 DEBUG (MainThread) [CasambiBt._casambi] Sending operation SetState with payload b'0dff' for 801
2023-11-04 17:05:27.813 DEBUG (MainThread) [CasambiBt._client] Sending packet b'2802300001080100000dff' with counter 2
2023-11-04 17:05:27.814 DEBUG (MainThread) [CasambiBt._client] Packet with header: b'02000000072802300001080100000dff'
2023-11-04 17:05:27.814 INFO (MainThread) [CasambiBt._encryption] Encrypting packet: b'02000000072802300001080100000dff' of len 16 with nonce b'd462c661020000002be7a1092744cc3e'
2023-11-04 17:05:27.818 DEBUG (MainThread) [CasambiBt._encryption] Encrypted packet: b'0200000017fb6618464cb417af3e773a'
2023-11-04 17:05:27.823 DEBUG (MainThread) [CasambiBt._encryption] Authenticated packet: b'0200000017fb6618464cb417af3e773a1bd6fdc11952fe93ffb9f2c6aa6fd924'
2023-11-04 17:05:27.877 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 8): Unknown: b'04000080d3a9f64472bfde1b9906119984e1b7169e881add19431ab7'
2023-11-04 17:05:27.877 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'04000080d3a9f64472bfde1b9906119984e1b7169e881add19431ab7' of len 28 with nonce b'04000080d8c66e952be7a1092744cc3e'
2023-11-04 17:05:27.879 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'06081713800d0dff'
2023-11-04 17:05:27.881 DEBUG (MainThread) [CasambiBt._client] Incoming data of type 6: b'06081713800d0dff'
2023-11-04 17:05:27.881 INFO (MainThread) [CasambiBt._client] Parsing incoming unit states...
2023-11-04 17:05:27.882 DEBUG (MainThread) [CasambiBt._client] Incoming unit state: b'081713800d0dff'
2023-11-04 17:05:27.882 DEBUG (MainThread) [CasambiBt._client] Parsed state: Id 8, prio 3, online True, on True, state b'0dff'1
2023-11-04 17:05:27.882 INFO (MainThread) [CasambiBt._casambi] Incomming data callback of type 6
2023-11-04 17:05:27.882 DEBUG (MainThread) [CasambiBt._casambi] Handling changed state b'0dff' for unit 8
**2023-11-04 17:05:27.883 DEBUG (MainThread) [CasambiBt._unit] Parsed b'0dff' to UnitState(dimmer=13, vertical=None, rgb=None, white=None, temperature=6500)**
2023-11-04 17:05:27.883 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 8

und dann über HA versucht den Kelvin-Wert zu ändern ... jedoch passiert auf der Casmabi Seite nichts

2023-11-04 17:33:44.887 DEBUG (MainThread) [CasambiBt._unit] Packing [(0, 8, 13), (8, 8, 255)] as bytearray(b'\r\xff')
2023-11-04 17:33:44.888 DEBUG (MainThread) [CasambiBt._casambi] Sending operation SetState with payload b'0dff' for 801
2023-11-04 17:33:44.888 DEBUG (MainThread) [CasambiBt._client] Sending packet b'2802300002080100000dff' with counter 3
2023-11-04 17:33:44.888 DEBUG (MainThread) [CasambiBt._client] Packet with header: b'03000000072802300002080100000dff'
2023-11-04 17:33:44.888 INFO (MainThread) [CasambiBt._encryption] Encrypting packet: b'03000000072802300002080100000dff' of len 16 with nonce b'd462c661030000002be7a1092744cc3e'
2023-11-04 17:33:44.894 DEBUG (MainThread) [CasambiBt._encryption] Encrypted packet: b'03000000dfb25ccb06d376b56cca3b9a'
2023-11-04 17:33:44.896 DEBUG (MainThread) [CasambiBt._encryption] Authenticated packet: b'03000000dfb25ccb06d376b56cca3b9a338ff31ba31f6e7a1602475c776d31d1'
2023-11-04 17:33:45.431 DEBUG (MainThread) [CasambiBt._unit] Packing [(0, 8, 13), (8, 8, 255)] as bytearray(b'\r\xff')
2023-11-04 17:33:45.431 DEBUG (MainThread) [CasambiBt._casambi] Sending operation SetState with payload b'0dff' for 801
2023-11-04 17:33:45.432 DEBUG (MainThread) [CasambiBt._client] Sending packet b'2802300003080100000dff' with counter 4
2023-11-04 17:33:45.432 DEBUG (MainThread) [CasambiBt._client] Packet with header: b'04000000072802300003080100000dff'
2023-11-04 17:33:45.432 INFO (MainThread) [CasambiBt._encryption] Encrypting packet: b'04000000072802300003080100000dff' of len 16 with nonce b'd462c661040000002be7a1092744cc3e'
2023-11-04 17:33:45.438 DEBUG (MainThread) [CasambiBt._encryption] Encrypted packet: b'040000000c2335667a75bc7808ca45c1'
2023-11-04 17:33:45.439 DEBUG (MainThread) [CasambiBt._encryption] Authenticated packet: b'040000000c2335667a75bc7808ca45c13729e2244c5d5c971a5a82ed50c7eef9'
2023-11-04 17:33:46.033 DEBUG (MainThread) [CasambiBt._unit] Packing [(0, 8, 13), (8, 8, 255)] as bytearray(b'\r\xff')
2023-11-04 17:33:46.033 DEBUG (MainThread) [CasambiBt._casambi] Sending operation SetState with payload b'0dff' for 801
2023-11-04 17:33:46.033 DEBUG (MainThread) [CasambiBt._client] Sending packet b'2802300004080100000dff' with counter 5
2023-11-04 17:33:46.034 DEBUG (MainThread) [CasambiBt._client] Packet with header: b'05000000072802300004080100000dff'
2023-11-04 17:33:46.034 INFO (MainThread) [CasambiBt._encryption] Encrypting packet: b'05000000072802300004080100000dff' of len 16 with nonce b'd462c661050000002be7a1092744cc3e'
2023-11-04 17:33:46.036 DEBUG (MainThread) [CasambiBt._encryption] Encrypted packet: b'050000008f6c732b5a32da05b4871b9d'
2023-11-04 17:33:46.037 DEBUG (MainThread) [CasambiBt._encryption] Authenticated packet: b'050000008f6c732b5a32da05b4871b9dd6ba2cbdbc0e615482ebfe3b6e8f0e69'

Casambi relay not getting detected

Hi,

I integrated the casambi-bt-hass in my HA and everything works fine, only one casambi-relay that is not getting noticed:

Screenshot_20231015_135859_Casambi

Do you have an idea why it doesn't find this relay?

All my senes I created are detected and i can activate a scene where this relay is triggered and working...

network update fails

I set my network settings as described in https://github.com/lkempf/casambi-bt

When I try to setup the integration it fails while updating the network: ERROR 410: Gone

Do I need to make the network visible?
Do I need to use evolution or classic firmware? Found in another issue that you use evo as well..

Logs:

2022-12-25 00:01:07.170 INFO (MainThread) [CasambiBt._casambi] Trying to connect to casambi network x...
2022-12-25 00:01:07.170 INFO (MainThread) [CasambiBt._network] Getting network id...
2022-12-25 00:01:07.341 INFO (MainThread) [CasambiBt._network] Got network id x.
2022-12-25 00:01:07.343 INFO (MainThread) [CasambiBt._keystore] Loading keys...
2022-12-25 00:01:07.345 INFO (MainThread) [CasambiBt._keystore] Loaded 4 keys.
2022-12-25 00:01:07.345 INFO (MainThread) [CasambiBt._network] Loading session...
2022-12-25 00:01:07.348 INFO (MainThread) [CasambiBt._network] Loading unit type cache...
2022-12-25 00:01:07.349 INFO (MainThread) [CasambiBt._network] Updating network...
2022-12-25 00:01:07.389 ERROR (MainThread) [CasambiBt._network] Update failed: 410
2022-12-25 00:01:07.393 INFO (MainThread) [CasambiBt._client] Connection to x

Same network is discovered multiple times

I currently have only one network but it shows up two times.

Bildschirm­foto 2022-12-27 um 07 49 33

2022-12-27 07:40:31.712 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (x) [connectable]: x AdvertisementData(manufacturer_data={963: b'At\xa5L\xa2\xf1\n'}, service_uuids=['0000fe4d-0000-1000-8000-00805f9b34fb'], rssi=-79) match: {'casambi-bt'}

2022-12-27 07:48:13.948 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (x) [connectable]: x AdvertisementData(local_name='CURVED ', manufacturer_data={963: b'At\xa5L\xa2\xf1\n'}, service_uuids=['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000fe4d-0000-1000-8000-00805f9b34fb'], rssi=-88) match: {'casambi-bt'}

Password issue?

I understand you are busy, so whenever you have time to answer... I had your code working but all of a sudden it stopped... Not quite sure if i did anything....

2023-02-15 14:56:58.827 INFO (MainThread) [CasambiBt._network] Getting network id...
2023-02-15 14:56:59.260 INFO (MainThread) [CasambiBt._network] Got network id clL39YhjrgdHfDZmaQqUkPy3O16tay9F.
2023-02-15 14:56:59.262 INFO (MainThread) [CasambiBt._keystore] Loading keys...
2023-02-15 14:56:59.264 INFO (MainThread) [CasambiBt._keystore] Loaded 1 keys.
2023-02-15 14:56:59.264 INFO (MainThread) [CasambiBt._network] Loading session...
2023-02-15 14:56:59.266 INFO (MainThread) [CasambiBt._network] Loading unit type cache...
2023-02-15 14:56:59.267 INFO (MainThread) [CasambiBt._network] Updating network...
2023-02-15 14:56:59.297 ERROR (MainThread) [CasambiBt._network] Update failed: 410

2023-02-15 14:56:59.322 ERROR (MainThread) [custom_components.casambi_bt.config_flow] Unexpected exception
Traceback (most recent call last):
File "/config/custom_components/casambi_bt/config_flow.py", line 122, in async_step_user
info = await _validate_input(self.hass, user_input)
File "/config/custom_components/casambi_bt/config_flow.py", line 41, in _validate_input
await casa.connect(bt_device, data[CONF_PASSWORD])
File "/usr/local/lib/python3.10/site-packages/CasambiBt/_casambi.py", line 124, in connect
await self._casaNetwork.update()
File "/usr/local/lib/python3.10/site-packages/CasambiBt/_network.py", line 137, in update
raise NetworkUpdateError("Could not update network!")
CasambiBt.errors.NetworkUpdateError: Could not update network!

Native HA integration

Do you plan to contribute this integration into home assistant at one point in time?

Support for networks with classic firmware

When I run the demo, it asks for the right network and password, so far so good. When I continue it prints the json of the network but it fails on the keyStore, since that's not part of my json.

Error:

Task exception was never retrieved
future: <Task finished name='Task-1' coro=<main() done, defined at /addons/casambi-bt-main/demo.py:12> exception=KeyError('keyStore')>
Traceback (most recent call last):
  File "/addons/casambi-bt-main/demo.py", line 29, in main
    await casa.connect(device, pwd)
  File "/addons/casambi-bt-main/src/CasambiBt/_casambi.py", line 124, in connect
    await self._casaNetwork.update()
  File "/addons/casambi-bt-main/src/CasambiBt/_network.py", line 149, in update
    keys = resJson["network"]["keyStore"]["keys"]
KeyError: 'keyStore'

I'm on a Classic network which I cannot upgrade (devices are too old). If you want, I can share my json too, but I'll remove some fields that might be sensitive.

feature request: supports simple string as address in setup

When you do not use the BLE adress provided by auto discovery you need to type in the address : separated and all upper case. Device lookup otherwise fails.

It would be nice to also support a simple string and adjust it to BLE address format under the hood (e.g. 12abcd345678).

Maybe something for a later state.

Unexpected answer from device! Wrong device or protocol version?

Hi,
I'm trying to get this working, but get this unexpected Error when trying to connect.
It's a Classic (Not evolution) network with firmware v26.24

Logs:

his error originated from a custom integration.

Logger: custom_components.casambi_bt.config_flow
Source: custom_components/casambi_bt/config_flow.py:41
Integration: Casambi Bluetooth (documentation)
First occurred: 22:47:51 (1 occurrences)
Last logged: 22:47:51

Unexpected exception
Traceback (most recent call last):
File "/config/custom_components/casambi_bt/config_flow.py", line 122, in async_step_user
info = await _validate_input(self.hass, user_input)
File "/config/custom_components/casambi_bt/config_flow.py", line 41, in _validate_input
await casa.connect(bt_device, data[CONF_PASSWORD])
File "/usr/local/lib/python3.10/site-packages/CasambiBt/_casambi.py", line 126, in connect
await self._connectClient()
File "/usr/local/lib/python3.10/site-packages/CasambiBt/_casambi.py", line 141, in _connectClient
raise e
File "/usr/local/lib/python3.10/site-packages/CasambiBt/_casambi.py", line 137, in _connectClient
await self._casaClient.exchangeKey(self._casaNetwork.getKeyStore())
File "/usr/local/lib/python3.10/site-packages/CasambiBt/_client.py", line 142, in exchangeKey
raise ProtocolError(
CasambiBt.errors.ProtocolError: Unexpected answer from device! Wrong device or protocol version?

Thanks for your help
Rolf

Connection Issues

Describe the bug

Regularly my BT adapter changes into debug logging (by itself?) and the casambi integration is losing its connection leading to my shelly wall switch not being able to control my lights and sometime the lights turn on in the middle of the night.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Bildschirmfoto 2023-09-22 um 09 13 08

Versions

  • HA version: latest
  • Integration version:

Logs

Error setting up entry for casambi_bt
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/casambi_bt/__init__.py", line 31, in async_setup_entry
    casa_api = await async_casmbi_api_setup(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/casambi_bt/__init__.py", line 83, in async_casmbi_api_setup
    await casa.connect(device, password)
  File "/usr/local/lib/python3.11/site-packages/CasambiBt/_casambi.py", line 139, in connect
    await self._connectClient()
  File "/usr/local/lib/python3.11/site-packages/CasambiBt/_casambi.py", line 146, in _connectClient
    await self._casaClient.exchangeKey(self._casaNetwork.getKeyStore())  # type: ignore[union-attr]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/CasambiBt/_client.py", line 168, in exchangeKey
    await self._gattClient.start_notify(
  File "/usr/local/lib/python3.11/site-packages/bleak/__init__.py", line 834, in start_notify
    await self._backend.start_notify(characteristic, wrapped_callback, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/client.py", line 950, in start_notify
    reply = await self._bus.call(
            ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dbus_fast/aio/message_bus.py", line 390, in call
    await future
asyncio.exceptions.CancelledError: aiohttp connection lost

See https://github.com/lkempf/casambi-bt-hass#reporting-issues on how to enable logs. Please make sure to at least include the log of the first connection with the network (be restarting HA or reloading the integration) and the log at the time an error happens (if applicable).

Support vertical distribution

I have a light that supports directing light up or down (up to 100% up or down or any distribution in between). Can this be made available via HA as well? Looking at the debug log, this seems to be somehow available already:

2024-02-28 20:53:13.315 DEBUG (MainThread) [CasambiBt._unit] Parsed b'54ff2b' to UnitState(dimmer=84, **vertical=255**, rgb=None, white=None, temperature=2919)

Thanks,
Florian

Invalid supported color modes

Describe the bug
Deprecation warning on HA beta 2024.3.
I think this is related to https://developers.home-assistant.io/blog/2024/02/12/light-color-mode-mandatory/

To Reproduce
Steps to reproduce the behavior:

  1. Update HA core to version 2024.3
  2. Check the error logs

Versions

  • HA version: 2024.3.0b3
  • Integration version: v0.1.0

Logs

Logger: homeassistant.components.light
Source: components/light/__init__.py:1165
integration: Light (documentation, issues)
First occurred: 02:19:12 (1 occurrences)
Last logged: 02:19:12

None (<class 'custom_components.casambi_bt.light.CasambiLightUnit'>) sets invalid supported color modes {'rgbw', 'brightness', 'onoff'}, this will stop working in Home Assistant Core 2025.3, please report it to the author of the 'casambi_bt' custom integration

Light temperature is always going to default (coolest) value

Describe the bug
Regardless of what light temperature I move the slider to, it always goes to the maximum (ie. coolest) temperature.
There's a second (related) bug, where changing the brightness, regardless of the temperature, causes the temperature to go to its coolest value even though only the brightness should be changed.

My theory is that the packet build is having an issue, causing the light to just revert to "default" brightness, ie. the coolest value.

To Reproduce
Open light in HAOS dashboard
Change to "temperature" mode.
Make temperature warmer.
(For second bug; change temperature to warmer than default, then change brightness)

Expected behavior
Temperature should be customisable.

Versions
HA: 2024.1.0.dev20231218 (Raspberry Pi 5 dev build)
Integration: v0.0.7

Logs
In below logs, light temperature was set to minimum (2700K) in Casambi app. Home Assistant integration was used to set to highest (6450K), then back to lowest.

2023-12-22 00:08:36.566 DEBUG (MainThread) [CasambiBt._unit] Packing [(0, 8, 4), (8, 8, 255)] as bytearray(b'\x04\xff')
2023-12-22 00:08:36.566 DEBUG (MainThread) [CasambiBt._casambi] Sending operation SetState with payload b'04ff' for 201
2023-12-22 00:08:36.566 DEBUG (MainThread) [CasambiBt._client] Sending packet b'28023000170201000004ff' with counter 24
2023-12-22 00:08:36.566 DEBUG (MainThread) [CasambiBt._client] Packet with header: b'180000000728023000170201000004ff'
2023-12-22 00:08:36.566 INFO (MainThread) [CasambiBt._encryption] Encrypting packet: b'180000000728023000170201000004ff' of len 16 with nonce b'7b9105c91800000080b585177ed84e44'
2023-12-22 00:08:36.567 DEBUG (MainThread) [CasambiBt._encryption] Encrypted packet: b'18000000891c92b0a3bc9aff06587ed9'
2023-12-22 00:08:36.568 DEBUG (MainThread) [CasambiBt._encryption] Authenticated packet: b'18000000891c92b0a3bc9aff06587ed9cb5e082156af5cabe2c5e6f5ea656b01'
2023-12-22 00:08:36.647 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 8): Unknown: b'3500008033f0c71e18ce4a5298f1a89192f3318e0b080329427b101f'
2023-12-22 00:08:36.647 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'3500008033f0c71e18ce4a5298f1a89192f3318e0b080329427b101f' of len 28 with nonce b'35000080a696643380b585177ed84e44'
2023-12-22 00:08:36.648 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'06021713800404ff'
2023-12-22 00:08:36.649 DEBUG (MainThread) [CasambiBt._client] Incoming data of type 6: b'06021713800404ff'
2023-12-22 00:08:36.649 INFO (MainThread) [CasambiBt._client] Parsing incoming unit states...
2023-12-22 00:08:36.649 DEBUG (MainThread) [CasambiBt._client] Incoming unit state: b'021713800404ff'
2023-12-22 00:08:36.649 DEBUG (MainThread) [CasambiBt._client] Parsed state: Id 2, prio 3, online True, on True, state b'04ff'1
2023-12-22 00:08:36.649 INFO (MainThread) [CasambiBt._casambi] Incomming data callback of type 6
2023-12-22 00:08:36.649 DEBUG (MainThread) [CasambiBt._casambi] Handling changed state b'04ff' for unit 2
2023-12-22 00:08:36.649 DEBUG (MainThread) [CasambiBt._unit] Parsed b'04ff' to UnitState(dimmer=4, vertical=None, rgb=None, white=None, temperature=6500)
2023-12-22 00:08:36.649 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 2
2023-12-22 00:08:37.159 DEBUG (MainThread) [CasambiBt._unit] Packing [(0, 8, 4), (8, 8, 255)] as bytearray(b'\x04\xff')
2023-12-22 00:08:37.159 DEBUG (MainThread) [CasambiBt._casambi] Sending operation SetState with payload b'04ff' for 201
2023-12-22 00:08:37.159 DEBUG (MainThread) [CasambiBt._client] Sending packet b'28023000180201000004ff' with counter 25
2023-12-22 00:08:37.159 DEBUG (MainThread) [CasambiBt._client] Packet with header: b'190000000728023000180201000004ff'
2023-12-22 00:08:37.159 INFO (MainThread) [CasambiBt._encryption] Encrypting packet: b'190000000728023000180201000004ff' of len 16 with nonce b'7b9105c91900000080b585177ed84e44'
2023-12-22 00:08:37.161 DEBUG (MainThread) [CasambiBt._encryption] Encrypted packet: b'1900000076ce50216d8c41101b199489'
2023-12-22 00:08:37.161 DEBUG (MainThread) [CasambiBt._encryption] Authenticated packet: b'1900000076ce50216d8c41101b19948970115486858fd39ac585aab0d0c86654'
2023-12-22 00:08:37.340 INFO (MainThread) [universal_silabs_flasher.flasher] Probing ApplicationType.CPC at 230400 baud
2023-12-22 00:08:41.648 INFO (MainThread) [universal_silabs_flasher.flasher] Probing ApplicationType.EZSP at 115200 baud
2023-12-22 00:08:42.897 INFO (MainThread) [universal_silabs_flasher.flasher] Detected ApplicationType.EZSP, version '6.10.3.0 build 297' (6.10.3.0.297) at 115200 baudrate (bootloader baudrate None)
2023-12-22 00:08:43.343 DEBUG (MainThread) [CasambiBt._unit] Packing [(0, 8, 4), (8, 8, 255)] as bytearray(b'\x04\xff')
2023-12-22 00:08:43.343 DEBUG (MainThread) [CasambiBt._casambi] Sending operation SetState with payload b'04ff' for 201
2023-12-22 00:08:43.343 DEBUG (MainThread) [CasambiBt._client] Sending packet b'28023000190201000004ff' with counter 26
2023-12-22 00:08:43.343 DEBUG (MainThread) [CasambiBt._client] Packet with header: b'1a0000000728023000190201000004ff'
2023-12-22 00:08:43.343 INFO (MainThread) [CasambiBt._encryption] Encrypting packet: b'1a0000000728023000190201000004ff' of len 16 with nonce b'7b9105c91a00000080b585177ed84e44'
2023-12-22 00:08:43.344 DEBUG (MainThread) [CasambiBt._encryption] Encrypted packet: b'1a0000005264b54617cd6be289e032ae'
2023-12-22 00:08:43.344 DEBUG (MainThread) [CasambiBt._encryption] Authenticated packet: b'1a0000005264b54617cd6be289e032ae99ef676e41afe2628af1971474271f7a'
2023-12-22 00:08:43.885 DEBUG (MainThread) [CasambiBt._unit] Packing [(0, 8, 4), (8, 8, 255)] as bytearray(b'\x04\xff')
2023-12-22 00:08:43.885 DEBUG (MainThread) [CasambiBt._casambi] Sending operation SetState with payload b'04ff' for 201
2023-12-22 00:08:43.885 DEBUG (MainThread) [CasambiBt._client] Sending packet b'280230001a0201000004ff' with counter 27
2023-12-22 00:08:43.885 DEBUG (MainThread) [CasambiBt._client] Packet with header: b'1b00000007280230001a0201000004ff'
2023-12-22 00:08:43.885 INFO (MainThread) [CasambiBt._encryption] Encrypting packet: b'1b00000007280230001a0201000004ff' of len 16 with nonce b'7b9105c91b00000080b585177ed84e44'
2023-12-22 00:08:43.892 DEBUG (MainThread) [CasambiBt._encryption] Encrypted packet: b'1b000000e7fc0daf09f8ef538cc641ae'
2023-12-22 00:08:43.892 DEBUG (MainThread) [CasambiBt._encryption] Authenticated packet: b'1b000000e7fc0daf09f8ef538cc641aebe6cddb20479a4234ab127493562e370'

feature request: support multiple elements per unit

My luminaires have two elements per unit that I want to control separately.

Unit(
  _typeId=22133, deviceId=1, uuid='x', address='x', name='CURVED ', 
  firmwareVersion='9472', 
  unitType=UnitType(
    id=22133, model='CURVED ', manufacturer='OLIGO', 
    mode='PWM/4ch/Dim,Dim,TW', stateLength=3, 
    controls=[
      UnitControl(type=<UnitControlType.DIMMER: 0>, offset=0, length=8, default=128, readonly=False), 
      UnitControl(type=<UnitControlType.DIMMER: 0>, offset=8, length=8, default=128, readonly=False), 
      UnitControl(type=<UnitControlType.UNKOWN: 99>, offset=16, length=8, default=46, readonly=False)]
    ),
    _state=None, _on=False, _online=True
  )

image

image

Bluetooth connection breaks for unkown reason

          Thanks @lkempf for the reply and sorry for the delay.

Option 3 is out because I can use the lights initially and also if I reload the integration.

I also think it is not option 1, as it loads successfully at the beginning.

2023-06-09 09:31:36.605 INFO (MainThread) [CasambiBt._casambi] Trying to connect to casambi network xx:xx:xx:xx:xx:xx...
2023-06-09 09:31:36.607 INFO (MainThread) [CasambiBt._keystore] Loading keys...
2023-06-09 09:31:36.608 INFO (MainThread) [CasambiBt._keystore] Loaded 5 keys.
2023-06-09 09:31:36.610 INFO (MainThread) [CasambiBt._network] Loading session...
2023-06-09 09:31:36.611 INFO (MainThread) [CasambiBt._network] Loading unit type cache...
2023-06-09 09:31:36.613 INFO (MainThread) [CasambiBt._network] Getting network id...
2023-06-09 09:31:37.312 INFO (MainThread) [httpx] HTTP Request: GET https://api.casambi.com/network/uuid/xxxxxxxxxx "HTTP/1.1 200 OK"
2023-06-09 09:31:37.330 INFO (MainThread) [CasambiBt._network] Got network id xxxxxxxxxxxxxxxx
2023-06-09 09:31:37.331 INFO (MainThread) [CasambiBt._network] Updating network...
2023-06-09 09:31:37.333 INFO (MainThread) [CasambiBt._network] Loaded cached network. Revision: 98
2023-06-09 09:31:37.524 INFO (MainThread) [httpx] HTTP Request: PUT https://api.casambi.com/network/xxxxxxxxxxxxxxxxxxxxxxxxxxxx/ "HTTP/1.1 200 OK"
2023-06-09 09:31:37.532 DEBUG (MainThread) [CasambiBt._network] Network: {"status":"UPTODATE","revision":98.0,"role":3}
2023-06-09 09:31:37.534 INFO (MainThread) [CasambiBt._keystore] Key with id 6 already exists. Skipping...
2023-06-09 09:31:37.534 INFO (MainThread) [CasambiBt._keystore] Key with id 3 already exists. Skipping...
2023-06-09 09:31:37.535 INFO (MainThread) [CasambiBt._keystore] Key with id 4 already exists. Skipping...
2023-06-09 09:31:37.536 INFO (MainThread) [CasambiBt._keystore] Key with id 5 already exists. Skipping...
2023-06-09 09:31:37.537 INFO (MainThread) [CasambiBt._keystore] Key with id 9 already exists. Skipping...
2023-06-09 09:31:37.537 INFO (MainThread) [CasambiBt._network] Fetching unit type for id 22602...
2023-06-09 09:31:37.538 INFO (MainThread) [CasambiBt._network] Using cached type.
2023-06-09 09:31:37.538 INFO (MainThread) [CasambiBt._network] Fetching unit type for id 22602...
2023-06-09 09:31:37.539 INFO (MainThread) [CasambiBt._network] Using cached type.
2023-06-09 09:31:37.539 INFO (MainThread) [CasambiBt._network] Fetching unit type for id 22602...
2023-06-09 09:31:37.540 INFO (MainThread) [CasambiBt._network] Using cached type.
2023-06-09 09:31:37.540 INFO (MainThread) [CasambiBt._network] Saving type cache...
2023-06-09 09:31:37.544 INFO (MainThread) [CasambiBt._network] Network updated.
2023-06-09 09:31:37.545 INFO (MainThread) [CasambiBt._client] Connection to xx:xx:xx:xx:xx:xx
2023-06-09 09:31:47.042 INFO (MainThread) [CasambiBt._client] Connected to xx:xx:xx:xx:xx:xx
2023-06-09 09:31:47.044 INFO (MainThread) [CasambiBt._client] Starting key exchange...
2023-06-09 09:31:47.615 DEBUG (MainThread) [CasambiBt._client] Got b'xxxxxxxxxxxxxx'
2023-06-09 09:31:47.617 DEBUG (MainThread) [CasambiBt._client] Parsed mtu 158, unit 1, flags 242, nonce b'xxxxxxxxxxxxxx'
2023-06-09 09:31:47.619 DEBUG (MainThread) [CasambiBt._client] Starting notify
2023-06-09 09:31:47.692 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 8): Unknown: b'02c4c57281527c54578a7aa2cc75425d69677461fe634c9c84e52a5a10c011b3fef4fc68c139cf32d1180ce7b4fd4b8216e4fd7eb0947c7db7101849f69832a706'
2023-06-09 09:31:47.693 DEBUG (MainThread) [CasambiBt._client] Got public key xxxxxxxxxxxxxxxxxxxxx, xxxxxxxxxxxxxx
2023-06-09 09:31:47.990 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 8): Unknown: b'03'
2023-06-09 09:31:47.992 INFO (MainThread) [CasambiBt._client] Key exchange sucessful
2023-06-09 09:31:47.995 INFO (MainThread) [CasambiBt._client] Authenicating channel...
2023-06-09 09:31:47.997 DEBUG (MainThread) [CasambiBt._client] Auth digest: b'xxxxxxxxxxxxxxxxx'
2023-06-09 09:31:47.999 INFO (MainThread) [CasambiBt._encryption] Encrypting packet: b'xxxxxxxxxxxxxxx' of len 38 with nonce b'xxxxxxxxxxxxx'
2023-06-09 09:31:48.002 DEBUG (MainThread) [CasambiBt._encryption] Encrypted packet: b'xxxxxxxxxxxx'
2023-06-09 09:31:48.004 DEBUG (MainThread) [CasambiBt._encryption] Authenticated packet: b'xxxxxxxxxxxxxxxxxxx'
2023-06-09 09:31:48.290 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 8): Unknown: b'01000080ea32dc7e32707ac2dcdf56704c82c3713c10db1ef3983bbecc3921343d120afaced538323bd3007098835f77a5b40b73fa6b'
2023-06-09 09:31:48.293 INFO (MainThread) [CasambiBt._client] Processing authentication response...
2023-06-09 09:31:48.295 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'xxxxxxxxxxxxxx' of len 54 with nonce b'xxxxxxxx'
2023-06-09 09:31:48.300 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'xxxxxxxxxx'
2023-06-09 09:31:48.303 INFO (MainThread) [CasambiBt._client] Authentication successful
2023-06-09 09:31:48.305 INFO (MainThread) [CasambiBt._casambi] Registerd unit changed handler <bound method CasambiApi._unit_changed_handler of <custom_components.casambi_bt.CasambiApi object at 0x7f6fb21790>>
2023-06-09 09:31:48.309 INFO (MainThread) [homeassistant.components.light] Setting up light.casambi_bt
2023-06-09 09:31:48.312 INFO (MainThread) [homeassistant.components.scene] Setting up scene.casambi_bt
2023-06-09 09:31:49.077 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 8): Unknown: b'02000080d55515deb2af18cd044a23daff126d999121d8862882a5050f284747480508a31634599deb18b749ab'
2023-06-09 09:31:49.081 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'xxxxxxxxxxxx' of len 45 with nonce b'xxxxxxxx'
2023-06-09 09:31:49.083 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'xxxxxxxxxxxx'
2023-06-09 09:31:49.084 DEBUG (MainThread) [CasambiBt._client] Incoming data of type 6: b'xxxxxxxxxx'
2023-06-09 09:31:49.085 INFO (MainThread) [CasambiBt._client] Parsing incoming unit states...
2023-06-09 09:31:49.085 DEBUG (MainThread) [CasambiBt._client] Incoming unit state: b'xxxxxxxxxxxxxxxxxxxx'
2023-06-09 09:31:49.086 DEBUG (MainThread) [CasambiBt._client] Parsed state: Id 1, prio 3, online True, on True, state b'000041'1
2023-06-09 09:31:49.086 INFO (MainThread) [CasambiBt._casambi] Incomming data callback of type 6
2023-06-09 09:31:49.087 DEBUG (MainThread) [CasambiBt._casambi] Handling changed state b'000041' for unit 1
2023-06-09 09:31:49.087 DEBUG (MainThread) [CasambiBt._unit] Parsed b'000041' to UnitState(dimmer=0, vertical=None, rgb=None, white=None, temperature=2913)
2023-06-09 09:31:49.088 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 1
2023-06-09 09:31:49.089 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 1 in group 1
2023-06-09 09:31:49.090 DEBUG (MainThread) [CasambiBt._client] Parsed state: Id 2, prio 3, online True, on True, state b'000041'1
2023-06-09 09:31:49.091 INFO (MainThread) [CasambiBt._casambi] Incomming data callback of type 6
2023-06-09 09:31:49.091 DEBUG (MainThread) [CasambiBt._casambi] Handling changed state b'000041' for unit 2
2023-06-09 09:31:49.091 DEBUG (MainThread) [CasambiBt._unit] Parsed b'000041' to UnitState(dimmer=0, vertical=None, rgb=None, white=None, temperature=2913)
2023-06-09 09:31:49.092 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 2
2023-06-09 09:31:49.093 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 2 in group 1
2023-06-09 09:31:49.094 DEBUG (MainThread) [CasambiBt._client] Parsed state: Id 3, prio 3, online True, on True, state b'000041'1
2023-06-09 09:31:49.095 INFO (MainThread) [CasambiBt._casambi] Incomming data callback of type 6
2023-06-09 09:31:49.095 DEBUG (MainThread) [CasambiBt._casambi] Handling changed state b'000041' for unit 3
2023-06-09 09:31:49.096 DEBUG (MainThread) [CasambiBt._unit] Parsed b'000041' to UnitState(dimmer=0, vertical=None, rgb=None, white=None, temperature=2913)
2023-06-09 09:31:49.096 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 3
2023-06-09 09:31:49.097 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 3 in group 1
2023-06-09 09:31:49.103 DEBUG (MainThread) [CasambiBt._client] Callback on handle c9ffde48-ca5a-0001-ab83-8f519b482f77 (Handle: 8): Unknown: b'03000080f19943fab8edaa22498f6b5acc0aa440f71ade26df1dc60bd277a18eaaea32ef8f69096ec9986b0af57477a7c47279cec3'
2023-06-09 09:31:49.103 INFO (MainThread) [CasambiBt._encryption] Decrypting packet: b'xxxxxxxxxxxxxxxxxxx' of len 53 with nonce b'xxxxxxxxxx'
2023-06-09 09:31:49.107 DEBUG (MainThread) [CasambiBt._encryption] Decrypted package: b'xxxxxxxxxxxxxxx'
2023-06-09 09:31:49.109 DEBUG (MainThread) [CasambiBt._client] Incoming data of type 9: b'09040302830a080202880202820a0201028e02048a020481020387020c840a1000'

Around 10 minutes later it became unavailable.

2023-06-09 09:42:16.274 INFO (MainThread) [CasambiBt._client] Received disconnect callback from xx:xx:xx:xx:xx:xx
2023-06-09 09:42:16.275 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 1
2023-06-09 09:42:16.282 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 1 in group 1
2023-06-09 09:42:16.282 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 2
2023-06-09 09:42:16.284 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 2 in group 1
2023-06-09 09:42:16.285 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 3
2023-06-09 09:42:16.286 DEBUG (MainThread) [custom_components.casambi_bt.light] Handling state change for unit 3 in group 1

If I use a scene at this point it takes a while but works. If I use the light switches it does not work anymore.

2023-06-09 10:35:40.550 INFO (MainThread) [custom_components.casambi_bt.scene] Switching to scene Ambiente 
2023-06-09 10:35:40.551 DEBUG (MainThread) [CasambiBt._casambi] Sending operation SetLevel with payload b'ff' for 704
2023-06-09 10:35:40.551 INFO (MainThread) [CasambiBt._casambi] Trying to reconnect broken connection once.
2023-06-09 10:35:40.552 INFO (MainThread) [CasambiBt._client] Connection to xx:xx:xx:xx:xx:xx
2023-06-09 10:35:42.063 INFO (MainThread) [CasambiBt._client] Connected to xx:xx:xx:xx:xx:xx
2023-06-09 10:35:42.066 INFO (MainThread) [CasambiBt._client] Starting key exchange...

Originally posted by @weinberger in #20 (comment)

Deprecation Home Assistant 2024.5

Version of the custom_component

v0.1.2

Version of Home Assistant

2024.5.0b0

Describe the bug

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:190
First occurred: 22:12:52 (5 occurrences)
Last logged: 22:15:23

Detected that custom integration 'casambi_bt' accesses hass.helpers.httpx_client. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from httpx_client directly at custom_components/casambi_bt/__init__.py, line 75: hass.helpers.httpx_client.get_async_client(), get_cache_dir(hass), please report it to the author of the 'casambi_bt' custom integration

Re-Install Casambi BT integration

Describe the bug
Wonderfull integration that worked very stable.
But... I unfortunately disconnected the Casambi module making the integration not working anymore. Believing it had to do with the Bluetooth adapter or the integration itself I started to re-install everything. I de-installed the HACS part, re-installed everything with restarts in between. Created a new Casambi networks multiple times, but I am not able to connect to the Casambi Network since. It gives a Failed to Connect warning almost directly after pressing the submit button

One thing I noticed is that if I select the Casambi Bluetooth in the discovered integrations list I still find the old bluetooth MAC address pre-entered. Changing this to the new address and adding the password gives an almost instant 'Failed to Connect warning'. This feels like still some configurations from the previous network are somewhere stored. Is there a way to manually delete the integration and start from scratch?

Choosing to install the integration again, and selecting 'Setup another instance of Casambi Bluetooth' does not pre-load the old network ID, but still gives the failure to connect warning without searching for the network.

Thanks for your time!

Screenshot 2024-02-28 at 15 02 09

Versions

  • HA version: 12.0
  • Integration version: 0.1

v0.0.6-rc1 'CasambiClient' object has no attribute '_callbackTask'

I'm on the beta release (v0.0.6-rc1) and see this error:

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/casambi_bt/__init__.py:170
Integration: Casambi Bluetooth (documentation)
First occurred: 12:55:56 AM (829 occurrences)
Last logged: 8:11:37 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/casambi_bt/__init__.py", line 170, in try_reconnect
    await self.casa.disconnect()
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_casambi.py", line 360, in disconnect
    await self._casaClient.disconnect()
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_client.py", line 459, in disconnect
    if self._callbackTask:
AttributeError: 'CasambiClient' object has no attribute '_callbackTask'

Exception occurred in unitChangedCallback <bound method CasambiApi._unit_changed_handler of <custom_components.casambi_bt.CasambiApi object at 0x7f85813d60>>.

Describe the bug
After upgrading the integration to 0.0.6 I got an error in the HA logs. I removed the integration and set it up again once discovered, but still notice the same error again.

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade to 0.0.6
  2. Restart HA
  3. Check the logs

Expected behavior
No error and a working light.

Versions

  • HA version: 2023.4.1

System Information

version core-2023.4.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.10
os_name Linux
os_version 6.1.19-v8
arch aarch64
timezone Europe/Brussels
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4998
Installed Version 1.31.0
Stage running
Available Repositories 1252
Downloaded Repositories 67
HACS Data ok
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 10.0.rc3
update_channel beta
supervisor_version supervisor-2023.04.0
agent_version 1.5.1
docker_version 23.0.2
disk_total 458.4 GB
disk_used 32.8 GB
healthy true
supported true
board yellow
supervisor_api ok
version_api ok
installed_addons AirCast (3.5.2), Spotify Connect (0.12.3), SSH & Web Terminal (13.1.0), File editor (5.5.0), Studio Code Server (5.5.6), Zigbee2MQTT (1.30.3-1), Home Assistant Google Drive Backup (0.110.3), MariaDB (2.5.2), phpMyAdmin (0.8.5), JupyterLab (0.10.0), The Lounge (0.17.1), Glances (0.18.1), Tailscale (0.10.1), ZeroTier One (0.16.2), AdGuard Home (4.8.4), Nginx Proxy Manager (0.12.3), Uptime Kuma (0.7.2), WireGuard (0.8.0), CUPS Print Server (2.0.2), ESPHome (2023.3.2), Grafana (8.2.1), Music Assistant BETA (2.0.0b27), Mosquitto broker (6.2.0)
Dashboards
dashboards 2
resources 28
views 14
mode storage
Recorder
oldest_recorder_run June 11, 2022 at 07:18
current_recorder_run April 7, 2023 at 23:53
estimated_db_size 7009.72 MiB
database_engine mysql
database_version 10.6.10
Spotify
api_endpoint_reachable ok
- Integration version: 0.0.6

Logs

This error originated from a custom integration.

Logger: CasambiBt._casambi
Source: custom_components/casambi_bt/light.py:193
Integration: Casambi Bluetooth (documentation)
First occurred: 23:38:38 (1 occurrences)
Last logged: 23:38:38

Exception occurred in unitChangedCallback <bound method CasambiApi._unit_changed_handler of <custom_components.casambi_bt.CasambiApi object at 0x7f4ddbf160>>.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/CasambiBt/_casambi.py", line 370, in _disconnect_callback
    h(u)
  File "/config/custom_components/casambi_bt/__init__.py", line 201, in _unit_changed_handler
    c(unit)
  File "/config/custom_components/casambi_bt/light.py", line 193, in change_callback
    own_unit.online = unit.online
AttributeError: can't set attribute 'online'

Failed to connect with new long range bt dongle

Describe the bug
The integration is working fine with an older tp-link bt 4.0 dongle but not with a newer by 5.3 long range dongle. I have Casambi lamps both in the kitchen and the living room but with the old bt 4.0 usb stick, I cannot reach both rooms. I am running HA OS latest version and the HA Bluetooth integration is working with both these usb devices.

Logs
Logger: CasambiBt._client
Source: /usr/local/lib/python3.12/site-packages/CasambiBt/_client.py:124
First occurred: 21:05:40 (1 occurrences)
Last logged: 21:05:40

Failed to find client.
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/bleak/backends/bluezdbus/client.py", line 209, in connect
reply = await self._bus.call(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/dbus_fast/aio/message_bus.py", line 384, in call
await future
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/bleak_retry_connector/init.py", line 363, in establish_connection
await client.connect(
File "/usr/local/lib/python3.12/site-packages/habluetooth/wrappers.py", line 300, in connect
connected = await super().connect(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/bleak/init.py", line 605, in connect
return await self._backend.connect(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/bleak/backends/bluezdbus/client.py", line 146, in connect
async with async_timeout(timeout):
File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in aexit
raise TimeoutError from exc_val
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/CasambiBt/_client.py", line 119, in connect
self._gattClient = await establish_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/bleak_retry_connector/init.py", line 387, in establish_connection
_raise_if_needed(name, device.address, exc)
File "/usr/local/lib/python3.12/site-packages/bleak_retry_connector/init.py", line 327, in _raise_if_needed
raise BleakNotFoundError(msg) from exc
bleak_retry_connector.BleakNotFoundError: Casambi Network - 52:47:62:47:71:08: Failed to connect after 4 attempt(s): TimeoutError

Bluetooth gateway (using Shelly) - would it be possible?

Is your feature request related to a problem? Please describe.
Possibility to control lights using Shelly Bluetooth gateway.

Describe the solution you'd like
Allow sending control commands through Shelly BT gateway and HA integration.

Additional context
Devices seems to be discovered, but integration requires bluetooth device connected to HA, which I don't have and most likely it would be a pain to have as I use docker container on NAS. So could it at least in theory work?

Add repair to remove unused Casambi-bt folder

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.