panasonic_cc: 403 forbidden

Hi

Getting a 403 forbidden error even though my password is correct (tested on Panasonic comfort cloud app)

Anybody has the same issue? It was working fine before.

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/panasonic_cc/panasonic.py:23
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 9:22:12 PM (10 occurrences)
Last logged: 9:38:07 PM

[140446803720848] Invalid response, status code: 403 - Data: <html> <head><title>403 Forbidden</title></head> <body> <center><h1>403 Forbidden</h1></center> </body> </html>
[140446797973632] Invalid response, status code: 403 - Data: <html> <head><title>403 Forbidden</title></head> <body> <center><h1>403 Forbidden</h1></center> </body> </html>
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 346, in set_device
    self._api.set_device(
  File "/usr/local/lib/python3.9/site-packages/pcomfortcloud/session.py", line 389, in set_device
    raise ResponseError(response.status_code, response.text)
pcomfortcloud.session.ResponseError: Invalid response, status code: 403 - Data: <html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
</body>
</html>


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 189, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1627, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1664, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 677, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 964, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 714, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 588, in async_service_temperature_set
    await entity.async_set_temperature(**kwargs)
  File "/config/custom_components/panasonic_cc/climate.py", line 106, in async_set_temperature
    await self._api.set_temperature(**kwargs)
  File "/config/custom_components/panasonic_cc/panasonic.py", line 266, in set_temperature
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/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 "/usr/local/lib/python3.9/site-packages/pcomfortcloud/session.py", line 99, in login
    self._create_token()
  File "/usr/local/lib/python3.9/site-packages/pcomfortcloud/session.py", line 132, in _create_token
    raise ResponseError(response.status_code, response.text)
pcomfortcloud.session.ResponseError: Invalid response, status code: 403 - Data: <html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
</body>
</html>


About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 8
  • Comments: 122 (17 by maintainers)

Most upvoted comments

I’ve updated the patch https://jimmyk.se/git/panasonic_cc.zip it now correctly includes clientId and the correct accept and content-type headers.

I’ve made a HACS release of the temp version.

Panasonic has some issues with the Temperature and Energy data… Sometimes they stop updating (happens in their app as well)… Restarting HA might help… it seems to depend on what server you get connected to (it’s load balanced) and as far as I’ve gathered the problem occurs when you(HA) and your heatpump is connected to different servers.

@Lem0nz I might release this as an intermediate version, I haven’t decided yet. Fingers crossed that this patch lasts a little longer than the previous one 😃

Yes, it seems they changed something more… guess they really do not like 3rd party apps to access their API. I will try to find a solution and publish a patch (hopefully later today).

Here is a temp version running a local copy of pcomfortcloud https://jimmyk.se/git/panasonic_cc.zip. I will not release this on git/hacs since it’s including a modified version of lostfields code. But you can install it by replacing the content of your custom_components\panasonic_cc directory with the content of the zip.

if you want to fix this temporary till the new pull request is accepted. for supervised: (at your own risk) ssh to host shell into the home assistant docker container: docker exec -it homeassistant /bin/bash cd /usr/local/lib/python3.10/site-packages/pcomfortcloud vi session.py and make the change like https://github.com/lostfields/python-panasonic-comfort-cloud/pull/63/files

this worked for me. and will be overwritten as the new version is released.

Hi, Yes, it looks like they implemented stricter version checking on the server side, so lostfields way of adding a way higher version number no longer works. And unfortunately, he never merged my pull request with auto version detection. The latest app version is 1.15.1. I will see if I can’t get my v2.0 in to a release worthy state, it doesn’t rely on the lib from lostfields and support auto pc cloud app version detection.

What is the “ESP route”? ESP with IR? Do you have a link?

Using a ESP32/ESP8266 with a level converter as detailed here https://github.com/sockless-coding/panasonic_cc/issues/50

@Lem0nz that’s due to a blocking call to the Apple app store to fetch the latest app version, this is only called on first run or on 403 response.

Adding charset=utf-8 to the headers is only half of the solution, they now generate a clientid and that is required to get a new token.

Yeah, however it is fair to give them a chance. If things go right, they may consider to support. At the end, this may also be beneficial for them. Thanks! Samuel Franch Calpe No imprimeixis el correu si no és estrictament necessari. El medi ambient t’ho agraïrà.🌲

El 14 jul 2022, a les 13:34, Jimmy Everling @.***> va escriure:

@BlueSam73 I doubt they will respond with anything useful since they do not publish this API. We have gotten this API by reverse engineering the comfort cloud app.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

@BinnenBeest It’s not related to HA the reason your integration still works is that your auth token is still valid. Panasonic has changed something in the login process causing this issue.

Same problem for me. Patch worked fine until today. Panasonic app runs OK, so, is not related to equipment. Hope can be solved. Makes it sense to write a claim to Panasonic? (update) I already placed a claim asking about changes in API and their policy of use by third party integrators.

unfortunatelly this modification is not solved the problem for me. still 403.

Did you restart home assistant?

No 403, but now the log indicates a such:

image

Manifest reads:

image

replace “requirements”:[“pcomfortcloud==0.0.2”] by “requirements”: [“git+https://github.com/Th0masDB/python-panasonic-comfort-cloud@master#pcomfortcloud==0.0.2”]. And maybe the version 1.0.30 to 1.15.0 Then restart ha It also works for me (thanks for the solution 👍 )

Has been a bit iffy for a few days and then stopped completely this morning, deleted the integration and now it wont let me add it back in, just get this error so think Panasonic have changed something at there end.

PCC .

I have exactly the same issue since this week… Really frustrating that in this hot weather I can’t control my AC using Home Assistant.

I have the opposite problem, it’s freezing here and I have to go find the remote