sockless-coding / panasonic_cc

Panasonic Comfort Cloud - Home Assistant Component
MIT License
137 stars 35 forks source link

integration is not being installed #302

Open egric opened 1 week ago

egric commented 1 week ago

I'm installing integration for the first time. From scratch. I successfully completed two-factor authentication via SMS on my phone and connect to the air conditioner without any problems through the app on my phone. But when trying to install the integration, the notorious "Unexpected error creating device" is displayed in the server log:

Could not get groups, trying to re-authenticate Traceback (most recent call last): File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 51, in start_session await self._get_groups() File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 62, in _get_groups self._groups = await self.execute_get( ^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/panasonic_cc/pcomfortcloud/panasonicsession.py", line 127, in execute_get response = await self._client.get( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 682, in _request resp = await req.send(conn) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 733, in send await writer.write_headers(status_line, self.headers) File "/usr/local/lib/python3.12/site-packages/aiohttp/http_writer.py", line 129, in write_headers buf = _serialize_headers(status_line, headers) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "aiohttp/_http_writer.pyx", line 132, in aiohttp._http_writer._serialize_headers File "aiohttp/_http_writer.pyx", line 109, in aiohttp._http_writer.to_str TypeError: Cannot serialize non-str key None

At the same time, I enter the correct username and password. Since I'm installing integration from scratch, I can't turn on the debugging log. I tried to register it in the configuration.yaml logger: logs: custom_components.panasonic_cc: debug

but did not understand what it gives. But after that, the following appeared in the server log:

"Bad logger message: Unexpected error creating device ((TypeError('Cannot serialize non-str key None'),))"

and

"Getting app version: Cannot connect to host play.google.com:443 ssl:default [Connection reset by peer]"

sockless-coding commented 3 days ago

@egric Hi, the error says that it can not connect to play.google.com can you ping that from HA? Does your HA installation have IPv6 active?

egric commented 3 days ago

The ping is passing. Ipv6 is not in use and is not active

sockless-coding commented 3 days ago

Ok, does https://play.google.com/store/apps/details?id=com.panasonic.ACCsmart work?

egric commented 3 days ago

https://play.google.com/store/apps/details?id=com.panasonic.ACCsmart this link does not open the page in the browser without vpn.

egric commented 3 days ago

and now, when trying to install the integration, an "unknown error occurred" appears

sockless-coding commented 3 days ago

So your internet connection is restricted? The integration used that link to get the current app version, which is required.

egric commented 3 days ago

in log only that:

Could not get groups, trying to re-authenticate Traceback (most recent call last): File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 51, in start_session await self._get_groups() File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 62, in _get_groups self._groups = await self.execute_get( ^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/panasonic_cc/pcomfortcloud/panasonicsession.py", line 127, in execute_get response = await self._client.get( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 682, in _request resp = await req.send(conn) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 733, in send await writer.write_headers(status_line, self.headers) File "/usr/local/lib/python3.12/site-packages/aiohttp/http_writer.py", line 129, in write_headers buf = _serialize_headers(status_line, headers) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "aiohttp/_http_writer.pyx", line 132, in aiohttp._http_writer._serialize_headers File "aiohttp/_http_writer.pyx", line 109, in aiohttp._http_writer.to_str TypeError: Cannot serialize non-str key None

sockless-coding commented 3 days ago

Yes, you get that error because the version number isn't supplied / is an invalid value.

egric commented 3 days ago

and how do I make sure that the version number is specified?

sockless-coding commented 3 days ago

The integration needs access to https://play.google.com/store/apps/details?id=com.panasonic.ACCsmart how come you can't access the play store?

egric commented 3 days ago

I can to access. But but through vpn only.

sockless-coding commented 3 days ago

Can you enable so HA can go through the VPN as well?

egric commented 3 days ago

Only by running openvpn on the router

sockless-coding commented 2 days ago

Well, if your connection is restricted, you might get more issues with cloud integrations down the line. In order to work this integration needs to access things on: