home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.82k stars 30.08k forks source link

Can't add aranet integration #87923

Closed ithinkihaveacat closed 1 year ago

ithinkihaveacat commented 1 year ago

The problem

I immediately get an error ("Config flow could not be loaded") after attempting to add the aranet integration:

Screenshot_20230212-074252

What version of Home Assistant Core has the issue?

core-2023.2.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

aranet

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: aiohttp.server
Source: components/aranet/config_flow.py:99
First occurred: 9 February 2023 at 23:58:16 (6 occurrences)
Last logged: 07:42:41

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 145, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 148, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 798, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 826, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 335, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/aranet/config_flow.py", line 99, in async_step_user
    adv = Aranet4Advertisement(
  File "/usr/local/lib/python3.10/site-packages/aranet4/client.py", line 203, in __init__
    value = struct.unpack(value_fmt, raw_bytes[0:7])
struct.error: unpack requires a buffer of 7 bytes

Additional information

No response

home-assistant[bot] commented 1 year ago

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

Code owner commands Code owners of `aranet` 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 aranet` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


aranet documentation aranet source (message by IssueLinks)

aschmitz commented 1 year ago

Sorry, I'm not sure how I missed the notification for this.

I'm a little surprised by the abnormally short broadcast there. A few questions:

  1. Does this happen repeatably, or was it just an issue with a mis-received broadcast one time? (I assume the former, but if it's the latter, that would be good to know.)
  2. What firmware version is your Aranet4 device on?
  3. Do you have the "Smart Home integration" toggle enabled or disabled in the app?
  4. Have you had success with any other Bluetooth integrations with Home Assistant?
  5. Do you have a "Sensor display name" set for your device? If so, can you share what it is?

My understanding is that the broadcast is generally fixed-length, and doesn't have optional fields, but if I can reproduce the issue locally I can try to make a PR to the aranet4 package to resolve the issue.

(Also, if you have the ability to easily capture that BLE broadcast, that would certainly be interesting to have as well, but it's a moderately complicated procedure.)

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.