Skip to content

Setting light brightness not working #79

@jpelgrom

Description

@jpelgrom

I have commissioned an ESP32-C3-DevKitM-1 using the latest Lighting App version available as of creating this issue on the Nabu Casa example site, and have setup Home Assistant 2022.9.6 with v0.3.0 of the server add-on and integration.

When setting the device's brightness, Home Assistant will show an error "Failed to call service light/turn_on. Command failed: unknown_error.".

Home Assistant logs:

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/matter_experimental/light.py:66
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 8:15:00 PM (22 occurrences)
Last logged: 8:31:13 PM

[140326497279600] Command failed: unknown_error
[140325869626480] Command failed: unknown_error
[140325869882144] Command failed: unknown_error
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 1738, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 676, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 931, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 713, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 535, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/config/custom_components/matter_experimental/light.py", line 66, in async_turn_on
    await self._device_type_instance.send_command(
  File "/usr/local/lib/python3.10/site-packages/matter_server/client/model/device_type_instance.py", line 56, in send_command
    return await self.node.matter.client.driver.device_controller.send_command(
  File "/usr/local/lib/python3.10/site-packages/matter_server/client/model/device_controller.py", line 138, in send_command
    return await self._async_send_command(
  File "/usr/local/lib/python3.10/site-packages/matter_server/client/model/device_controller.py", line 228, in _async_send_command
    return await self.client.async_send_command(
  File "/usr/local/lib/python3.10/site-packages/matter_server/client/client.py", line 122, in async_send_command
    return await future
matter_server.client.exceptions.FailedCommand: Command failed: unknown_error

Add-on logs:

2022-09-22 20:26:15 77f1785d-matter-server matter_server.server.server[121] INFO [139757767085456] Deserialized message: CommandMessage(messageId='1a6780f56ab647ac94a5ba164b5dce5e', command='device_controller.SendCommand', args={'nodeid': 4335, 'endpoint': 1, 'payload': LevelControl.Commands.MoveToLevelWithOnOff(level=66, transitionTime=None, optionsMask=0, optionsOverride=0)})
2022-09-22 20:26:15 77f1785d-matter-server chip.CTL[121] INFO Found an existing secure session to [1:00000000000010EF]!
2022-09-22 20:26:15 77f1785d-matter-server matter_server.server.server[121] ERROR [139757767085456] Error handling message: CommandMessage(messageId='1a6780f56ab647ac94a5ba164b5dce5e', command='device_controller.SendCommand', args={'nodeid': 4335, 'endpoint': 1, 'payload': LevelControl.Commands.MoveToLevelWithOnOff(level=66, transitionTime=None, optionsMask=0, optionsOverride=0)})
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/matter_server/server/active_connection.py", line 94, in _run_handler
    await handler(self, msg)
  File "/usr/local/lib/python3.9/dist-packages/matter_server/server/active_connection.py", line 207, in _handle_device_controller_SendCommand
    result = await self.server.stack.device_controller.SendCommand(**msg.args)
  File "/usr/local/lib/python3.9/dist-packages/chip/ChipDeviceCtrl.py", line 892, in SendCommand
    res = ClusterCommand.SendCommand(
  File "/usr/local/lib/python3.9/dist-packages/chip/clusters/Command.py", line 170, in SendCommand
    payloadTLV = payload.ToTLV()
  File "/usr/local/lib/python3.9/dist-packages/chip/clusters/ClusterObjects.py", line 192, in ToTLV
    return self.descriptor.DictToTLV(asdict(self))
  File "/usr/local/lib/python3.9/dist-packages/chip/clusters/ClusterObjects.py", line 186, in DictToTLV
    self.DictToTLVWithWriter('', None, data, tlvwriter)
  File "/usr/local/lib/python3.9/dist-packages/chip/clusters/ClusterObjects.py", line 180, in DictToTLVWithWriter
    field.PutFieldToTLV(field.Tag, val, writer,
  File "/usr/local/lib/python3.9/dist-packages/chip/clusters/ClusterObjects.py", line 79, in PutFieldToTLV
    raise ValueError(
ValueError: Field .transitionTime.transitionTime was not optional, but encountered None

Nothing appears in the device logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions