djbulsink / panasonic_ac

Panasonic Comfort Cloud HA component
30 stars 16 forks source link

Invalid response, status code: 401 - Data: {"code":"4106", "message": "New version app has been published"} #45

Open MetalOctopus opened 6 months ago

MetalOctopus commented 6 months ago

TLDR; Changes requires to session.py -> Update app version to 1.20 on line 111

Cheers to Cheesekeeper for the solution this time around. https://github.com/lostfields/python-panasonic-comfort-cloud/issues/85 Note: Cheesekeeper suggests adding quotes around the number 0 on line 125, but this was not required in my case.

Guide for pcomfortcloud and HACS users.

ssh into your HomeAssistant box docker container ls

Copy your Home-Assistant CONTAINER ID Mine is 572e4558ea59 so: docker exec -it -u root 572e4558ea59 sh

Find the pcomfortcloud directory: pip show pcomfortcloud eg: Location: /usr/local/lib/python3.11/site-packages

Backup your session.py cp /usr/local/lib/python3.11/site-packages/pcomfortcloud/session.py /usr/local/lib/python3.11/site-packages/pcomfort cloud/session.py.bak

Edit session.py nano /usr/local/lib/python3.11/site-packages/pcomfortcloud/session.py

Find the line that has app version (Ctrl+W, X-APP-VERSION, enter) Mine is line 111

Change "X-APP-VERSION": "1.19.0" to "X-APP-VERSION": "1.20.0"

Ctrl+X to exit, Y to write changes to file exit to exit docket sudo reboot now to restart your HomeAssistant machine

helicalchris commented 4 months ago

As linked above the Panasonic ac app has just been updated with the version number change. Could the HACS repo be updated with this?

djbulsink commented 3 months ago

This issue is resolved. There is a new version of https://pypi.org/project/pcomfortcloud released and updated in the custom integration.