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

Unknown error occurred - SFR Box integration #125336

Closed
AlexT59 opened this issue Sep 5, 2024 · 4 comments · Fixed by #125405
Closed

Unknown error occurred - SFR Box integration #125336

AlexT59 opened this issue Sep 5, 2024 · 4 comments · Fixed by #125405

Comments

@AlexT59
Copy link
Contributor

AlexT59 commented Sep 5, 2024

The problem

Hi,

When I try to add the SFR Box integration to my haos, I have the following error:

I've got this on the api webpage : http://a.b.c.d/api/1.0/?method=system.getInfo

<rsp stat="ok" version="1.0">
<script id="nimlmejbmnecnaghgmbahmbaddhjbecg"/>
<script/>
<script/>
<system product_id="ALGD1-UBE-r0" serial_number="MU1B01140006020043" mac_addr="***hidden***" net_mode="router" net_infra="fttb" uptime="1564075" version_mainfirmware="3DCM020200r015" version_rescuefirmware="3DCM020200r015" version_bootloader="3.00" version_dsldriver="" current_datetime="20240905131928" refclient="" idur="RNCUAOL" alimvoltage="12251" temperature="57.4"/>
</rsp>

What version of Home Assistant Core has the issue?

core-2024.9.0

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

sfr_box

Link to integration documentation on our website

https://www.home-assistant.io/integrations/sfr_box

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-09-05 13:09:08.791 DEBUG (MainThread) [sfrbox_api.bridge] HTTP Response: GET http://192.168.1.1/api/1.0/?method=system.getInfo "HTTP/1.1 200 Ok" <?xml version="1.0" encoding="UTF-8"?><rsp stat="ok" version="1.0"><system product_id="ALGD1-UBE-r0" serial_number="MU1B01140006020043" mac_addr="***hidden***" net_mode="router" net_infra="fttb" uptime="1563441" version_mainfirmware="3DCM020200r015" version_rescuefirmware="3DCM020200r015" version_bootloader="3.00" version_dsldriver="" current_datetime="20240905130854" refclient="" idur="RNCUAOL" alimvoltage="12251" temperature="57.5" />
</rsp>
2024-09-05 13:09:08.792 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 462, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
return await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 366, in async_configure
result = await self._async_configure(flow_id, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 413, in _async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 516, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sfr_box/config_flow.py", line 50, in async_step_user
system_info = await box.system_get_info()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/sfrbox_api/bridge.py", line 179, in system_get_info
return SystemInfo(**xml_response.attrib) # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic/dataclasses.py", line 332, in pydantic.dataclasses._add_pydantic_validation_attributes.new_init
File "pydantic/dataclasses.py", line 447, in pydantic.dataclasses._dataclass_validate_values
pydantic.error_wrappers.ValidationError: 1 validation error for SystemInfo
temperature
value is not a valid integer (type=type_error.integer)

Additional information

The request to http://a.b.c.d/api/1.0/?method=auth.getToken seems to give me a correct token:

<rsp stat="ok" version="1.0">
<script id="nimlmejbmnecnaghgmbahmbaddhjbecg"/>
<script/>
<script/>
<auth token="***hidden***" method="all"/>
</rsp>
@home-assistant
Copy link

home-assistant bot commented Sep 5, 2024

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

Code owner commands

Code owners of sfr_box can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign sfr_box Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


sfr_box documentation
sfr_box source
(message by IssueLinks)

@epenet
Copy link
Contributor

epenet commented Sep 5, 2024

It seems to be a conflict with the temperature (int vs float vs string)

Please open an issue on the library repository: https://github.com/hacf-fr/sfrbox-api/issues

@AlexT59
Copy link
Contributor Author

AlexT59 commented Sep 5, 2024

Done,
thank you for your quick response

@epenet
Copy link
Contributor

epenet commented Sep 6, 2024

v0.0.10 is available now.
I suggest that you look at this Pull Request #104580 - and replicate/duplicate it

@AlexT59 AlexT59 mentioned this issue Sep 6, 2024
19 tasks
@epenet epenet mentioned this issue Sep 11, 2024
19 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2024
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.

2 participants