home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.06k stars 29.72k forks source link

Melcloud Cannot Connet #117997

Open Aldodo91 opened 3 months ago

Aldodo91 commented 3 months ago

The problem

unable to connect mel cloud integration Screen 23_05_2024 (22 01 18)

What version of Home Assistant Core has the issue?

core-2024.5.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

mlauhalu commented 3 months ago

Same issue here. Suddenly stopped working and trying to add the integration from scratch gets the cannot_connect error.

jonare77 commented 3 months ago

Same here. I get a certificate verification error. Strange because Melcloud app works. Are they using diffrent certificates?

home-assistant[bot] commented 3 months ago

melcloud documentation melcloud source

eagle-phoenix commented 3 months ago

Same here. Certificate verification error.

elogreb commented 3 months ago

Same here...PC app is working. Android app same as here

eismarkt commented 3 months ago

Same here

MikeVanMelle commented 3 months ago

Browser app working, mobile and HA can't connect.

Screenshot 2024-05-24 at 00 00 37
lovekull76 commented 3 months ago

My app has stopped working as well :/

guihom83 commented 3 months ago

Same here but also Android app failed at login Screenshot_2024-05-23-23-12-34-061_mitsubishi wifi android mitsubishiwifiapp and app.melcloud.com IS not stable

emma201101 commented 3 months ago

App still works. Only Problems with HA interattion

thephantom commented 3 months ago

same here :(

Schermafbeelding 2024-05-24 013056

GMTheDoctor commented 3 months ago

Same here, waiting for a solution :(

Misxs commented 3 months ago

same here

philippebaque commented 3 months ago

same here too.

web is working, but 'app' or 'ha' failed (certificats issue).

the certificate is working on web but not with 'app' or 'ha' ?

OlivierZal commented 3 months ago

It's an intermediate certificate issue:

Server certificate
subject=C=GB, ST=Hertfordshire, O=Mitsubishi Electric Europe B.V., CN=*.melcloud.com
issuer=C=GB, ST=Greater Manchester, L=Salford, O=Sectigo Limited, CN=Sectigo RSA Organization Validation Secure Server CA
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA
Server Temp Key: ECDH, prime256v1, 256 bits
---
SSL handshake has read 3491 bytes and written 450 bytes
Verification error: unable to verify the first certificate
AuroreVgn commented 3 months ago

In France I’ve got an SSL certificat error since this morning (May 24th) and the last change of temperature sensor was yesterday (May 23rd) at 17h25 (Paris time).

The iPhone app is working as MELCloud on web browser. The Android app is not working.

Does anyone know to accept the certificat manually or have any idea to bypass this SSL verification?

simonepittis commented 3 months ago

the SSL certificate chain is not complete. unfortunately it happens every year when they renew the certificate.

https://www.sslshopper.com/ssl-checker.html?hostname=app.melcloud.com

there are only two solutions:

  1. wait for them to change the certificate by installing the correct one
  2. install the Intermediate certificate in HA... but I haven't found the correct procedure yet
AuroreVgn commented 3 months ago
  1. Yep. Typical IT every year stuff 😅
  2. If you find it, I can try it, if you need some help.
simonepittis commented 3 months ago

I made the "workaround" (advanced users)

open HA shell: docker exec -it homeassistant /bin/bash vi /usr/local/lib/python3.12/site-packages/pymelcloud/client.py

on line 34 you find this: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True"

change to: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True, verify_ssl=False"

save and exit

HA core restart

Fix it ;-)

Nightstalker81 commented 3 months ago

I made the "workaround" (advanced users)

open HA shell: docker exec -it homeassistant /bin/bash vi /usr/local/lib/python3.12/site-packages/pymelcloud/client.py

on line 34 you find this: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True"

change to: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True, verify_ssl=False"

save and exit

HA core restart

Fix it ;-)

Which unfortunately only works for Docker installations, right? AFAIK with HAOS there is no such option or does anymore know of a workaround for HAOS?

simonepittis commented 3 months ago

I use HAOS

the Core works like Docker in the OS

Install addon Advanced SSH & Web Terminal with Protection mode is disabled

Pave87 commented 3 months ago

I made the "workaround" (advanced users)

open HA shell: docker exec -it homeassistant /bin/bash vi /usr/local/lib/python3.12/site-packages/pymelcloud/client.py

on line 34 you find this: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True"

change to: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True, verify_ssl=False"

save and exit

HA core restart

Fix it ;-)

Are we expecting any issues with future updates or would this just get overwritten back to original?

simonepittis commented 3 months ago

I made the "workaround" (advanced users) open HA shell: docker exec -it homeassistant /bin/bash vi /usr/local/lib/python3.12/site-packages/pymelcloud/client.py on line 34 you find this: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True" change to: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True, verify_ssl=False" save and exit HA core restart Fix it ;-)

