python-panasonic-comfort-cloud icon indicating copy to clipboard operation
python-panasonic-comfort-cloud copied to clipboard

Unable to Connect

Open jodibb opened this issue 6 years ago • 14 comments

Hi, First, thanks for this project! I'm trying to implement it into my openhab. But I have problems with python script and I'm not able to connect. Script is the same as on the page, and I'm on latest 0.0.13 revision. When I start it, this is result:

`File "airConditionState.py", line 4, in session.login() File "/home/openhabian/.local/lib/python2.7/site-packages/pcomfortcloud/session.py", line 96, in login self._create_token() File "/home/openhabian/.local/lib/python2.7/site-packages/pcomfortcloud/session.py", line 131, in _create_token raise LoginError(ex) pcomfortcloud.session.LoginError: HTTPSConnectionPool(host='accsmart.panasonic.com', port=443): Max retries exceeded with url: /auth/login (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

Can you please describe me what I'm doing wrong? Thanks. `

jodibb avatar Jan 21 '19 23:01 jodibb

Hi!

Did you try with:

-s [BOOL], --skipVerify [BOOL] Skip Ssl verification /R

rest77 avatar Jan 22 '19 06:01 rest77

It works with -s, thanks. But is there any way how to use it with this parameter also in own py script using module?

jodibb avatar Jan 22 '19 06:01 jodibb

I had the same problem when I tested but did not dig into the problem. Maybe someone can check that?

rest77 avatar Jan 22 '19 06:01 rest77

I'll look into it, either the requests package is missing CAs or it's unable to download the certificate from panasonic.

Found a topic in stackoverflow I'm going to look at.

lostfields avatar Jan 22 '19 07:01 lostfields

      It works with -s, thanks.

But is there any way how to use it with this parameter also in own py script using module?

The constructor of Session is def __init__(self, username, password, tokenFileName='~/.panasonic-token', raw=False, verifySsl=True) so you could set all of them to default except the last one.

lostfields avatar Jan 22 '19 07:01 lostfields

      It works with -s, thanks.

But is there any way how to use it with this parameter also in own py script using module?

The constructor of Session is def __init__(self, username, password, tokenFileName='~/.panasonic-token', raw=False, verifySsl=True) so you could set all of them to default except the last one.

It works! Thanks!

jodibb avatar Jan 22 '19 07:01 jodibb

OK, I can connect now and read status, but now I'm not able to set values :)

airON.py
[{'model': '', 'group': u'My House', 'id': 'XX', 'name': u'Panasonic'}]
{'id': 'XX', 'parameters': {'airSwingVertical': <AirSwingUD.Up: 0>, 'temperature': 23.5, 'power': <Power.Off: 0>, 'eco': <EcoMode.Auto: 0>, 'temperatureInside': 126, 'temperatureOutside': 126, 'airSwingHorizontal': <AirSwingLR.Auto: -1>, 'mode': <OperationMode.Heat: 3>, 'fanSpeed': <FanSpeed.Auto: 0>}}
Traceback (most recent call last):
  File "airON.py", line 16, in <module>
    temperature = 22.0)
TypeError: get_device() got an unexpected keyword argument 'power'

I'm using your example:

....
session.login()

devices = session.get_devices()

print(devices)

print(session.get_device(devices[0]['id']))

session.get_device(devices[0]['id'],
	power = pcomfortcloud.constants.Power.On,
	temperature = 22.0)

jodibb avatar Jan 22 '19 10:01 jodibb

my example says session.set_device(id, power =… but your example is get_device. Is that the issue?

lostfields avatar Jan 22 '19 11:01 lostfields

You are right. My fault. Sorry. :( Now it works.

jodibb avatar Jan 22 '19 12:01 jodibb

Thanks a lot for this support. Now, I'm able to automate my airconditioner. One more question. Is there way how to add support for EcoNavi and Nanoe functions? I cannot find them there.

jodibb avatar Jan 22 '19 12:01 jodibb

I was supposed to look at it, but it may be useful if you dump data of your device when econavi/nanoe is on and off and post it at issue #1

lostfields avatar Jan 22 '19 13:01 lostfields

Done. Sadly, there is no difference when nanoe is on/off :/ . It's also not available in phone app and you can only start it from remote controler. Then you can see led on airconditioner. For EcoNavi, there is parameter and value. On is 2, for Off is 1. Here is dump from my device: fanMode : False summerHouse : 0 deviceGuid : XXX dryMode : True nanoe : False permission : 2 autoMode : True timestamp : 1548191155465 heatMode : True quietMode : True coolMode : True powerfulMode : True ecoNavi : True airSwingLR : True parameters updateTime : None nanoe : 0 errorCode : KgAACwEBRjAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== errorStatus : -255 fanSpeed : 0 airSwingLR : 2 airQuality : 0 eventTime : None airSwingUD : 0 actualNanoe : 0 outTemperature : -6 insideTemperature : 126 devGuid : C382347994 iAuto : 0 devRacCommunicateStatus: -255 ecoMode : 0 airDirection : 0 operationMode : 0 defrosting : -255 temperatureSet : 25.0 fanAutoMode : 0 ecoNavi : 1 operate : 1 iAutoX : False

jodibb avatar Jan 22 '19 21:01 jodibb

yeah, mine has actualNanoe: 1 when it's off and actualNanoe: 2 when it's on - but mine is Reporting ecoNavi: 0 - unsupported. Same With yours, except that nanoe is unsupported at your device, but ecoNavi is supported.

Is only parameter ecoNavi changing when you toggle NanoE at your remote?

lostfields avatar Jan 22 '19 21:01 lostfields

No, EcoNavi is changing only when I'm changing EcoNavi status. That was separate test, when I tried only nanoe and dump was same for On/Off.

btw, can you see correct insideTemperature? Mine is 126 and I also cannot see it in android app. outTemperature works fine.

jodibb avatar Jan 22 '19 22:01 jodibb