sockless-coding / panasonic_cc

Panasonic Comfort Cloud - Home Assistant Component
MIT License
160 stars 36 forks source link

429 suspicious activity and locked out for hours from Panasonic comfort cloud - account with multiple AC's #144

Closed FairSSL closed 1 month ago

FairSSL commented 11 months ago

Hi,

After installing in HA thru HACS and entering a login for Panasonic comfort cloud, all my AC's (3 locations) are visible and give data to HA. Interaction with the AC is possible, I can turn it on-off, etc. I see temperature. All seems ok.

After 2-3 interactions with the AC, I get errors and I am unable to use or access the AC's thru HA but also get blocked/logged out in the app. Note the app was not open or active at this point, I have also tried logging out of the app first to avoid both interacting at the same time, it makes no difference, the account with multiple AC's gets locked after a little while (<1 hour).

Having tried to research the errors I find other people making interaction with this API service, experiencing this if they have more than one AC in the account and it seems something is triggering Panasonics systems that there is too many hits within a certain amount of time and they then block the account for x number of hours before opening again. But without more AC's it becomes difficult for the developer to test/experience.

In my case my account had 3 locations with a total of 10 AC's, I tried removing 2, it did not help. I tried disabling all but two, it did not help.

I then found some people solved the problem for a similair script for Homey by making a new account and giving access only to a few AC's for this account and using it only to automate. I have created an account with 2 AC's in now. But when I connect this account, it shows me that it found the 8 AC's from the previous account. Most likely something in configuration or cache is not removed when deleting the hub?

To be clear just like in the other threads I have found with people having this problem, the mobile app can interact without any problems, including with 10 AC's and even with two phones active on the same app and account. It is only when using the scripts and this component that after 2-3 interactions everything is logged out and blocked for hours before being restored.

I have tried uninstalling, installing, deleting, etc. multiple times it makes no difference, the new account with access to only 2 AC's (confirmed in the app), when I connect it in HA hub, it shows 8 AC's from the previous account that is no longer connected.

I even tried connecting the old primary account, then adding a secondary account as the next hub, thinking I would disable or delete the first after, but when connecting the second I get an error, possibly due to being the same AC ids'?

I can possibly solve this myself, if you help me with information on how I can add the secondary account, without it getting mixed in the old data, i.e. how do I remove the old data when uninstalling the component is not enough. As I think the secondary account will not get locked out, as it only has two AC's. I can then add a third account for the next two, etc.

If anyone knows how to remove the cached information let me know.

Alternatively if there is a way to test limiting how many calls of certain types or just in general that are made within x time, we can test what triggers it and what does not?

I am happy to do more debugging, including I can do tests directly on the code or with remote work. I do normally work with programming, but I don't normallyt work in Python or Home Assistant, so my knowledge there is not enough to fix it without help/tips.

Thank you. Regards Sole

Using HA Core OS Core 2023.11.3 Supervisor 2023.11.6

I see errors getting http status code 429 I get messages saying suspicious acitivity detected from Panasonic Account blocked in the app

A few logged errors to choose from:

2023-12-01 23:28:11.159 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry  for panasonic_cc
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/__init__.py", line 79, in async_setup_entry
    devices = await hass.async_add_executor_job(api.get_devices)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 207, in get_devices
    self.login()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 106, in login
    self._create_token()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 164, in _create_token
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 
2023-12-01 23:28:38.945 ERROR (MainThread) [frontend.js.latest.202310302] Uncaught error from Chrome 119.0.0.0 on Windows 10
TypeError: Cannot read properties of null (reading 'removeEventListener')
renderHeading (src/components/ha-dialog.ts:51:24)
apply (src/scoped-custom-element-registry.js:262:44)
mainWindow.history.pushState (src/dialogs/make-dialog-manager.ts:129:7)

2023-12-01 23:50:25.330 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139950573469248] Invalid response, status code: 429 - Data: 
Traceback (most recent call last):
  File "/config/custom_components/panasonic_cc/panasonic.py", line 21, in wrapper_call
    func(*args, **kwargs)
  File "/config/custom_components/panasonic_cc/panasonic.py", line 353, in set_device
    self._api.set_device(
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 426, in set_device
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 230, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/scene/__init__.py", line 114, in _async_activate
    await self.async_activate(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/scene.py", line 334, in async_activate
    await async_reproduce_state(
  File "/usr/src/homeassistant/homeassistant/helpers/state.py", line 67, in async_reproduce_state
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/helpers/state.py", line 61, in worker
    await platform.async_reproduce_states(
  File "/usr/src/homeassistant/homeassistant/components/climate/reproduce_state.py", line 92, in async_reproduce_states
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/components/climate/reproduce_state.py", line 78, in _async_reproduce_states
    await call_service(SERVICE_SET_FAN_MODE, [ATTR_FAN_MODE])
  File "/usr/src/homeassistant/homeassistant/components/climate/reproduce_state.py", line 51, in call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/climate.py", line 160, in async_set_fan_mode
    await self._api.set_fan_mode(fan_mode)
  File "/config/custom_components/panasonic_cc/panasonic.py", line 284, in set_fan_mode
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/panasonic.py", line 23, in wrapper_call
    args[0]._api.login()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 106, in login
    self._create_token()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 164, in _create_token
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 
2023-12-01 23:50:27.213 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139950573469248] Invalid response, status code: 429 - Data: 
Traceback (most recent call last):
  File "/config/custom_components/panasonic_cc/panasonic.py", line 21, in wrapper_call
    func(*args, **kwargs)
  File "/config/custom_components/panasonic_cc/panasonic.py", line 353, in set_device
    self._api.set_device(
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 426, in set_device
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 230, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/scene/__init__.py", line 114, in _async_activate
    await self.async_activate(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/scene.py", line 334, in async_activate
    await async_reproduce_state(
  File "/usr/src/homeassistant/homeassistant/helpers/state.py", line 67, in async_reproduce_state
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/helpers/state.py", line 61, in worker
    await platform.async_reproduce_states(
  File "/usr/src/homeassistant/homeassistant/components/climate/reproduce_state.py", line 92, in async_reproduce_states
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/components/climate/reproduce_state.py", line 56, in _async_reproduce_states
    await call_service(SERVICE_SET_HVAC_MODE, [], {ATTR_HVAC_MODE: state.state})
  File "/usr/src/homeassistant/homeassistant/components/climate/reproduce_state.py", line 51, in call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/climate.py", line 127, in async_set_hvac_mode
    await self._api.turn_off()
  File "/config/custom_components/panasonic_cc/panasonic.py", line 234, in turn_off
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/panasonic.py", line 23, in wrapper_call
    args[0]._api.login()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 106, in login
    self._create_token()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 164, in _create_token
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 

2023-11-24 12:38:30.161 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry  for panasonic_cc
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/__init__.py", line 79, in async_setup_entry
    devices = await hass.async_add_executor_job(api.get_devices)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 207, in get_devices
    self.login()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 106, in login
    self._create_token()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 164, in _create_token
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 

2023-12-01 11:53:15.283 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry  for panasonic_cc
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 557, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/__init__.py", line 102, in async_unload_entry
    await asyncio.wait(
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 425, in wait
    raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly.
2023-12-01 11:53:15.285 WARNING (MainThread) [py.warnings] /usr/src/homeassistant/homeassistant/config_entries.py:576: RuntimeWarning: coroutine 'ConfigEntries.async_forward_entry_unload' was never awaited
  return False

2023-12-01 23:11:58.506 ERROR (MainThread) [homeassistant.components.automation.office_ac_off] Office AC Off: Error executing script. Unexpected error for device at pos 1: Invalid response, status code: 429 - Data: 
Traceback (most recent call last):
  File "/config/custom_components/panasonic_cc/panasonic.py", line 21, in wrapper_call
    func(*args, **kwargs)
  File "/config/custom_components/panasonic_cc/panasonic.py", line 353, in set_device
    self._api.set_device(
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 426, in set_device
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 720, in _async_device_step
    await device_action.async_call_action_from_config(
  File "/usr/src/homeassistant/homeassistant/components/device_automation/action.py", line 71, in async_call_action_from_config
    await platform.async_call_action_from_config(hass, config, variables, context)
  File "/usr/src/homeassistant/homeassistant/components/climate/device_action.py", line 97, in async_call_action_from_config
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/climate.py", line 127, in async_set_hvac_mode
    await self._api.turn_off()
  File "/config/custom_components/panasonic_cc/panasonic.py", line 234, in turn_off
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/panasonic.py", line 23, in wrapper_call
    args[0]._api.login()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 106, in login
    self._create_token()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 164, in _create_token
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 
2023-12-01 23:11:58.511 ERROR (MainThread) [homeassistant.components.automation.office_ac_off] While executing automation automation.office_ac_off
Traceback (most recent call last):
  File "/config/custom_components/panasonic_cc/panasonic.py", line 21, in wrapper_call
    func(*args, **kwargs)
  File "/config/custom_components/panasonic_cc/panasonic.py", line 353, in set_device
    self._api.set_device(
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 426, in set_device
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 655, in async_trigger
    await self.action_script.async_run(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1578, in async_run
    return await asyncio.shield(run.async_run())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 420, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 470, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 493, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 720, in _async_device_step
    await device_action.async_call_action_from_config(
  File "/usr/src/homeassistant/homeassistant/components/device_automation/action.py", line 71, in async_call_action_from_config
    await platform.async_call_action_from_config(hass, config, variables, context)
  File "/usr/src/homeassistant/homeassistant/components/climate/device_action.py", line 97, in async_call_action_from_config
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/climate.py", line 127, in async_set_hvac_mode
    await self._api.turn_off()
  File "/config/custom_components/panasonic_cc/panasonic.py", line 234, in turn_off
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/panasonic.py", line 23, in wrapper_call
    args[0]._api.login()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 106, in login
    self._create_token()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 164, in _create_token
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 
2023-12-01 23:11:59.010 ERROR (MainThread) [homeassistant.components.automation.office_ac_off] Office AC Off: Error executing script. Unexpected error for device at pos 1: Invalid response, status code: 429 - Data: 
Traceback (most recent call last):
  File "/config/custom_components/panasonic_cc/panasonic.py", line 21, in wrapper_call
    func(*args, **kwargs)
  File "/config/custom_components/panasonic_cc/panasonic.py", line 353, in set_device
    self._api.set_device(
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 426, in set_device
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 720, in _async_device_step
    await device_action.async_call_action_from_config(
  File "/usr/src/homeassistant/homeassistant/components/device_automation/action.py", line 71, in async_call_action_from_config
    await platform.async_call_action_from_config(hass, config, variables, context)
  File "/usr/src/homeassistant/homeassistant/components/climate/device_action.py", line 97, in async_call_action_from_config
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/climate.py", line 127, in async_set_hvac_mode
    await self._api.turn_off()
  File "/config/custom_components/panasonic_cc/panasonic.py", line 234, in turn_off
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/panasonic.py", line 23, in wrapper_call
    args[0]._api.login()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 106, in login
    self._create_token()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 164, in _create_token
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 
2023-12-01 23:11:59.014 ERROR (MainThread) [homeassistant.components.automation.office_ac_off] While executing automation automation.office_ac_off
Traceback (most recent call last):
  File "/config/custom_components/panasonic_cc/panasonic.py", line 21, in wrapper_call
    func(*args, **kwargs)
  File "/config/custom_components/panasonic_cc/panasonic.py", line 353, in set_device
    self._api.set_device(
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 426, in set_device
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 655, in async_trigger
    await self.action_script.async_run(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1578, in async_run
    return await asyncio.shield(run.async_run())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 420, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 470, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 493, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 720, in _async_device_step
    await device_action.async_call_action_from_config(
  File "/usr/src/homeassistant/homeassistant/components/device_automation/action.py", line 71, in async_call_action_from_config
    await platform.async_call_action_from_config(hass, config, variables, context)
  File "/usr/src/homeassistant/homeassistant/components/climate/device_action.py", line 97, in async_call_action_from_config
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/climate.py", line 127, in async_set_hvac_mode
    await self._api.turn_off()
  File "/config/custom_components/panasonic_cc/panasonic.py", line 234, in turn_off
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/panasonic.py", line 23, in wrapper_call
    args[0]._api.login()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 106, in login
    self._create_token()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/session.py", line 164, in _create_token
    raise ResponseError(response.status_code, response.text)
custom_components.panasonic_cc.pcomfortcloud.session.ResponseError: Invalid response, status code: 429 - Data: 

2023-12-01 23:16:10.230 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Error trying to get device d71b1acc0f6945f896ab46a355f81de5a7af04c5d0cf8968740bb05cd02e1b91 state, probably expired token, trying to update it...
2023-12-01 23:16:10.233 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Error trying to get device d71b1acc0f6945f896ab46a355f81de5a7af04c5d0cf8968740bb05cd02e1b91 state, probably expired token, trying to update it...
2023-12-01 23:16:10.234 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Error trying to get device 74e1ada6e728a9c2382b2e84e1d6fe005990437f60a1478626a532a6acc14c31 state, probably expired token, trying to update it...
2023-12-01 23:16:10.246 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Error trying to get device 099b59fa7aeb355812c325918771a36a2076b542e723f599029026bff9b18ade state, probably expired token, trying to update it...
2023-12-01 23:16:10.246 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Error trying to get device 099b59fa7aeb355812c325918771a36a2076b542e723f599029026bff9b18ade state, probably expired token, trying to update it...
2023-12-01 23:16:10.249 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Error trying to get device 8c072bb735bbf3d49c9a65c29f50389f89dae7b46abb195e78eb815961c32b80 state, probably expired token, trying to update it...
2023-12-01 23:16:10.255 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Error trying to get device 74e1ada6e728a9c2382b2e84e1d6fe005990437f60a1478626a532a6acc14c31 state, probably expired token, trying to update it...
2023-12-01 23:16:10.267 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Error trying to get device c7aef25d4681d8e97315aafe280c465573a309c181662ebed47f3a45aab9355c state, probably expired token, trying to update it...
2023-12-01 23:16:10.273 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Error trying to get device 64c20d4fbfb75263c071d907d88eea22157a7a9e8031cb5889f1881953fad660 state, probably expired token, trying to update it...
2023-12-01 23:16:10.287 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Failed to renew token for device d71b1acc0f6945f896ab46a355f81de5a7af04c5d0cf8968740bb05cd02e1b91, giving up for now
2023-12-01 23:16:10.296 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Failed to renew token for device 099b59fa7aeb355812c325918771a36a2076b542e723f599029026bff9b18ade, giving up for now
2023-12-01 23:16:10.328 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Failed to renew token for device c7aef25d4681d8e97315aafe280c465573a309c181662ebed47f3a45aab9355c, giving up for now
2023-12-01 23:16:10.330 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Failed to renew token for device d71b1acc0f6945f896ab46a355f81de5a7af04c5d0cf8968740bb05cd02e1b91, giving up for now
2023-12-01 23:16:10.333 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Failed to renew token for device 64c20d4fbfb75263c071d907d88eea22157a7a9e8031cb5889f1881953fad660, giving up for now
2023-12-01 23:16:10.335 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Failed to renew token for device 74e1ada6e728a9c2382b2e84e1d6fe005990437f60a1478626a532a6acc14c31, giving up for now
2023-12-01 23:16:10.336 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Failed to renew token for device 8c072bb735bbf3d49c9a65c29f50389f89dae7b46abb195e78eb815961c32b80, giving up for now
2023-12-01 23:16:10.341 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Failed to renew token for device 099b59fa7aeb355812c325918771a36a2076b542e723f599029026bff9b18ade, giving up for now
2023-12-01 23:16:10.347 DEBUG (MainThread) [custom_components.panasonic_cc.panasonic] Failed to renew token for device 74e1ada6e728a9c2382b2e84e1d6fe005990437f60a1478626a532a6acc14c31, giving up for now
Auka84 commented 11 months ago

Hi. I have 6 AC’s and I just have the same error today :(

pensionado commented 11 months ago

I have 1 AC and since this morning it is no longer working for me, same error HTTP 429

pensionado commented 11 months ago

Just checked my HA log, and since 2 am local time the integration gets a 503 every 5 minutes and it appears that the 503 is retried several times (?). So seeing this I can understand the 429

Auka84 commented 11 months ago

Same for me. So something change this night at panasonic side

All my AC's stop to work in HA today (but the panasonic app works) so all my automation didn't work this morning and woke up in a polar cold :(

I deactivate the plug in in HA and I hope a fix :(

raczgy commented 11 months ago

Same issue here with 5 ACs. I disabled automations. the panasonic app seems to be working.

jouni-hakala commented 11 months ago

Same here with 3 ACs. Panasonic app is still working.

Auka84 commented 11 months ago

To everybody , did you try to reconnect the plug in or not ? I disabled it and I plan to wait 48h before trying again

CarloCepelli commented 11 months ago

Same situation here: 3 ACs, App Ok, remote OK, Home Assistant returns 42901 error since last night, reloaded plug and whole server and nada. Last known working was 23.00 - 10. dec.2023 (Rome) switched of by automation.

dardour7 commented 11 months ago

hi, Same problem today, Panasonic App works

mkz212 commented 11 months ago

Try logout from Panasonic app and login again - can you login? I have error : Suspicious activity and account blocked for 24h.

dardour7 commented 11 months ago

I'm afraid to try because if the app bans me even for 24 hours I won't be able to manage my heaters (unless I find the battery and remote control) :-)

mkz212 commented 11 months ago

I suspect that if you have a ban, they will log you out right away. I had it too - that it did not work through the API, in the application it worked for a while and then ban for 24h. So better find battery and remote ;)

pensionado commented 11 months ago

OK, the ban on the account is lifted after 24 hours, You can then use the account in the app, but NOT in HA, I get '''pcomfortcloud.session.ResponseError: Invalid response, status code: 500 - Data: {"code":5001,"message":"DB system error due to db system"} """ The account is not banned and is still usable via the app. Suspect for as long as I dont force the code 500 I will not be banned.

dardour7 commented 11 months ago

Hi, This morning I just reloaded the Panasonic integration on HA and it works again. hoping it holds

mkz212 commented 11 months ago

They blocked my account again for 24 hours due to incorrect login attempts. 😓

codyc1515 commented 10 months ago

May be solved by #152 if we could disable polling.

github-actions[bot] commented 1 month ago

Hi there! This issue has been marked as stale due to inactivity. If you believe this is still relevant, please let us know. Otherwise, it will be closed soon.

github-actions[bot] commented 1 month ago

This issue has been automatically closed due to inactivity. If you still need help, feel free to reopen or create a new issue. Thank you!