panasonic_cc icon indicating copy to clipboard operation
panasonic_cc copied to clipboard

Error fetching device data from API: (get_device: Expected status code 200, received: 403: {"code":4300,"message":"Have no authority to the request"}

Open maurilloh opened this issue 1 year ago • 30 comments

After upgrade from version 1.0.58 i have this issue, some one could help me? thanks.

maurilloh avatar Aug 08 '24 13:08 maurilloh

Me too...

AndreaMagis avatar Aug 08 '24 14:08 AndreaMagis

I also have the same problem following the update to version 1.1.16. I can’t downgrade to version 1.0.58, which was working fine before. It is not available in HACS. Thank you very much.

ddemarch avatar Aug 08 '24 14:08 ddemarch

Same here image

mtanasiewicz avatar Aug 08 '24 14:08 mtanasiewicz

Hello, can you please provide some more detailed logs. That message just says that you do not have any permissions to access the device.

sockless-coding avatar Aug 08 '24 17:08 sockless-coding

Is this what you are looking for, or should I search elsewhere?

This error originated from a custom integration.

Logger: custom_components.panasonic_cc.coordinator Source: custom_components/panasonic_cc/coordinator.py:77 integration: Panasonic Comfort Cloud (documentation, issues) First occurred: 3:42:39 PM (175 occurrences) Last logged: 7:50:59 PM

Error fetching device data from API: (get_device: Expected status code 200, received: 403: {"code":4300,"message":"Have no authority to the request"} Traceback (most recent call last): File "/config/custom_components/panasonic_cc/coordinator.py", line 77, in _fetch_device_data self._device = await self._api_client.get_device(self._panasonic_device_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 121, in get_device json_response = await self.execute_get(self._get_device_status_url(device_info.guid), "get_device", 200) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/panasonic_cc/pcomfortcloud/panasonicsession.py", line 144, 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_device: Expected status code 200, received: 403: {"code":4300,"message":"Have no authority to the request"}

mtanasiewicz avatar Aug 08 '24 17:08 mtanasiewicz

I would need the group/setup requests you need to activate debug logging for the integration to see in the log it should look like this:

2024-08-08 11:46:04.914 DEBUG (MainThread) [custom_components.panasonic_cc.pcomfortcloud.panasonicsession] GET url: https://accsmart.panasonic.com/device/group, response: {"uiFlg":false,"groupCount":1,"groupList":[{"groupId":<REDACTED>,"groupName":"My House","pairingList":[],"deviceList":[{"deviceGuid":"CS-HZ25UKE+<REDACTED>","deviceType":"3","deviceName":"Living Room","permission":2,"temperatureUnit":0,"summerHouse":2,"nanoeStandAlone":true,"autoMode":true,"modeAvlList":{"autoMode":1},"parameters":{"operate":0,"operationMode":2,"temperatureSet":20,"fanSpeed":3,"fanAutoMode":1,"airSwingLR":5,"airSwingUD":3,"ecoFunctionData":0,"ecoMode":0,"ecoNavi":0,"nanoe":1,"iAuto":0,"airDirection":0,"lastSettingMode":0},"deviceModuleNumber":"CS-HZ25UKE","deviceHashGuid":<REDACTED>,"modelVersion":1,"coordinableFlg":false}]}]}
2024-08-08 11:46:04.914 INFO (MainThread) [custom_components.panasonic_cc] Got 1 devices
2024-08-08 11:46:06.411 DEBUG (MainThread) [custom_components.panasonic_cc.pcomfortcloud.panasonicsession] GET url: https://accsmart.panasonic.com/deviceStatus/CS-HZ25UKE%2B<REDACTED>, response: {"timestamp":1723110366241,"permission":2,"summerHouse":2,"iAutoX":false,"nanoe":true,"nanoeStandAlone":true,"autoMode":true,"heatMode":true,"fanMode":true,"dryMode":true,"coolMode":true,"ecoNavi":false,"powerfulMode":true,"quietMode":true,"airSwingLR":true,"autoSwingUD":false,"ecoFunction":0,"temperatureUnit":0,"modeAvlList":{"autoMode":1},"nanoeList":{"visualizationShow":0},"clothesDrying":false,"insideCleaning":false,"fireplace":false,"pairedFlg":false,"parameters":{"ecoFunctionData":0,"insideCleaning":0,"fireplace":0,"lastSettingMode":0,"operate":0,"operationMode":2,"temperatureSet":20,"fanSpeed":3,"fanAutoMode":1,"airSwingLR":5,"airSwingUD":3,"ecoMode":0,"ecoNavi":0,"nanoe":1,"iAuto":0,"airDirection":0,"insideTemperature":21,"outTemperature":18,"airQuality":0},"deviceNanoe":1}

sockless-coding avatar Aug 08 '24 18:08 sockless-coding

How do I activate debug logging? Could you navigate me a bit?

mtanasiewicz avatar Aug 08 '24 18:08 mtanasiewicz

If the integration is listed under Devices, you can just click the "enable debug logging" image

If It's not there, you can edit your configuration.yaml

logger:
  default: info
  logs:
    custom_components.panasonic_cc: debug

The logger section might not be there so you have to add it.

sockless-coding avatar Aug 08 '24 18:08 sockless-coding

Here is the log file

home-assistant_2024-08-08T18-47-49.699Z.log

mtanasiewicz avatar Aug 08 '24 18:08 mtanasiewicz

@mtanasiewicz it's your Tobołowo device breaking everything... it doesn't look like a HVAC what type of device is it? I can probably add some checks so it doesn't try to access non HVACs

sockless-coding avatar Aug 08 '24 18:08 sockless-coding

We have couple of air conditioning devices, and there is one that is unknown type. However previous integration worked perfectly. If you could fix it, it would be perfect :)

mtanasiewicz avatar Aug 08 '24 19:08 mtanasiewicz

I think that handling of the 403 status by skipping the device would also be a viable choice. All other devices should work.

mtanasiewicz avatar Aug 08 '24 19:08 mtanasiewicz

Well, the previous version probably threw a few errors but since the strange device was the last one the other ones got added... I've added some checks in v1.1.7 give it a try

sockless-coding avatar Aug 08 '24 19:08 sockless-coding

1.1.7 fixed it, thanks!

mtanasiewicz avatar Aug 08 '24 19:08 mtanasiewicz

Hopefully it fixes it for the others as well. @mtanasiewicz that strange device looks like it could be a water heater since it has a tank status with a temp reading of 50C and some modes... does it show up in the CFC app?

sockless-coding avatar Aug 08 '24 19:08 sockless-coding

I've upgraded to the 1.1.7 but now it can't find any devices. image

maurilloh avatar Aug 08 '24 20:08 maurilloh

@maurilloh I need some more info, please provide some debug logs.

sockless-coding avatar Aug 08 '24 20:08 sockless-coding

after the message the integration is not loaded. I don't have any logs

maurilloh avatar Aug 08 '24 20:08 maurilloh

@maurilloh you need to go to the logs page https://my.home-assistant.io/redirect/logs/ and click load full logs

sockless-coding avatar Aug 08 '24 20:08 sockless-coding

i've found this:

Home Assistant Core 2024-08-09 01:30:26.634 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration panasonic_cc which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-08-09 01:30:37.325 INFO (MainThread) [custom_components.panasonic_cc] https://github.com/sockless-coding/panasonic_cc/issues 2024-08-09 01:30:37.327 DEBUG (MainThread) [custom_components.panasonic_cc.pcomfortcloud.panasonicsession] Starting Session 2024-08-09 01:30:37.343 DEBUG (MainThread) [custom_components.panasonic_cc.pcomfortcloud.panasonicsettings] Loaded settings from '/root/.panasonic-settings' 2024-08-09 01:30:37.347 DEBUG (MainThread) [custom_components.panasonic_cc.pcomfortcloud.panasonicsession] Access token is valid 2024-08-09 01:30:38.234 DEBUG (MainThread) [custom_components.panasonic_cc.pcomfortcloud.panasonicsession] GET url: https://accsmart.panasonic.com/device/group, response: {"a2wStatus":{"statusCode":200},"uiFlg":false,"groupCount":1,"groupList":[{"groupId":1033015,"groupName":"My House","pairingList":[],"deviceList":[{"deviceGuid":"B192346444","deviceType":"2","deviceName":"casa","connectionStatus":0,"operationMode":1,"zoneStatus":[{"zoneId":1,"operationStatus":0,"temperature":23},{"zoneId":2}],"tankStatus":{"operationStatus":1,"temperature":44}}]}]} 2024-08-09 01:30:38.234 INFO (MainThread) [custom_components.panasonic_cc] Got 0 devices

maurilloh avatar Aug 08 '24 23:08 maurilloh

@maurilloh What type of device do you have? That response doesn't look like a HVAC. What do you see in the CFC app?

sockless-coding avatar Aug 09 '24 06:08 sockless-coding

i have a water pump and 4 air conditioner, in the versione 1.0.58 i can see them

maurilloh avatar Aug 09 '24 07:08 maurilloh

@maurilloh the logs you provided only shows what looks like an aquarea device.

sockless-coding avatar Aug 09 '24 08:08 sockless-coding

With version 1.1.7 it works! Thanks!

ddemarch avatar Aug 09 '24 08:08 ddemarch

Good morning, many thanks for the development and update of the module, but since the update to the 1.1.7 release I receive the following error: Registratore: custom_components.panasonic_cc.coordinator Fonte: custom_components/panasonic_cc/coordinator.py:86 Integrazione: Panasonic Comfort Cloud (documentazione, problemi) Prima occorrenza: 08:50:41 (4 occorrenze) Ultima registrazione: 10:32:54

Error fetching device data from API: (try_update: Expected status code 200, received: 500: {"code":5005,"message":"Adapter Communication error"} Traceback (most recent call last): File "/config/custom_components/panasonic_cc/coordinator.py", line 86, in _fetch_device_data if await self._api_client.try_update_device(self._device): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 126, in try_update_device json_response = await self.execute_get(self._get_device_status_url(device_guid), "try_update", 200) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/panasonic_cc/pcomfortcloud/panasonicsession.py", line 144, 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: (try_update: Expected status code 200, received: 500: {"code":5005,"message":"Adapter Communication error"}

Questo errore ha avuto origine da un'integrazione personalizzata.

Registratore: custom_components.panasonic_cc.coordinator Fonte: helpers/update_coordinator.py:386 Integrazione: Panasonic Comfort Cloud (documentazione, problemi) Prima occorrenza: 08:50:41 (4 occorrenze) Ultima registrazione: 10:32:54

Error fetching Panasonic Device Coordinator data: Invalid response from API: (try_update: Expected status code 200, received: 500: {"code":5005,"message":"Adapter Communication error"}

since I have some automations that warn me when the machine is unavailable, the notification starts, but after a second it returns to being reachable. How can I avoid the inconvenience, thank you very much

GennaroRASP avatar Aug 09 '24 09:08 GennaroRASP

@GennaroRASP Hi, the 5005 Adapter Communication error is usually caused when the Panasonic Servers cant reach the HVAC, you could go over your wifi settings and see if something is interfering / switching channels. Or you can change the update interval of the integration to something higher to see if helps

sockless-coding avatar Aug 09 '24 09:08 sockless-coding

Hello, Also getting "Failed setup, will retry: Invalid response from API: (get_device: Expected status code 200, received: 500: {"code":5005,"message":"Adapter Communication error"}" when updating to 1.1.7

Logger: custom_components.panasonic_cc.coordinator Source: custom_components/panasonic_cc/coordinator.py:77 integration: Panasonic Comfort Cloud (documentation, issues) First occurred: 10:27:56 (14 occurrences) Last logged: 10:32:11 Error fetching device data from API: (get_device: Expected status code 200, received: 500: {"code":5005,"message":"Adapter Communication error"}

Traceback (most recent call last): File "/config/custom_components/panasonic_cc/coordinator.py", line 77, in _fetch_device_data self._device = await self._api_client.get_device(self._panasonic_device_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 121, in get_device json_response = await self.execute_get(self._get_device_status_url(device_info.guid), "get_device", 200) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/panasonic_cc/pcomfortcloud/panasonicsession.py", line 144, 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_device: Expected status code 200, received: 500: {"code":5005,"message":"Adapter Communication error"}

I can control and HVAC systems fine via the Comfort Cloud app.

ParadiseComputing avatar Aug 09 '24 09:08 ParadiseComputing

Regarding the 5005 or 5002 error codes, Panasonic's support answer to that is: "If you receive this error, please check if the Internet environment is stable. If the problem persists even though the Internet is stable, contact your local service center here."

sockless-coding avatar Aug 09 '24 17:08 sockless-coding

My two pence here about the 5005 problem. I had the very same problem and it was related with one single unit not being reachable from the Panasonic app. Once I removed the faulty ac unit from the app the HA integration started working again. BTW thank you all for the great work here!

mauro-spinello avatar Aug 10 '24 10:08 mauro-spinello

I've made v1.1.8 more resilient in the start-up phase, if it encounters an inaccessible device it will be logged, but the rest should be added.

sockless-coding avatar Aug 11 '24 08:08 sockless-coding