Are we expecting any issues with future updates or would this just get overwritten back to original?

this is only a workaround, waiting the SSL fix. if you update the CORE you lose the fix

Nightstalker81 commented 3 months ago

I made the "workaround" (advanced users) open HA shell: docker exec -it homeassistant /bin/bash vi /usr/local/lib/python3.12/site-packages/pymelcloud/client.py on line 34 you find this: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True" change to: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True, verify_ssl=False" save and exit HA core restart Fix it ;-)

Are we expecting any issues with future updates or would this just get overwritten back to original?

Not 100% sure but it should possibly be the later one: overwritten to original and would (if needed) be manually edited again.

hillell commented 3 months ago

https://github.com/home-assistant/core/issues/92905#issuecomment-1542669058

eismarkt commented 3 months ago

i became an error cannot execute binary file

simonepittis commented 3 months ago

i became an error cannot execute binary file

where?

ilwalti commented 3 months ago

I made the "workaround" (advanced users)

open HA shell: docker exec -it homeassistant /bin/bash vi /usr/local/lib/python3.12/site-packages/pymelcloud/client.py

on line 34 you find this: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True"

change to: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True, verify_ssl=False"

save and exit

HA core restart

Fix it ;-)

Unfortunately, it doesn't work for me... nor the app works. Only web access is OK.

BTW, the real syntax of row 34 is as follows: f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True and I've changed accordingly: f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True, verify_ssl=False (there are no double quotes at the beginning/end of the row) Just to avoid misunderstandings.

bkleef commented 3 months ago

I prefer to keep SSL verification enabled with: verify_ssl=True.

The intermediate certificate which is missing in the chain is:

Check it yourself with: https://www.ssllabs.com/ssltest/analyze.html?d=app.melcloud.com.

Download: https://support.sectigo.com/articles/Knowledge/Sectigo-Intermediate-Certificates

Content of the .crt file:

-----BEGIN CERTIFICATE-----
MIIGGTCCBAGgAwIBAgIQE31TnKp8MamkM3AZaIR6jTANBgkqhkiG9w0BAQwFADCB
iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV
BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTgx
MTAyMDAwMDAwWhcNMzAxMjMxMjM1OTU5WjCBlTELMAkGA1UEBhMCR0IxGzAZBgNV
BAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEYMBYGA1UE
ChMPU2VjdGlnbyBMaW1pdGVkMT0wOwYDVQQDEzRTZWN0aWdvIFJTQSBPcmdhbml6
YXRpb24gVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENBMIIBIjANBgkqhkiG9w0B
AQEFAAOCAQ8AMIIBCgKCAQEAnJMCRkVKUkiS/FeN+S3qU76zLNXYqKXsW2kDwB0Q
9lkz3v4HSKjojHpnSvH1jcM3ZtAykffEnQRgxLVK4oOLp64m1F06XvjRFnG7ir1x
on3IzqJgJLBSoDpFUd54k2xiYPHkVpy3O/c8Vdjf1XoxfDV/ElFw4Sy+BKzL+k/h
fGVqwECn2XylY4QZ4ffK76q06Fha2ZnjJt+OErK43DOyNtoUHZZYQkBuCyKFHFEi
rsTIBkV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3mSZiIBYRiBXBWdoY5TtMibx3+bfEO
s2LEPMvAhblhHrrhFYBZlAyuBbuMf1a+HNJav5fyakywxnB2sJCNwQs2uRHY1ihc
6k/+JLcYCpsM0MF8XPtpvcyiTcaQvKZN8rG61ppnW5YCUtCC+cQKXA0o4D/I+pWV
idWkvklsQLI+qGu41SWyxP7x09fn1txDAXYw+zuLXfdKiXyaNb78yvBXAfCNP6CH
MntHWpdLgtJmwsQt6j8k9Kf5qLnjatkYYaA7jBU=
-----END CERTIFICATE-----

With Docker you can add the intermediate certificate like:

-v $(pwd)/SectigoRSAOrganizationValidationSecureServerCA.crt:/etc/ssl/certs/SectigoRSAOrganizationValidationSecureServerCA.crt
simonepittis commented 3 months ago

it's an other way :-)

you can use the HACS "Additional CA for Home Assistant" too, if you use HAOS

vekexasia commented 3 months ago

it's an other way :-)

you can use the HACS "Additional CA for Home Assistant" too, if you use HAOS

Ive tried adding the sectigo crt and reload ha but no luck for me

eismarkt commented 3 months ago

open HA shell: docker exec -it homeassistant /bin/bash vi /usr/local/lib/python3.12/site-packages/pymelcloud/client.py

here comes the error cannot open binary file

route66por commented 3 months ago

Same error here

simonepittis commented 3 months ago

try:

docker container cp /config/additional_ca/SectigoRSAOrganizationValidationSecureServerCA.crt homeassistant:/etc/ssl/certs/SectigoRSAOrganizationValidationSecureServerCA.crt

the other way if you have the HAOS

simonepittis commented 3 months ago

open HA shell: docker exec -it homeassistant /bin/bash vi /usr/local/lib/python3.12/site-packages/pymelcloud/client.py

here comes the error cannot open binary file

  1. docker exec -it homeassistant /bin/bash
  2. vi /usr/local/lib/python3.12/site-packages/pymelcloud/client.py

two diff commands :-)

simonepittis commented 3 months ago

image

image

image

image

Nightstalker81 commented 3 months ago

Just stumbled upon this... shouldn't it be possible to just copy the certificate to the shared folder "ssl" (if the Samba Share Addon is used)? As I understand it that should be used custom certificates, shouldn't it?

AuroreVgn commented 3 months ago

I made the "workaround" (advanced users) open HA shell: docker exec -it homeassistant /bin/bash vi /usr/local/lib/python3.12/site-packages/pymelcloud/client.py on line 34 you find this: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True" change to: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True, verify_ssl=False" save and exit HA core restart Fix it ;-)

Unfortunately, it doesn't work for me... nor the app works. Only web access is OK.

BTW, the real syntax of row 34 is as follows: f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True and I've changed accordingly: f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True, verify_ssl=False (there are no double quotes at the beginning/end of the row) Just to avoid misunderstandings.

Same for me, I have edited the file, reboot and still doesn't work.

ilwalti commented 3 months ago

After some time it worked on HA... at least for me. But still no joy with the phone app...

AuroreVgn commented 3 months ago

After some time it worked on HA... at least for me. But still no joy with the phone app...

I will wait.

simonepittis commented 3 months ago

After some time it worked on HA... at least for me. But still no joy with the phone app...

After some time it worked on HA... at least for me. But still no joy with the phone app...

I can't fix the app :-)

try to install the certificate in you mobile phone...

eismarkt commented 3 months ago

can you give me the command to write in the document. because it is open but i can change anything in it

AuroreVgn commented 3 months ago

can you give me the command to write in the document. because it is open but i can change anything in it

You have to press "i". Once edited press "Esc" then ":wq"

ilwalti commented 3 months ago

After some time it worked on HA... at least for me. But still no joy with the phone app...

After some time it worked on HA... at least for me. But still no joy with the phone app...

I can't fix the app :-)

try to install the certificate in you mobile phone... Nope. I think that Mitsubishi have to fix their own mistakes... Phone app is an official piece of the suite!

eismarkt commented 3 months ago

ok, i have change it , but it dosn´t work

AuroreVgn commented 3 months ago

ok, i have change it , but it dosn´t work

Same here and still nothing.

I've tried the certificate method but it still doesn't work. Did I have to delete the following links, I have in /etc/ssl/certs :

9046744a.0 -> ca-cert-Sectigo_Public_Server_Authentication_Root_R46.pem
ca-cert-IdenTrust_Public_Sector_Root_CA_1.pem -> /usr/share/ca-certificates/mozilla/IdenTrust_Public_Sector_Root_CA_1.crt
ca-cert-Sectigo_Public_Server_Authentication_Root_E46.pem -> /usr/share/ca-certificates/mozilla/Sectigo_Public_Server_Authentication_Root_E46.crt
ca-cert-Sectigo_Public_Server_Authentication_Root_R46.pem -> /usr/share/ca-certificates/mozilla/Sectigo_Public_Server_Authentication_Root_R46.crt
da0cfd1d.0 -> ca-cert-Sectigo_Public_Server_Authentication_Root_E46.pem
mainmind83 commented 3 months ago

change to: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True, verify_ssl=False"

  1. Install Advanced SSH: https://github.com/hassio-addons/addon-ssh
  2. Config plugin with user and password of root
  3. Open terminal web
  4. Execute: docker exec -it homeassistant /bin/bash
  5. Execute: vi /usr/local/lib/python3.12/site-packages/pymelcloud/client.py
  6. Search on line 34: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True" change to: "f"{BASE_URL}/Login/ClientLogin", json=body, raise_for_status=True, verify_ssl=False" Basic vi: press "esc" and write ":w" to save file Basic vi: press "esc" and write ":x" to exit vi
  7. Restart OS

image

osulivanDE commented 3 months ago

I could just reload the integration and now my Aircon is avaliable again.

Klorins commented 3 months ago

Yes, seems like its fixed in Melcloud`s end now. Works again here without any changes applied.

simonepittis commented 3 months ago

yes. cert fixed :-)