Closed michelcve closed 3 years ago
Hi, hard to tell whats failing, though my guess is that it's still looking for the old device id. Are you using a separate account for HA? If so try logging in to the Panasonic app with that, other way might be to rename the device just to force it to update.
@sockless-coding The mainboard was replaced before being added to the panasonic ID that I use for home assistant.
I also tried removing the integration as a whole, and reinstalling, but that didn't seem to help.
So, I installed PCAP Remote, and captured some traffic while using teh Panasonic App.
I noticed the ID of the new mainboard is somewhat different:
CS-A76C2097/20200210/M100007#
(I altered a few number, as to not publicly post my device guid, but please note that this GUID differs quite a but from the standard 'devicetype-serialnumber').
When retrieving the deviceStatus the following URL is called:
GET /deviceStatus/now/CS-A76C2097f20200210fM100007%23
Which is a bit weird, seems like the '/' is encoded as a single 'f'. The '#' is encoded as '%23', which seems like normal URL encoding.
Could it be the strange '/' encoding, that causes the URL to be incorrect in panasonic_cc, resulting in the 404 that I'm seeing?
I'm happy to help if you need more information on this. Thanks for your help!
As I presume it might be an issue with the library you use, I took the liberty of reporting it here as well [https://github.com/lostfields/python-panasonic-comfort-cloud/issues/32]
Yeah it looks that way I was just about to ask you if you could download the python lib from lostfields and run: python .\pcomfortcloud.py -r true [username] [password] list just to see how your deviceGuid looks from api, I'm guessing the guid might need some encoding.
@sockless-coding Just an update, we figured out what went wrong (I tried a local hack, and it seems to fix the problem). The library owner will make a proper fix for it.
Ah good :) I'll try to issue a new release as soon as lostfields updates the lib package.
@sockless-coding Lostfields just made fix for this issue 2 hours ago ;-).
I should probably make a new ticket for this, but do you know whether it would be possible to support both horizontal and vertical direction settings, as well as support getting power usage information?
Well you are in luck, it looks like lostfields included my pull request that fixes the Left/Right swing modes. And I also have a dev version with a daily energy sensor:
@sockless-coding Ooh nice, really looking forward to that! Great job, thanks for all your efforts!
@sockless-coding Just wondering, any idea when the fix will make it into your component?
@michelcve It should be included as far as I know... Lostfields made a new release a few days back and the latest release is using it. (though I haven't looked in to his code).
@sockless-coding Sorry, my bad. Turns out there is a problem with the fix that Lostfields made. I've notified him about it in this issue.
@sockless-coding Lostfields just merged a fix to master, that I confirmed to be working.
@michelcve Ok, he needs to publish a new version to PyPi before I can make a new version.
Hi guys! I have exactly the same problem. Is it fixed or not?
@wdflorczyk We are still waiting for @lostfields to publish the fixed version of python-panasonic-comfort-cloud to pypi so HA can access it.
Hi, thank you for your reply. I asked him to do it and he did it :). "Done :-) Version 0.0.18"
@wdflorczyk I've released v1.0.21 that's now using 0.0.18 of pcomfortcloud. Hopefully it contains the correct fix this time.
@sockless-coding I've just updated, but I think v1.0.21 introduced a bug:
2020-12-22 14:06:20 ERROR (MainThread) [homeassistant.config_entries] Error sett ing up entry for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 236, in as ync_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", lin e 67, in async_setup_entry
return await hass.data[DOMAIN].async_setup_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 140, in async_setup_entry
platform = await async_prepare_setup_platform(
File "/usr/src/homeassistant/homeassistant/setup.py", line 298, in async_prepa re_setup_platform
platform = integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 424, in get_platfo rm
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 429, in _import_pl atform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_mod ule
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 779, in exec_module
File "<frozen importlib._bootstrap_external>", line 916, in get_code
File "<frozen importlib._bootstrap_external>", line 846, in source_to_code
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/config/custom_components/panasonic_cc/sensor.py", line 130
return round(self._api.current_power,2)M,|m,
Closing this issue, because the original problem is resolved with the upgrade to v0.0.18 of pcomfortcloud (which I confirmed after manually working around issue #21 ).
I've had the main board of one of my AC's replaced (because of duplicate serial number). But not what device fails to register with panasonic_cc (works in de panasonic app though).
Here is the full error I got: