Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HomeKit controller string indices must be integers #85400

Closed
swat-max opened this issue Jan 7, 2023 · 5 comments · Fixed by #85853
Closed

HomeKit controller string indices must be integers #85400

swat-max opened this issue Jan 7, 2023 · 5 comments · Fixed by #85853

Comments

@swat-max
Copy link

swat-max commented Jan 7, 2023

The problem

I am getting an error about string indices must be integers in my HomeKit controller which I use to control my alarm through the alarm control panel. This problem just started in the latest HA version- I have changed nothing about my configuration other than updating HA, and this integration has worked for a long time.

What version of Home Assistant Core has the issue?

2023.1.1

What was the last working version of Home Assistant Core?

2022.12.9

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

HomeKit controller and alarm panel

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.core
Source: components/homekit_controller/connection.py:758 
First occurred: 4:29:31 PM (3 occurrences) 
Last logged: 4:29:49 PM

Error executing service: <ServiceCall alarm_control_panel.alarm_disarm (c:01GP726MYPV7K8DQ79F1BPJPP9): entity_id=['alarm_control_panel.panel']>
Error executing service: <ServiceCall alarm_control_panel.alarm_disarm (c:01GP726P6DDKASK2ZW9NASFX5E): entity_id=['alarm_control_panel.panel']>
Error executing service: <ServiceCall alarm_control_panel.alarm_disarm (c:01GP726Q62WT57TQ9RZZ6V6DGP): entity_id=['alarm_control_panel.panel']>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1773, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1792, 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 678, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 958, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/alarm_control_panel.py", line 103, in async_alarm_disarm
    await self.set_alarm_state(STATE_ALARM_DISARMED, code)
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/alarm_control_panel.py", line 119, in set_alarm_state
    await self.async_put_characteristics(
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/entity.py", line 90, in async_put_characteristics
    return await self._accessory.put_characteristics(payload)
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 758, in put_characteristics
    await self.pairing.put_characteristics(characteristics)
  File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ip/pairing.py", line 303, in put_characteristics
    aid, iid = characteristic["aid"], characteristic["iid"]
TypeError: string indices must be integers

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jan 7, 2023

Hey there @Jc2k, @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit_controller) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homekit_controller can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign homekit_controller Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


homekit_controller documentation
homekit_controller source
(message by IssueLinks)

@liebehentze
Copy link

liebehentze commented Jan 11, 2023

I have got similar problems with integration of velux connectivity kit via homekit (same core version):

2023-01-11 10:07:05.817 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall cover.open_cover (c:01GPG1A5B6P2P1VJFDHM4MNK5N): entity_id=['cover.schlafzimmer_all_roller_shutter_secure']>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1773, in catch_exceptions
await coro_or_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1792, 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 678, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 958, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/template/cover.py", line 330, in async_open_cover
await self.async_run_script(self._open_script, context=self._context)
File "/usr/src/homeassistant/homeassistant/helpers/template_entity.py", line 414, in async_run_script
return await script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1524, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 409, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 453, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 476, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 687, in _async_call_service_step
await self._async_run_long_action(service_task)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 648, in _async_run_long_action
long_task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1755, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1792, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 473, in _service_handler
await self.async_turn_on(variables=service.data, context=service.context)
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 432, in async_turn_on
await coro
File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 462, in _async_run
return await self.script.async_run(script_vars, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1524, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 409, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 453, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 476, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 923, in _async_if_step
await self._async_run_script(if_data["if_then"])
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1029, in _async_run_script
await self._async_run_long_action(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 648, in _async_run_long_action
long_task.result()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1524, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 409, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 453, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 476, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 684, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1755, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1792, 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 678, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 958, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/homekit_controller/cover.py", line 227, in async_open_cover
await self.async_set_cover_position(position=100)
File "/usr/src/homeassistant/homeassistant/components/homekit_controller/cover.py", line 236, in async_set_cover_position
await self.async_put_characteristics(
File "/usr/src/homeassistant/homeassistant/components/homekit_controller/entity.py", line 90, in async_put_characteristics
return await self._accessory.put_characteristics(payload)
File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 758, in put_characteristics
await self.pairing.put_characteristics(characteristics)
File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ip/pairing.py", line 303, in put_characteristics
aid, iid = characteristic["aid"], characteristic["iid"]
TypeError: string indices must be integers

@bdraco
Copy link
Member

bdraco commented Jan 11, 2023

@liebehentze
Copy link

Sure, thanks for taking a look. The error only happens on closing/opening during the shutter roller is opening or closing, hope this helps.

home-assistant_homekit_2023-01-12T07-31-12.046Z.log

@liebehentze
Copy link

I opened a pull request:
Jc2k/aiohomekit#278

since I believe the problem is located in this lib and it fixes the problem at my home. Hopefully it will be included in next release of aiohomekit, next release of home assistant would need to update the dependency aiohomekit.

Happy to get feedback if I'm on the right track.

bdraco added a commit to bdraco/home-assistant that referenced this issue Jan 13, 2023
@bdraco bdraco mentioned this issue Jan 13, 2023
19 tasks
bdraco added a commit that referenced this issue Jan 14, 2023
balloob pushed a commit that referenced this issue Jan 17, 2023
rlippmann pushed a commit to rlippmann/core that referenced this issue Jan 18, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants