sockless-coding / panasonic_cc

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

'Unexpected error creating device' #91

Closed samfleur closed 2 years ago

samfleur commented 2 years ago

Getting an error while trying to setup the integration for the first time. The error appears after filling out the user account details. Running the most recent version of the integration and home assistant itself.


Logger: custom_components.panasonic_cc.config_flow
Source: custom_components/panasonic_cc/pcomfortcloud/session.py:223
Integration: Panasonic Comfort Cloud (documentation)
First occurred: 12:07:17 PM (1 occurrences)
Last logged: 12:07:17 PM

Unexpected error creating device
Traceback (most recent call last):
  File "/config/custom_components/panasonic_cc/config_flow.py", line 60, in _create_device
    devices = await self.hass.async_add_executor_job(api.get_devices)
  File "/usr/local/lib/python3.10/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 223, in get_devices
    'name': device['deviceName'],
KeyError: 'deviceName'
sabatpoznan commented 2 years ago

Same here

gurgelx commented 2 years ago

Same for me, the integration stopped working so I removed it and tried to readd it. And now I get this error

blaatunge commented 2 years ago

I have the same issue.

erikgroentje commented 2 years ago

Same here. Heavily depending on this integration so would be nice if this will be fixed?!

sockless-coding commented 2 years ago

Hmm, I've been trying to trigger this problem my self but have been unable. The related line in the posted exception is related to the device name. So, do you have any special characters in your device names?

TehRobot commented 2 years ago

Ok scratch that. Got it working.

  1. Went into the app removed all devices but the AC (had one in there that was accidentally setup).
  2. Remove Panasonic CC from Home Assistant, integration and from HACS
  3. Checked HA root folder to make sure no residual files
  4. Restarted HA
  5. Reinstalled Panasonic CC from HACS
  6. Restarted HA
  7. Added integration

Hopefully this works for others.

Having the same issue here According to the actual Panasonic app which is still working fine

~~Air Conditioner Name Home~~

~~Model S-125PE1R5B~~

~~No special characters and no issues in the past with it working. Feel free to message me on the Home Assistant discord (same name) happy to edit files and try resolve~~

sockless-coding commented 2 years ago

@TehRobot sounds very strange, to me this starts to sound more like an issue with the response from the Panasonic Api servers... It might be that one of the servers in your region is returning a broken response. Could you try to give me the IPs that accsmart.panasonic.com resolves to? By running nslookup accsmart.panasonic.com

TehRobot commented 2 years ago

Server: 8.8.8.8 Address: 8.8.8.8#53

Non-authoritative answer: accsmart.panasonic.com canonical name = e024-alb-rac-web-prd-1578900232.ap-northeast-1.elb.amazonaws.com. Name: e024-alb-rac-web-prd-1578900232.ap-northeast-1.elb.amazonaws.com Address: 52.193.248.47 Name: e024-alb-rac-web-prd-1578900232.ap-northeast-1.elb.amazonaws.com Address: 54.199.170.194

sockless-coding commented 2 years ago

Same IPs as I get, and I verified that those two servers return the correct data.

TehRobot commented 2 years ago

Let's see if removing and downloading works for others.

I do wonder if the extra device that didn't work was causing the issue. If someone else has similar situation please comment. Would be nice to know if it was luck or an actual issue.

sockless-coding commented 2 years ago

Find that very unlikely since the line 223 in session.py is 'name': device['deviceName'], and it is just getting the name of the HVAC from the API response. I could change that to 'name': device['deviceName'] if 'deviceName' in device else 'Unknown Device', but the question is what else would fail...

samfleur commented 2 years ago

Removed completely, restarted, installed again via HACS and restarted again. No changes, same error.

This error originated from a custom integration.

Logger: custom_components.panasonic_cc.config_flow
Source: custom_components/panasonic_cc/pcomfortcloud/session.py:223
Integration: Panasonic Comfort Cloud (documentation)
First occurred: 10:31:28 AM (1 occurrences)
Last logged: 10:31:28 AM

Unexpected error creating device
Traceback (most recent call last):
  File "/config/custom_components/panasonic_cc/config_flow.py", line 60, in _create_device
    devices = await self.hass.async_add_executor_job(api.get_devices)
  File "/usr/local/lib/python3.10/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 223, in get_devices
    'name': device['deviceName'],
KeyError: 'deviceName'

nslookup returns

Non-authoritative answer:
Name:    e024-alb-rac-web-prd-1578900232.ap-northeast-1.elb.amazonaws.com
Addresses:  52.193.248.47
          54.199.170.194
Aliases:  accsmart.panasonic.com
gurgelx commented 2 years ago

Find that very unlikely since the line 223 in session.py is 'name': device['deviceName'], and it is just getting the name of the HVAC from the API response. I could change that to 'name': device['deviceName'] if 'deviceName' in device else 'Unknown Device', but the question is what else would fail...

This actually solves it, I think people who have more than one device at panasonic cloud gets this error. I accidently added a device (which i cant remove) and it now shows up as unknown device next to my heat pump

samfleur commented 2 years ago

Have only 1 device in the Panasonic Comfort Cloud application, but still the same error...

gurgelx commented 2 years ago

Have only 1 device in the Panasonic Comfort Cloud application, but still the same error...

What device do you have? Aquarea is the one who crashed for me.

samfleur commented 2 years ago

Didn't know the Aquarea was a device, my father started the setup but never completed so I thought it was an ad from Panasonic.

Deleted the Aquarea device and tried to sign in via Home Assistant, and it works now! Thanks for the help everyone.

gurgelx commented 2 years ago

Didn't know the Aquarea was a device, my father started the setup but never completed so I thought it was an ad from Panasonic.

Deleted the Aquarea device and tried to sign in via Home Assistant, and it works now! Thanks for the help everyone.

How did you manage to remove that device? I can't find any button for that.

samfleur commented 2 years ago

Had to enter the main airconditioning device and open the menu inside that device, giving the option 'device list'

gurgelx commented 2 years ago

Thanks!

sockless-coding commented 2 years ago

Ok, so it seems not all devices has a name then, I'll add the check and release a new version.

sockless-coding commented 2 years ago

v1.0.35 now support unnamed devices