panasonic_cc: Precondition Failed

Checklist

  • I have verified that the account and device works in the Comfort Cloud App.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues…

What version of Home Assistant Core?

core-2024.10.4

Describe the issue

Aircon dashboard went unavailable ~30 minutes ago. Reviewed logs, found ‘Precondition failed’. Logging into the Panasonic App works without issue and the Aircon can still be controlled via the app, just not HA.

image

image

Error/Debug Logs

Logger: custom_components.panasonic_cc.coordinator
Source: custom_components/panasonic_cc/coordinator.py:86
integration: Panasonic Comfort Cloud (documentation, issues)
First occurred: 11:37:36 (56 occurrences)
Last logged: 12:05:05

Error fetching device data from API: (get_status: Expected status code 200, received: 412: { "code":41201, "message":"Precondition Failed" }
Traceback (most recent call last):
  File "/config/custom_components/panasonic_cc/coordinator.py", line 86, in _fetch_device_data
    if await self._api_client.try_update_device(self._device):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 178, in try_update_device
    json_response = await self._get_device_status(device.info)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 169, in _get_device_status
    json_response = await self.execute_get(self._get_device_status_now_url(device_info.guid), "get_status", 200)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/pcomfortcloud/panasonicsession.py", line 145, in execute_get
    await check_response(response, function_description, expected_status_code)
  File "/config/custom_components/panasonic_cc/pcomfortcloud/helpers.py", line 32, in check_response
    raise exceptions.ResponseError(
custom_components.panasonic_cc.pcomfortcloud.exceptions.ResponseError: (get_status: Expected status code 200, received: 412: {
  "code":41201,
  "message":"Precondition Failed"
}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 30
  • Comments: 149 (17 by maintainers)

Most upvoted comments

Version 2024.11.0 has been released

I’m going to take a look and see if I can find out what they have changed… hopefully it isn’t the activation of x-cfc-api-key validation.

If anyone from Panasonic is reading this, please stop it. It makes me never want to buy any Panasonic stuff ever again.

I’ve confirmed that x-cfc-api-key is the reason for the 412 and that it is composed of x-app-name, x-app-timestamp and token from x-user-authorization-v2 (if authenticated). The timestamp doesn’t seem to be validated and can be reused. So the main thing is to figure out how the token affects the outcome.

Please don’t all reply telling you have the same problem. I guess it is already clear that everybody has this problem. Thanks.

I’m also having the same issue here. Happened 8 hours ago

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 5:26:00 PM (3 occurrences)
Last logged: 5:55:20 PM

Error setting up entry for panasonic_cc
Traceback (most recent call last):
  File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 64, in start_session
    await self._get_groups()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 79, in _get_groups
    self._groups = await self.execute_get(
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/pcomfortcloud/panasonicsession.py", line 145, in execute_get
    await check_response(response, function_description, expected_status_code)
  File "/config/custom_components/panasonic_cc/pcomfortcloud/helpers.py", line 32, in check_response
    raise exceptions.ResponseError(
custom_components.panasonic_cc.pcomfortcloud.exceptions.ResponseError: (get_groups: Expected status code 200, received: 412: {
  "code":41201,
  "message":"Precondition Failed"
}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/panasonic_cc/__init__.py", line 76, in async_setup_entry
    await api.start_session()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 67, in start_session
    await self.reauthenticate()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py", line 71, in reauthenticate
    await super().reauthenticate()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/panasonicsession.py", line 68, in reauthenticate
    await self._authentication.authenticate(self._username, self._password)
  File "/config/custom_components/panasonic_cc/pcomfortcloud/panasonicauthentication.py", line 68, in authenticate
    await self._retrieve_client_acc()
  File "/config/custom_components/panasonic_cc/pcomfortcloud/panasonicauthentication.py", line 263, in _retrieve_client_acc
    await check_response(response, 'get_acc_client_id', 200)
  File "/config/custom_components/panasonic_cc/pcomfortcloud/helpers.py", line 32, in check_response
    raise exceptions.ResponseError(
custom_components.panasonic_cc.pcomfortcloud.exceptions.ResponseError: (get_acc_client_id: Expected status code 200, received: 412: {
  "code":41201,
  "message":"Precondition Failed"
}

I send an email to Panasonic today (translated from Dutch to English by Google Translate, so sorry for mistakes): Dear Panasonic, For a number of years I have been using 3 Panasonic air conditioners to my satisfaction. I have an implementation in use via Home Assistant. The plugin for this is https://github.com/sockless-coding/panasonic_cc However, as a developer/hobbyist, I realize that this implementation is not official, but there are many home automation users who control their air conditioners in this

So now that they have the link to the github repo - even if this is fixed, they can now see what is being done to overcome the restrictions everytime…awesome.

Do you think they didn’t know before? They didn’t wonder why so many “apps” connect to their servers every 30 seconds? Normally, the application is used several times a day, so it connects maybe 20-30 times per day? This integration connects 7680 times per day! Some other plugins / integrations had a refresh time of up to every 3 seconds! Why do you think they keep changing APIs?

Panasonic developers tried their best to block enthusiastic users. Meanwhile, LG released the official integration for Home Assistant. I paid a lot for five air conditioners, but I decided never to buy any Panasonic products again. I really respect the author and all heroes to create this integration and tried hard to make it work every month.

Got this answer from Panasonic Swedenm they didn’t even comment on the strenghtened security as of nov 5, "Hi Anders,

Thank you for your email.

Unfortunately, there is no open API or any plan for it to come. Sorry that’s not the answer you want but unfortunately it is.

Kind regards Frederick Panasonic Support"

Let’s remeber this next time we think about buying new Panasonic equipment… There are other, better alternatives! 😉

Same here. For Homebridge plugin also stop working with same error code.

Hi everyone,

Could we please stay focused on the original problem of this issue? I’ve enjoyed following the discussion on the local solution, but I feel the conversation has veered off-topic. It would be great to continue that discussion in a separate thread so that this space remains dedicated to updates or information related to the potential fix.

Thank you for understanding!

Peeps. Please stop replying with ‘Same here’!! Many have notifications turned on but don’t want these kind of updates.

Do we really have to post all this here? Can’t we just stick to the issue at hand instead of posting all indivual complaints to Panasonic? Perhaps create a new ticktet for this and move that conversation over there.

I’ve confirmed that x-cfc-api-key is the reason for the 412 and that it is composed of x-app-name, x-app-timestamp and token from x-user-authorization-v2 (if authenticated). The timestamp doesn’t seem to be validated and can be reused. So the main thing is to figure out how the token affects the outcome.

I decided to give it a go to try and reverse engineer libsecurity-lib.so but I don’t really have any experience in reverse engineering unfortunately but I do work as an embedded developer and know a little bit of assembly. After some googling and watching a short youtube video I ended up using Ghidra and have been using it for few hours now trying to decipher the createSecurityKey function.

Unfortunately it looks quite large and I have a really hard time following everything that happens but it looks like the first thing it does is to retrieve the first package signature from “[Landroid/content/pm/Signature:”. It looks like this object is an array but the first array element is retrieved from it and then it does a SHA512 on that signature and possibly a timestamp, but it doesn’t look like it’s the x-app-timestamp.

After this I can’t quite follow what happens with this SHA512 but there’s hundreds of more lines to analyze, probably with some hardcoded “magic numbers” in there.

I’m sure x-app-name, x-app-timestamp & x-user-authorization are also used to build the final string much further down but I just haven’t been able to follow. It’s not so easy when the value is retrieved by a function call to GetStringUTFChars with result stored in an unknown pointer variable pVar23 which then is used to call an unknown function which might modify &local_170 and/or &local_340 and so on…

Much further down there’s also a call to a SHA256 function. It also looks like there’s a case in the code from some debug build or environment where the function will just return a random string as the security key but I don’t think that helps us.

panasonic_cc_ghidra

I send an email to Panasonic today (translated from Dutch to English by Google Translate, so sorry for mistakes):


Dear Panasonic,

For a number of years I have been using 3 Panasonic air conditioners to my satisfaction. I have an implementation in use via Home Assistant. The plugin for this is https://github.com/sockless-coding/panasonic_cc However, as a developer/hobbyist, I realize that this implementation is not official, but there are many home automation users who control their air conditioners in this way.

Since November 5 early in the morning, I/we believe that security has been further tightened and this API connection is no longer possible. Could you undo this?

It would be better if home automation users could communicate with the WiFi modules of the air conditioner itself, without having to use the cloud. For example, you can turn this on via the Comford Cloud app and accept a number of conditions, after which you can use the local API. Or, a public API from the Comford Cloud. For now it would be great if you could restore the (not entirely official) API for the many Home Assistant users who want to automate something.

Thanks in advance

On behalf of many home automation enthusiasts,

%my name%

Keep you posted!

@nelsongraca it doesn’t look like they have changed anything in the client request code/headers this time. Haven’t had time to confirm this since I had some trouble with my request snooping setup. But initial findings points to server side validation of the x-cfc-api-key header, but the generation of that value is handled by the Java_com_panasonic_cn_securitylib_PSecurity_createSecurityKey method located in libsecurity-lib.so…

The X-CFC-API-KEY is based on several values: The string constant “Comfort Cloud” The time sent in the X-APP-TIMESTAMP header The key access token or null if not authenticated These values are manipulated and hashed using SHA512 manipulated some more and turned in to a 67 character long string

I wonder if we’ll ever be able to manage everything just on local. …

There IS a way to manage locally only, but it involves building your own WiFi adapter for the AC unit and replacing the original one. There is a guide somewhere, I’ll see if I can find the link again.

UPDATE: Here’s the link: https://www.espthings.io/index.php/2023/09/02/esphome-panasonic-climate-interface/

@sockless-coding , I’m using the Panasonic Comfort Cloud app and intercepting the network requests so hopefully I can find what’s missing. I’m writing some nodejs code right now to test to see if I can control the AC from the tokens/codes I get from the different payloads.

I’m Currently keeping a markdown file to keep track of the values. Next I’ll dive into your repo to see how you’re controlling the panasonic AC in python, trying to create a working PoC right now where I can change anything at all just to test out if this works.

EDIT: I have a private repo set up, I’ll make it public once I’ve confirmed it works

EDIT2: The auth flow does error out sometimes when I proxy requests, I just retry it until it works

I mainly followed this guide on youtube on intercepting network requests from the app: https://www.youtube.com/watch?v=r7aV39-CKg4

I’ve requested a quote and the PCB + Assembly is $29 for 2 units, only waiting for the components quote now.

I would like to discourage you, and others to not support the creator and author of this project. They are discriminating against those who can’t do diy even for health or body function reasons, telling anyone who can’t diy to abandon the project altogether regardless if the reason is legitimate or not. If this is the only choice, then please do not use their affiliate links as it encourages even more discrimination.

Step 1 would be to get a simple request like https://accsmart.panasonic.com/resource/resourcePath to work, this one doesn’t require authentication Headers being sent to it are:

Header Value
x-app-type 1
x-app-version 1.22.0
accept application/json; charset=utf-8
content-type application/json
user-agent G-RAC
x-app-name Comfort Cloud
x-app-timestamp 2024-11-06 18:59:43
x-cfc-api-key jy9757acxcfb1eve7nmoigsz8fxqqqvjj5iiu531gvyx99bwdekbutaj889ee4dx9wf
accept-encoding gzip

Headers are generated like this

    public d0 intercept(@NonNull w.a aVar) {
        String str;
        String q10 = d.q();
        b0 request = aVar.request();
        PSecurity pSecurity = PSecurity.INSTANCE;
        int createSecurityKey = pSecurity.createSecurityKey(this.f18736a, "Comfort Cloud", q10, m.g());
        if (createSecurityKey == 0) {
            str = pSecurity.getSecurityKey();
        } else {
            str = String.valueOf(createSecurityKey);
        }
        b0.a h10 = request.h();
        h10.
		a("X-APP-TYPE", "1").
		a("X-APP-VERSION", "1.22.0").
		a("Accept", "application/json; charset=utf-8").
		a("Content-Type", "application/json").
		a("User-Agent", "G-RAC").
		a("X-APP-NAME", "Comfort Cloud").
		a("X-APP-TIMESTAMP", q10).
		a("X-CFC-API-KEY", str);
        Context context = this.f18736a;
        String i10 = PreferencesUtil.i(context, PreferencesUtil.r(context));
        if (i10 != null) {
            h10.a("X-Client-Id", i10);
        }
        return aVar.proceed(h10.b());
    }

The culprit is probably the x-cfc-api-key

Same here… maybe just to wait HA update 2024.11

@sockless-coding Great Work

pls send a paypal adress . i cant buy coffee thx

It’s frustrating to see Panasonic spend their time on locking us out rather than improving the awful Comfort Cloud app.

I suggested previously to disable the constant polling in this integration which would significantly reduce the load on Panasonic’s servers and that was rejected. This was the natural outcome from that.

Exactly like that!!

It’s frustrating to see Panasonic spend their time on locking us out rather than improving the awful Comfort Cloud app.

I suggested previously to disable the constant polling in this integration which would significantly reduce the load on Panasonic’s servers and that was rejected. This was the natural outcome from that.

I ain’t admitting defeat here… ISTG, there is a way forward without having to do any hardware stuff… Here’s what I’m currently doing…

I’m using Charles proxy to proxy the requests from the panasonic comfort cloud app to my macbook. I, am then able to read all of the network requests from the panasonic comfort cloud app. What I’m trying to figure out, if there’s any way to use the tokens/codes that come from logging into the panasonic comfort cloud app…

I’m working right now so I may not have time to commit to it. Sensitive information edited out. I’ll continue to look into it but I’m currently at work right now so I won’t have time until after to write some code to test things out.

EDIT: If this succeeds, we can make temporary inputs to the extension to accept those tokens and probably some additional docs on how to get them from the auth request.

image

I’ve requested a quote and the PCB + Assembly is $29 for 2 units, only waiting for the components quote now.

I would like to discourage you, and others to not support the creator and author of this project. They are discriminating against those who can’t do diy even for health or body function reasons, telling anyone who can’t diy to abandon the project altogether regardless if the reason is legitimate or not. If this is the only choice, then please do not use their affiliate links as it encourages even more discrimination.

How is this discriminating? There is a knowledge bar and skill bar that needs to be met to even start with such a project. It’s simply a warning that it might be smarter to not waste your time

I wonder if we’ll ever be able to manage everything just on local. …

There IS a way to manage locally only, but it involves building your own WiFi adapter for the AC unit and replacing the original one. There is a guide somewhere, I’ll see if I can find the link again. UPDATE: Here’s the link: https://www.espthings.io/index.php/2023/09/02/esphome-panasonic-climate-interface/

Thank you man!!!

This is way too complicated, at least for me. Unfortunately. I wonder if it would be possible to use ESP as a substitute for the “Panasonic Cloud” and control AC unit that way?

PCBWay seems to offer the PCB + Assembly and components. (https://www.pcbway.com/project/shareproject/espthings_io_ET_P1101_ESPHome_Panasonic_Climate_Interface_4cc10e31.html)

I’ve requested a quote and the PCB + Assembly is $29 for 2 units, only waiting for the components quote now.

Do we really have to post all this here? Can’t we just stick to the issue at hand instead of posting all indivual complaints to Panasonic? Perhaps create a new ticktet for this and move that conversation over there.

If this issue is sourced on the Panasonic side and there’s little we can do at our end, isn’t it best we collaborate a bit to push them to resolution? Or should there be no coordinated effort, no chat against this thread (as there’s potentially no technical solution at our end) and we just sit around waiting for magic to happen?

My only need is energy monitoring…

I used ghidra and binary ninja to poke around last night, the first thing it seems to do is compare signatures to one of two strings (debug / release)

Figured that was an attempt to prevent us from yoinking the module and just using it

I send an email to Panasonic today (translated from Dutch to English by Google Translate, so sorry for mistakes): Dear Panasonic, For a number of years I have been using 3 Panasonic air conditioners to my satisfaction. I have an implementation in use via Home Assistant. The plugin for this is https://github.com/sockless-coding/panasonic_cc However, as a developer/hobbyist, I realize that this implementation is not official, but there are many home automation users who control their air conditioners in this

So now that they have the link to the github repo - even if this is fixed, they can now see what is being done to overcome the restrictions everytime…awesome.

Do you think they didn’t know before? They didn’t wonder why so many “apps” connect to their servers every 30 seconds? Normally, the application is used several times a day, so it connects maybe 20-30 times per day? This integration connects 7680 times per day! Some other plugins / integrations had a refresh time of up to every 3 seconds! Why do you think they keep changing APIs?

They Could limit the amount of calls. Then every developer would go for that max amount. and work around that given amount. The Problem of overloaded server is fixed as well, Without pissing off 40% ? of you Comfort Cloud Users.

They could. But they don’t want to. They clearly replied that they not planning an official API.

However as @sockless-coding mentioned, if we can’t crack the X-CFC-API-KEY , we’re kinda screwed unfortunately.

@pacholoamit if the apps can calculate it so can we it’s a matter of time, I’ll try to look into the APK if I find the time.

@garmck I’m pretty sure they knew about it, also let’s try to stay on topic and focus our efforts on fixing this 🙂

A few months ago there was another project where the API got hardened, and the solution then was this code. I have no idea, tbh, but throwing out there in case it sparks some idea:

def get_api_key():
    # Get the session token
    r = requests.get('https://api.xxx.xxx/api/v1/authorization-sessions')
    api_token = r.json().get('token')

    # Shift the string by one byte
    shifted_bytes = bytearray(api_token.encode('utf-8'))[1:] + bytearray([api_token.encode('utf-8')[0]])
    shifted_string = shifted_bytes.decode('utf-8')

    # Calculate the MD5 hash of the shifted string
    md5_hash = hashlib.md5(shifted_string.encode('utf-8')).hexdigest()

    return md5_hash

Same issue here, i’ve just send the mail as well.

update: Case No.: 00365044

Same for me 😦 but worked until now and didn’t work after a reboot a my HA

@Wyger-leystra not possible, they use MTLS from the heat pump so without getting a valid certificate the heatpump wont connect.

The amount of traffic generated by this integration is negligible to Panasonic… even if it makes 7680 requests per day… that times 1350 (HA analytics) thats 10 368 000 requests per day… How much traffic do you think the heat pump them self generate? If you look at the google play store it has 500k+ downloads… This is some package capture from my heat pump calling home:

09:17:53.352805 IP 20.210.0.37.443 > 192.168.11.161.55188: tcp 357
09:17:53.355482 IP 192.168.11.161.55188 > 20.210.0.37.443: tcp 0
09:17:53.781406 IP 192.168.11.161.55188 > 20.210.0.37.443: tcp 69
09:17:54.080559 IP 20.210.0.37.443 > 192.168.11.161.55188: tcp 0
09:17:54.083872 IP 192.168.11.161.55188 > 20.210.0.37.443: tcp 575
09:17:54.375578 IP 20.210.0.37.443 > 192.168.11.161.55188: tcp 0
09:18:18.787482 IP 192.168.11.161.55188 > 20.210.0.37.443: tcp 69
09:18:19.081077 IP 20.210.0.37.443 > 192.168.11.161.55188: tcp 0
09:18:19.083206 IP 192.168.11.161.55188 > 20.210.0.37.443: tcp 69
09:18:19.376876 IP 20.210.0.37.443 > 192.168.11.161.55188: tcp 0
09:18:43.790579 IP 192.168.11.161.55188 > 20.210.0.37.443: tcp 69
09:18:44.083034 IP 20.210.0.37.443 > 192.168.11.161.55188: tcp 0
09:18:44.085094 IP 192.168.11.161.55188 > 20.210.0.37.443: tcp 69
09:18:44.382866 IP 20.210.0.37.443 > 192.168.11.161.55188: tcp 0
09:18:49.199102 IP 192.168.11.161.55188 > 20.210.0.37.443: tcp 69
09:18:49.499145 IP 20.210.0.37.443 > 192.168.11.161.55188: tcp 0
09:18:49.501807 IP 192.168.11.161.55188 > 20.210.0.37.443: tcp 453
09:18:49.769761 IP 20.210.0.37.443 > 192.168.11.161.55188: tcp 245
09:18:49.865567 IP 192.168.11.161.55188 > 20.210.0.37.443: tcp 0

Say 2 times per minute… 2880 * 500000 = 1 440 000 000 a few magnitudes more than the integration… and thats excluding all heatpumps controlled by apple users…

if we would be able to redirect the calls to the panasonic cloud (using a router / DNS redirect for example), do you think it would be possible to create a mock API? This way we could still use HA and the existing hardware. Like a MITM aproach?

@marcel-st PCB + Assembly include´s all parts inkl. esp?

You only need esp32, logic converter 5v <-> 3.3v and connector. No PCB needed

Even if it probably won’t help much, I have also opened a very detailed support ticket with Panasonic Germany (aircon_support_de@eu.panasonic.com).

Case number: 00365238

I really hope that Panasonic takes action here and doesn’t leave all HomeAssitant / IO Broker users in the lurch

Perhaps @sockless-coding can still work magic

I wonder if we’ll ever be able to manage everything just on local. …

There IS a way to manage locally only, but it involves building your own WiFi adapter for the AC unit and replacing the original one. There is a guide somewhere, I’ll see if I can find the link again. UPDATE: Here’s the link: https://www.espthings.io/index.php/2023/09/02/esphome-panasonic-climate-interface/

Thank you man!!!

This is way too complicated, at least for me. Unfortunately. I wonder if it would be possible to use ESP as a substitute for the “Panasonic Cloud” and control AC unit that way?

I’m looking around as well to see what other options are out there as I agree this seems to complicated. I came across this one which is esp and looks simpler

https://github.com/DomiStyle/esphome-panasonic-ac

That is the sourcecode used for the HW mentioned in the first link. The first link is details on one way of building the HW needed for the sourcecode:-) I strongly concidering to order the parts and build o couple of them myself. Need to get rid of the comfort cloud dependenciy at home.

Do we really have to post all this here? Can’t we just stick to the issue at hand instead of posting all indivual complaints to Panasonic? Perhaps create a new ticktet for this and move that conversation over there.

If this issue is sourced on the Panasonic side and there’s little we can do at our end, isn’t it best we collaborate a bit to push them to resolution? Or should there be no coordinated effort, no chat against this thread (as there’s potentially no technical solution at our end) and we just sit around waiting for magic to happen?

I am afraid their intention is to block everything not coming from the app as much as possible …they do not want to help us.

@nelsongraca it doesn’t look like they have changed anything in the client request code/headers this time. Haven’t had time to confirm this since I had some trouble with my request snooping setup. But initial findings points to server side validation of the x-cfc-api-key header, but the generation of that value is handled by the Java_com_panasonic_cn_securitylib_PSecurity_createSecurityKey method located in libsecurity-lib.so…

I faced this same issue with the BYD app, as did some others with different car apps. The only solution in that case was to create an add-on which emulated, say, Android and would pass through the values from the integration to the add-on which would run that .so function and return the output back to the integration.

I’ll be digging around to check if I can find what changed @sockless-coding any findings so far?

same over here 😦

Same issue here!

Oh well at lest it’s not just me:)

Same issue here!

And here too…

Same. You guys rock. Actually I have Swedish Tibber and they have also trouble to get it to work with Panasonic and they have tried in month. I have complained both to them and Panasonic. You solved this in some hours. You could sell this solution to them…. Hope you feel grate you earned it 😃

fre 8 nov. 2024 kl. 18:03 skrev jaknil0 @.***>:

Wow, many thanks to those contributing to fixing this one!!

— Reply to this email directly, view it on GitHub https://github.com/sockless-coding/panasonic_cc/issues/331#issuecomment-2465291226, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3HNRJNXGUG5WJNOJE3R4PTZ7TVH3AVCNFSM6AAAAABRFPF4L6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRVGI4TCMRSGY . You are receiving this because you commented.Message ID: @.***>

Thank you so much @sockless-coding 🙇 You are awesome!

@sockless-coding Great Work

pls send a paypal adress . i cant buy coffee thx @Garagoos, @Auka84 I will definitely send a coffee tip, too. I found the tipping link on home assistant forums (see end of his first post): https://community.home-assistant.io/t/panasonic-comfort-cloud/229090

or just wait till he is online and confirms the link 😃

I think what @Wyger-leystra meant, is to mimic Panasonic Cloud for the device itself, so a proxy can intercept commands and do not let them leave the house. Not sure how feasible this is and how difficult to implement.

I send an email to Panasonic today (translated from Dutch to English by Google Translate, so sorry for mistakes): Dear Panasonic, For a number of years I have been using 3 Panasonic air conditioners to my satisfaction. I have an implementation in use via Home Assistant. The plugin for this is https://github.com/sockless-coding/panasonic_cc However, as a developer/hobbyist, I realize that this implementation is not official, but there are many home automation users who control their air conditioners in this

So now that they have the link to the github repo - even if this is fixed, they can now see what is being done to overcome the restrictions everytime…awesome.

Do you think they didn’t know before? They didn’t wonder why so many “apps” connect to their servers every 30 seconds? Normally, the application is used several times a day, so it connects maybe 20-30 times per day? This integration connects 7680 times per day! Some other plugins / integrations had a refresh time of up to every 3 seconds! Why do you think they keep changing APIs?

It’s frustrating to see Panasonic spend their time on locking us out rather than improving the awful Comfort Cloud app.

@pacholoamit - what version of the iOS app are you running? Did you have to patch it to trust your certificate? Mine seems to be doing SSL pinning.

Yes, but it should be sent with the headers, so if we do a man-in-the-middle proxy we should be able to get that? Maybe we can find the pattern if we collect some?

As I said before, it’s an external function that cannot be called natively from Python and I don’t believe that the values are static, so would need to reverse engineer the .so code.

Thanks! That helps, so far I was able to get the bearer token from the IOS app and used it with /userinfo, this was using the https://authglb.digital.panasonic.com endpoints though, when I used the same bearer token with the https://accsmart.panasonic.com/device/group endpoint (I found it after looking through some nodejs libraries) I’m getting a 403 unauthorized error.

image

I’ll take a look at https://aquarea-smart.panasonic.com/ to see the requests being sent. Getting this error though, I’ll retry again in a bit.

image

@pacholoamit yeah that is for IOS, the certificate check is a bit annoying for the Android version… The important part is looking at the accsmart.panasonic.com calls, the auth is easy enough to handle and can be viewed in a browser if you go via https://aquarea-smart.panasonic.com/

@pacholoamit are you debugging the IOS app? When I patch the android to support my mitm cert I get the same error in the app

{
    "code": 41201,
    "message": "Precondition Failed"
}

image

@marcel-st PCB + Assembly include´s all parts inkl. esp?

Got this answer from Panasonic Swedenm they didn’t even comment on the strenghtened security as of nov 5, "Hi Anders,

Thank you for your email.

Unfortunately, there is no open API or any plan for it to come. Sorry that’s not the answer you want but unfortunately it is.

Kind regards Frederick Panasonic Support"

Yes this is the source code but it also explains how to build one. If you read some of the discussion people have it working just on an esp32 and nothing else. I’ve ordered one plus the required connector. I’ll test it out when it arrives

I’m still struggling to find the correct connector for my device. Ordered three different that looked that it would fit but doesn’t 😭

Have the esp already here and configured

Do we really have to post all this here? Can’t we just stick to the issue at hand instead of posting all indivual complaints to Panasonic? Perhaps create a new ticktet for this and move that conversation over there.

If this issue is sourced on the Panasonic side and there’s little we can do at our end, isn’t it best we collaborate a bit to push them to resolution? Or should there be no coordinated effort, no chat against this thread (as there’s potentially no technical solution at our end) and we just sit around waiting for magic to happen?

I am afraid their intention is to block everything not coming from the app as much as possible …they do not want to help us.

but the Google home/Alexa integration does work?

That’s an official ‘integration’ - part of their marketing and product capabilities. So they won’t block that.

isn’t there a way to use that integration within HA?

They can get “Works with Home Assistant” for their marketing and product capabilities too 😉 . If everyone is writing letters to Panasonic, you could mention this https://partner.home-assistant.io/

For anyone who want to mail too: I got a file number: 00365019 aircon_support_nl@eu.panasonic.com

Just put that number in the subject and body somewhere.

I guess you can send in English too, hopefully they will understand 😛

I send an email to Panasonic today (translated from Dutch to English by Google Translate, so sorry for mistakes):

Dear Panasonic,

For a number of years I have been using 3 Panasonic air conditioners to my satisfaction. I have an implementation in use via Home Assistant. The plugin for this is https://github.com/sockless-coding/panasonic_cc However, as a developer/hobbyist, I realize that this implementation is not official, but there are many home automation users who control their air conditioners in this way.

Since November 5 early in the morning, I/we believe that security has been further tightened and this API connection is no longer possible. Could you undo this?

It would be better if home automation users could communicate with the WiFi modules of the air conditioner itself, without having to use the cloud. For example, you can turn this on via the Comford Cloud app and accept a number of conditions, after which you can use the local API. Or, a public API from the Comford Cloud. For now it would be great if you could restore the (not entirely official) API for the many Home Assistant users who want to automate something.

Thanks in advance

On behalf of many home automation enthusiasts,


was this raised as ticket or email? Please share guidance I think there should be a whole raft of us sending something similar.

Same here. Hoping Panasonic won’t Block and it’s just temporary issue…

Facing the same issue 😦 Appreciate all that you do for us! Thank you team!

__Logger: homeassistant.config_entries Source: config_entries.py:594 First occurred: 10:53:10 AM (2 occurrences) Last logged: 11:12:16 AM

Error setting up entry for panasonic_cc Traceback (most recent call last): File “/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py”, line 64, in start_session await self._get_groups() File “/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py”, line 79, in _get_groups self._groups = await self.execute_get( ^^^^^^^^^^^^^^^^^^^^^^^ File “/config/custom_components/panasonic_cc/pcomfortcloud/panasonicsession.py”, line 145, in execute_get await check_response(response, function_description, expected_status_code) File “/config/custom_components/panasonic_cc/pcomfortcloud/helpers.py”, line 32, in check_response raise exceptions.ResponseError( custom_components.panasonic_cc.pcomfortcloud.exceptions.ResponseError: (get_groups: Expected status code 200, received: 412: { “code”:41201, “message”:“Precondition Failed” }

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/config/custom_components/panasonic_cc/init.py”, line 76, in async_setup_entry await api.start_session() File “/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py”, line 67, in start_session await self.reauthenticate() File “/config/custom_components/panasonic_cc/pcomfortcloud/apiclient.py”, line 71, in reauthenticate await super().reauthenticate() File “/config/custom_components/panasonic_cc/pcomfortcloud/panasonicsession.py”, line 68, in reauthenticate await self._authentication.authenticate(self._username, self._password) File “/config/custom_components/panasonic_cc/pcomfortcloud/panasonicauthentication.py”, line 68, in authenticate await self.retrieve_client_acc() File “/config/custom_components/panasonic_cc/pcomfortcloud/panasonicauthentication.py”, line 263, in retrieve_client_acc await check_response(response, ‘get_acc_client_id’, 200) File “/config/custom_components/panasonic_cc/pcomfortcloud/helpers.py”, line 32, in check_response raise exceptions.ResponseError( custom_components.panasonic_cc.pcomfortcloud.exceptions.ResponseError: (get_acc_client_id: Expected status code 200, received: 412: { “code”:41201, “message”:“Precondition Failed” }