lostfields / python-panasonic-comfort-cloud

A python module for reading and changing status of panasonic climate devices through Panasonic Comfort Cloud app api
MIT License
69 stars 39 forks source link

unit type CS-Z25UFEAW fails #92

Open pootle opened 3 weeks ago

pootle commented 3 weeks ago

I have a few units like CS-TZ35WKEW and CS-MTZ16WKE which all work OK, but the 2 "floor standing" ones with nanoe (CS-Z25UFEAW) both fail.

get_devices finds them OK, and the name and group are returned OK, but the id's are much shorter than the working devices return and calling get_device fails: Traceback (most recent call last): File "/home/iain/projects/pana/test1.py", line 16, in <module> print(session.get_device(devices[7]['id'])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/iain/.local/lib/python3.11/site-packages/pcomfortcloud/session.py", line 277, in get_device raise ResponseError(response.status_code, response.text) pcomfortcloud.session.ResponseError: Invalid response, status code: 500 - Data: {"code":5005,"message":"Adapter Communication error"}

pootle commented 3 weeks ago

I've turned on raw and found that the units that do not work return a very different deviceGuid string, and do not return a devicehashguid at all - it looks like the code that tried to invent the hash string is getting it wrong here is a good one followed by a bad one: { "deviceGuid": -- string from model name plus serial no I think, "deviceType":"3", "deviceName":"master bed", "permission":3, "temperatureUnit":0, "summerHouse":0, "nanoeStandAlone":false, "autoMode":true, "modeAvlList":{"autoMode":1}, "parameters":{"operate":1,"operationMode":0,"temperatureSet":25,"fanSpeed":0,"fanAutoMode":2,"airSwingLR":2,"airSwingUD":2,"ecoFunctionData":0,"ecoMode":0,"ecoNavi":0,"nanoe":0,"iAuto":0,"airDirection":1,"lastSettingMode":0}, "deviceModuleNumber":"CS-TZ25WKEW", "deviceHashGuid": -- 64 character string, "modelVersion":1, "coordinableFlg":false }, { "deviceGuid":"C389......", -- no resemblance to serial no or model "deviceType":"1", "deviceName":"bed2", "permission":3, "temperatureUnit":0, "summerHouse":0, "nanoeStandAlone":false, "autoMode":true, "modeAvlList":{"autoMode":1}, "parameters":{"operate":0,"operationMode":3,"temperatureSet":22,"fanSpeed":0,"fanAutoMode":2,"airSwingLR":2,"airSwingUD":0,"ecoFunctionData":1,"ecoMode":0,"ecoNavi":1,"nanoe":1,"iAuto":1,"airDirection":1,"lastSettingMode":0} },

lostfields commented 3 weeks ago

Hi, I guess the deviceType tells us to use other endpoints, it's either that or encoding issue of the Id for url param