Core: Set brightness percentage doesn't work in HomeKit scene

Created on 11 Apr 2020  路  6Comments  路  Source: home-assistant/core

The problem


I have a Shelly RGBW2 that is exposed via HomeKit integration. This Shelly is part of scene that sets the brightness to 2%. After the upgrade the Home Assistant 0.108.0, the scene won't works anymore, with the cause below.

Environment

  • Home Assistant Core release with the issue: 0.108.2
  • Last working Home Assistant Core release (if known): 0.107.7
  • Operating environment (Home Assistant/Supervised/Docker/venv): Docker
  • Integration causing this issue: HomeKit
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/homekit

Problem-relevant configuration.yaml

homekit:
  auto_start: false
  filter:
    exclude_domains:
      - automation
      - script
      - binary_sensor
      - person

Traceback/Error logs

2020-04-11 12:35:26 DEBUG (Thread-148) [pyhap.characteristic] client_update_value: Brightness to 2 from client: ('192.168.178.20', 60451)
2020-04-11 12:35:26 DEBUG (Thread-148) [homeassistant.components.homekit.type_lights] _set_chars: {'On': 0, 'Brightness': 2}
2020-04-11 12:35:26 INFO (Thread-148) [pyhap.hap_server] 192.168.178.20 - "PUT /characteristics HTTP/1.1" 204 -
2020-04-11 12:35:26 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit/accessories.py", line 219, in async_call_service
    await self.hass.services.async_call(domain, service, service_data)
  File "/usr/src/homeassistant/homeassistant/core.py", line 1210, in async_call
    processed_data = handler.schema(service_data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 208, in __call__
    return self._exec((Schema(val) for val in self.validators), v)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 287, in _exec
    raise e if self.msg is None else AllInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 283, in _exec
    v = func(v)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
    return schema(data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['brightness_pct']

Additional information

If I set the brightness percentage outside the scene, the integration works fine.

homekit

All 6 comments

Are you using brightness_pct in your scene? If so, replace it with brightness. The use of brightness_pct in a scene is deprecated.

I created the scene in the Home app on my iPhone, I didn't set any attribute, I just set the desired percentage on the graphic control

Thanks for the clarification on that 馃憤

@lucaoliano I fixed this in HAP-python 2.8.2 which is in 0.108.3 so it should work if you update.

was merged in #33965

I confirm, now works again. Thank you very much.

Was this page helpful?
0 / 5 - 0 ratings