sockless-coding / panasonic_cc

Panasonic Comfort Cloud - Home Assistant Component
MIT License
177 stars 38 forks source link

Cannot install second account of Panasonic Cloud on second HA #330

Closed Adavidebaba closed 2 weeks ago

Adavidebaba commented 2 weeks ago

Checklist

What version of Home Assistant Core?

Core-2024.8.2

Describe the issue

I have two HA installed on two different NAS on two different subnets. Everything works fine but Comfort Cloud integration seems it can only be running in one HA instance at time, not both. Of course each instsnce have a different Panasonic account and I logged in an out from the app multiple times. I thing maybe because externally both instances connect to Panasonic Cloud came from the same ip.. ? Thanks for any help

Error/Debug Logs

Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:427
First occurred: 09:51:57 (6 occurrences)
Last logged: 10:30:46

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 456, 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 83, 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 "/config/custom_components/panasonic_cc/config_flow.py", line 119, in async_step_user
    return await self._create_device(user_input[CONF_USERNAME], user_input[CONF_PASSWORD])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/config_flow.py", line 87, in _create_device
    return await self._create_entry(username, password)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/config_flow.py", line 49, in _create_entry
    if entry.data[KEY_DOMAIN] == PANASONIC_DOMAIN:
       ~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'domain'
Adavidebaba commented 2 weeks ago

maybe is on the problem is on the api server.. now i see this on all my installations.

``Could not get groups, trying to re-authenticate Traceback (most recent call last): File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 64, in start_session await self._get_groups() File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 79, in _get_groups self._groups = await self.execute_get( ^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/panasonic_cc/pcomfortcloud/panasonicsession.py", line 145, in execute_get await check_response(response, function_description, expected_status_code) File "/config/custom_components/panasonic_cc/pcomfortcloud/helpers.py", line 32, in check_response raise exceptions.ResponseError( custom_components.panasonic_cc.pcomfortcloud.exceptions.ResponseError: (get_groups: Expected status code 200, received: 412: { "code":41201, "message":"Precondition Failed" }