jaroschek / home-assistant-myuplink

Custom Home Assistant integration for devices and sensors in myUplink account.
44 stars 10 forks source link

No systems found #111

Closed OnlyRobin closed 2 months ago

OnlyRobin commented 5 months ago

This is not due to the integration, but maybe someone here knows what I am doing wrong or what is wrong.

I have a myuplink account, Dev application and everything has worked well, a week ago the entities were suddenly gone.

I went to Swagger UI to test this and GET /v2/systems/me gives me no errors but only this (Response body Download { "page": 1, "itemsPerPage": 10, "numItems": 0, "systems": [] } ).

But when I go to https://myuplink.com/ everything works.

I deleted the old application and created a new application. Deleted and recreated my Myuplink account but it doesn't work.

I asked Myuplink itself, but they couldn't help me.

Anyone have any idea what could be wrong?

drwatson75 commented 5 months ago

Same here for me, output swagger (get user systems) Thanks, Rogier

{ "page": 0, "itemsPerPage": 0, "numItems": 0, "systems": [ { "systemId": "xxxxxxxxxxxxxxxxxxxxxxx", "name": "string", "securityLevel": "admin", "hasAlarm": true, "country": "string", "devices": [ { "id": "string", "connectionState": "Disconnected", "currentFwVersion": "string", "product": { "serialNumber": "string", "name": "string"

a-mavrides commented 5 months ago

Hello All,

same here:

{ "page": 1, "itemsPerPage": 10, "numItems": 0, "systems": [] }

Crossmotion commented 5 months ago

Same problem here, since +/- 4 days

marsav commented 5 months ago

Same issue, the systems endpoint is returning empty list, looks like an API issue. Slightly irrelevant but noticed that myuplink.com itself uses v3/groups/me endpoint to get systems info. If I take the id from v3/groups/me response, I can successfully query my device info via /v2/devices/{deviceId} endpoint.

Reported issue to myUplink.

a-mavrides commented 5 months ago

@marsav Indeed it seems that the only "problematic " api endpoint is /v2/systems/me. As you mentioned from internalapi you can get the systems . So as a temporary solution i am combining the response from internalapi -> v3/groups/me in a json file in the following format : { "page": 1, "itemsPerPage": 99, "numItems": 1, "systems": [ { "systemId": "xxxxxxx-xxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxx", "name": "Name", "securityLevel": "admin", "has_alaram": false, "country": "Country", "devices": [ { "id": "xxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxxxx-xxxxxxxxx", "connectionState": "Connected", "currentFwVersion": "9696R3", "product": { "serialNumber": "00000000000000000", "name": "XXXXXXXXX" } } ] }, { "systemId": "xxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxxx", "name": "Name", "securityLevel": "admin", "has_alaram": false, "country": "Country", "devices": [ { "id": "xxxx-xxxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxxx", "connectionState": "Connected", "currentFwVersion": "9696R3", "product": { "serialNumber": "00000000000", "name": "XXXXXX" } } ] } ] }

Save this as a json file in the same directory as myuplink /config/custom_components/myuplink/

Then in api.py after line """Return all systems.""" _LOGGER.debug("Fetch systems") async with self.lock, self.throttle: resp = await self.auth.request("get", "systems/me?page=1&itemsPerPage=99") resp.raise_for_status() data = await resp.json()

i have added the following :

` # File path to be opened path = '/config/custom_components/myuplink/my.json'

Mode to be set

    mode = 0o666
    # flags
    flags = os.O_RDONLY
    fd = os.open(path, flags, mode)
    os.lseek(fd, 0, 0)
    str = os.read(fd, os.path.getsize(path))
    data1 = str.decode()
    os.close(fd)
    data = json.loads(data1)`

This will load the systems from json file instead from the api and since all the other api calls are successful the integration is working just fine for me .

Remember this is a temporary workaround and once the api is fully functional again the above code should be removed

olivebadger14 commented 5 months ago

for anyone who needs it

the code formatted correctly is

File path to be opened

    path = '/config/custom_components/myuplink/workaround_payload.json' 
    # Mode to be set  
    mode = 0o666 
    # flags 
    flags = os.O_RDONLY 
    fd = os.open(path, flags, mode) 
    os.lseek(fd, 0, 0) 
    str = os.read(fd, os.path.getsize(path)) 
    data1 = str.decode() 
    os.close(fd) 
    data = json.loads(data1)

also at the very beginning of the file where all the import statements are you also need to add :

import os

olivebadger14 commented 5 months ago

only problem im facing is that this temp fix creates over 500 entities for the device, i assume this isnt right?

a-mavrides commented 5 months ago

hello @olivebadger14 it shouldn't be any different from the api calling the normal flow since we are just injecting the response from the /v2/systems/me api call

OnlyRobin commented 5 months ago

I dont know how do i get the systemid and the id to enter here,

{ "page": 1, "itemsPerPage": 99, "numItems": 1, "systems": [ { "systemId": "xxxxxxx-xxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxx", "name": "Name", "securityLevel": "admin", "has_alaram": false, "country": "Country", "devices": [ { "id": "xxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxxxx-xxxxxxxxx", "connectionState": "Connected", "currentFwVersion": "9696R3", "product": { "serialNumber": "00000000000000000", "name": "XXXXXXXXX" } } ] }, { "systemId": "xxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxxx", "name": "Name", "securityLevel": "admin", "has_alaram": false, "country": "Country", "devices": [ { "id": "xxxx-xxxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxxx", "connectionState": "Connected", "currentFwVersion": "9696R3", "product": { "serialNumber": "00000000000", "name": "XXXXXX" } } ] } ] }

olivebadger14 commented 5 months ago

@OnlyRobin the way do do it is inspect the network traffic in chrome while you load the main my uplink page (right click, inspect page, click the network tab) then filter for internalapi and check the resoposes of the GET requests, refresh the page if you still cant find your id

a-mavrides commented 5 months ago

@OnlyRobin you could use postman to generate the internalapi flow , but the easiest way as @olivebadger14 suggests is to login into myuplink.com as usual and then open your browser's developer console from there go to network tab and search for "me" one of those responses will be from v3/groups/me open the response from that and all the information are there.

OnlyRobin commented 5 months ago

Thank you, found it. But is the Systemid and the id the same because i get a 404 error

a-mavrides commented 5 months ago

@OnlyRobin No systemid and id are not the same . Please check the response from v3/groups/me .

OnlyRobin commented 5 months ago

Thank you all for helping, i got it to work. Nice job.

OnlyRobin commented 4 months ago

? What is wrong with the API. It sucks realy bad. Now i get:

https://api.myuplink.com/v2/systems/XXXXXXXXXXXXXXXXXXXXXXXX/notifications/active?page=1&itemsPerPage=10 403 Error: Forbidden

Response body The subject does not have access to the system "------------------------------"

SentiHassio1979 commented 4 months ago

What am I doing incorrectly when I get this response

image

a-mavrides commented 4 months ago

@OnlyRobin what Brand is your heatpump ?

OnlyRobin commented 4 months ago

@OnlyRobin what Brand is your heatpump ?

I have a Mitsubishi Heavy Hydrolution and my controller is a RC-HY40-W same as the SMO 40.

Everything whas working good but now not anymore. The error i get is from HA an swagger.

Think i need to make something using a modbus or something.

a-mavrides commented 4 months ago

I think that api works only with NIBE , that's why most people dont have problems with this integration.

SentiHassio1979 commented 4 months ago

I think that api works only with NIBE , that's why most people dont have problems with this integration.

Don’t agree since it was working before and now it stopped. MHI is fully running on myUplink software.

a-mavrides commented 4 months ago

I think that api works only with NIBE , that's why most people dont have problems with this integration.

Don’t agree since it was working before and now it stopped. MHI is fully running on myUplink software.

so what is stopping just a few of us from using the api ?

SentiHassio1979 commented 4 months ago

I think that api works only with NIBE , that's why most people dont have problems with this integration.

Don’t agree since it was working before and now it stopped. MHI is fully running on myUplink software.

so what is stopping just a few of us from using the api ?

What do you mean?

a-mavrides commented 4 months ago

I think that api works only with NIBE , that's why most people dont have problems with this integration.

Don’t agree since it was working before and now it stopped. MHI is fully running on myUplink software.

so what is stopping just a few of us from using the api ?

What do you mean?

That most people dont have an issue with the integration , hence the api is working fine for them. Is there some account restriction that it is not letting us use the api to retrieve nor systems or even query the systems "The subject does not have access to the system "------------------------------"" ?

SentiHassio1979 commented 4 months ago

I think that api works only with NIBE , that's why most people dont have problems with this integration.

Don’t agree since it was working before and now it stopped. MHI is fully running on myUplink software.

so what is stopping just a few of us from using the api ?

What do you mean?

That most people dont have an issue with the integration , hence the api is working fine for them. Is there some account restriction that it is not letting us use the api to retrieve nor systems or even query the systems "The subject does not have access to the system "------------------------------"" ?

As said myUplink is not providing much help or assistance. Hence it seems all with MHI are out of luck. I feel my api v3 is giving me already less response than all nibe users. And same I can’t get swagger to work. And let me be honest I am totally outside of my field of experience and don’t have a nibe machine to compare.

olivebadger14 commented 4 months ago

Same here have an MHI system, the only alternative for me it tio go back to using multiscraper to at least get some info off the myuplink site.

SentiHassio1979 commented 4 months ago

Same here have an MHI system, the only alternative for me it tio go back to using multiscraper to at least get some info off the myuplink site.

My question would be for the NIBE users, is your response on v3/groups/m. For me with a MHI system I have this result. Which seems not to give me the correct input to put on the json file. image

a-mavrides commented 4 months ago

@SentiHassio1979 Which json file are you referring to ? What values are you expecting to see ?

SentiHassio1979 commented 4 months ago

@SentiHassio1979 Which json file are you referring to ? What values are you expecting to see ?

@marsav Indeed it seems that the only "problematic " api endpoint is /v2/systems/me. As you mentioned from internalapi you can get the systems . So as a temporary solution i am combining the response from internalapi -> v3/groups/me in a json file in the following format : { "page": 1, "itemsPerPage": 99, "numItems": 1, "systems": [ { "systemId": "xxxxxxx-xxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxx", "name": "Name", "securityLevel": "admin", "has_alaram": false, "country": "Country", "devices": [ { "id": "xxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxxxx-xxxxxxxxx", "connectionState": "Connected", "currentFwVersion": "9696R3", "product": { "serialNumber": "00000000000000000", "name": "XXXXXXXXX" } } ] }, { "systemId": "xxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxxx", "name": "Name", "securityLevel": "admin", "has_alaram": false, "country": "Country", "devices": [ { "id": "xxxx-xxxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxxx", "connectionState": "Connected", "currentFwVersion": "9696R3", "product": { "serialNumber": "00000000000", "name": "XXXXXX" } } ] } ] }

All these bold ones or lets say the "x"-es, I can't (for sure it will be me who is the problem) map to the results of what I get from the internal api. I am being asked to enter "systemID" and "devices ID" with my result I don't get to a logical way of entering that it is working.

a-mavrides commented 4 months ago

@SentiHassio1979 Thats the solution i proposed a few weeks ago but for a few days MHI users after setting up the response to query the systems with

https://api.myuplink.com/v2/systems/XXXXXXXXXXXXXXXXXXXXXXXX/notifications/active?page=1&itemsPerPage=10 403 Error: Forbidden

Response body The subject does not have access to the system "------------------------------"

SentiHassio1979 commented 4 months ago

@SentiHassio1979 Thats the solution i proposed a few weeks ago but for a few days MHI users after setting up the response to query the systems with

https://api.myuplink.com/v2/systems/XXXXXXXXXXXXXXXXXXXXXXXX/notifications/active?page=1&itemsPerPage=10 403 Error: Forbidden

Response body The subject does not have access to the system "------------------------------"

Correct so we are stuck in fiding solution. Again not blaiming anybody, but I don't understand as an MHI user paying for a NIBE sucscription why do I not get it working.

technixp commented 4 months ago

I am another MHI user with same issue. Did you try contacting them?

SentiHassio1979 commented 4 months ago

I am another MHI user with same issue. Did you try contacting them?

sadly just got this response, which to me totally disgusted. You trick me into an annual subscription and then say I am not supporting your device anymore.

image

OnlyRobin commented 4 months ago

I am another MHI user with same issue. Did you try contacting them?

sadly just got this response, which to me totally disgusted. You trick me into an annual subscription and then say I am not supporting your device anymore.

image

Well that's a nice one, your heat pump will get new software and myuplink says whe do not support youre brand. Only the API part (which worked fine at first) because the app does work.

I'm going to contact the supplier here in the Netherlands because I don't really agree with this, MHI Hydrolution just runs on Nibe hardware.

I tried to downgrade the software to myupway but that doesn't work anymore, or does anyone know a workaround for that.

OnlyRobin commented 4 months ago

I think I have good news! For MHI Heatpomp. I spoke to the supplier and they told me that they knew about this and that there will be an update this week.

With this new update everything should work as it should again and the API should also work again.

So let's hope.

SentiHassio1979 commented 4 months ago

I think I have good news! For MHI Heatpomp. I spoke to the supplier and they told me that they knew about this and that there will be an update this week.

With this new update everything should work as it should again and the API should also work again.

So let's hope.

Does that mean an update in MyUplink software or in home assistant integration?

OnlyRobin commented 4 months ago

I think I have good news! For MHI Heatpomp. I spoke to the supplier and they told me that they knew about this and that there will be an update this week. With this new update everything should work as it should again and the API should also work again. So let's hope.

Does that mean an update in MyUplink software or in home assistant integration?

It's an update for the Heatpump from MyUplink software.

SentiHassio1979 commented 4 months ago

Sounds bit strange with feedback MyUplink themselves are giving, but lets just hope this works. Than you for the actions and communications!

OnlyRobin commented 4 months ago

Sounds bit strange with feedback MyUplink themselves are giving, but lets just hope this works. Than you for the actions and communications!

This does not come from myuplink, Mitsubishi publishes a new update via myuplink, myuplink has nothing to do with the new software. Mitsubishi itself must supply the good software. They say what I just heard over the phone is that the problem must be correct again. So I'm curious if that is the case.

SentiHassio1979 commented 4 months ago

Sounds bit strange with feedback MyUplink themselves are giving, but lets just hope this works. Than you for the actions and communications!

This does not come from myuplink, Mitsubishi publishes a new update via myuplink, myuplink has nothing to do with the new software. Mitsubishi itself must supply the good software. They say what I just heard over the phone is that the problem must be correct again. So I'm curious if that is the case.

Removed the intregration with credentials removed -> removed the integration from hacs -> reboot -> reinstall the hacs integrations -> reboot -> setup integration with successful login to myuplink but still no devices found.

OnlyRobin commented 4 months ago

Sounds bit strange with feedback MyUplink themselves are giving, but lets just hope this works. Than you for the actions and communications!

This does not come from myuplink, Mitsubishi publishes a new update via myuplink, myuplink has nothing to do with the new software. Mitsubishi itself must supply the good software. They say what I just heard over the phone is that the problem must be correct again. So I'm curious if that is the case.

Removed the intregration with credentials removed -> removed the integration from hacs -> reboot -> reinstall the hacs integrations -> reboot -> setup integration with successful login to myuplink but still no devices found.

Whe need to wait for the new firmware update to come from Mitsubishi, they say it will come this week (Let's hope) so before that, the integration nor the swagger site (API) will not work.

SentiHassio1979 commented 4 months ago

We need to wait for the new firmware update to come from Mitsubishi, they say it will come this week (Let's hope) so before that, the integration nor the swagger site (API) will not work.

Ok, 10 minutes ago got notification on firmware update :)

Steps taken: 1) Firmware downloaded on USB, installed on RC-HY20 2) Integration removed 3) HACS integration removed 4) Reboot home assistant 5) Application on dev.myuplink removed 6) Reinstalled HACS integration Myuplink 7) Reboot home assistant 8) Installed integration and created application on dev.myuplink 9) Reboot home assistant for safety

BUT :( still have no devices or entities showing up

technixp commented 4 months ago

I also tried to update to 9696R6 and used swagger API playground to try it out. Still does not work.

OnlyRobin commented 4 months ago

Indeed the API does not work, tried swagger and still shows the same result: (The subject does not have access to the system 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.).

I'm going to call the supplier again tomorrow.

Super annoying.

SentiHassio1979 commented 4 months ago

Indeed the API does not work, tried swagger and still shows the same result: (The subject does not have access to the system 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.).

I'm going to call the supplier again tomorrow.

Super annoying.

Not disputing your information in any shape or form, appreciating very much what you are doing. But to me one of problems is that when I do an inspect on the myuplink.com I seem to be getting different / not all information from people with NIBE devices are getting. So the needed / mentioned workaround with ID / SystemID and everything I am not able to pull all the requested information. That sounds like confirmation what Myuplink has said to me by not having an open API anymore for other brands. Again I could be totally wrong.

OnlyRobin commented 4 months ago

For Mitsubishi users who no longer have access to the API.

Okay, I got my heat pump on HA with a LILYGO T-CAN485 print together with the integration of ESPHome. It took a bit of figuring out, but it worked and no more hassle with an API.

See screenshot. Schermafbeelding 2024-07-04 210455

I can write and read and have many more entities.

For Dutch see (https://gathering.tweakers.net/forum/list_messages/2237666/0)

For English see (https://github.com/elupus/esphome-nibe/issues/56).

The board you need costs approximately 22 euros including shipping costs. On Aliexpress (https://nl.aliexpress.com/item/1005003624034092.html?src=google&src=google&albch=shopping&acnt=494-037-6276&slnk=&plac=&mtctp=&albbt=Google_7_shopping&albagn=888888&isSmbAutoCall=false&needSmbHouyi=false&albcp=19764919660&albag=&trgt=&crea=nl1005003624034092&netw=x&device=c&albpg=&albpd=nl1005003624034092&gad_source=1&gclid=CjwKCAiA3JCvBhA8EiwA4kujZmC6fB2y8yO2Y2ZuqBa2WEhCgYCFqIKrIgc5mqG9k955mJgdMeujdBoCzIEQAvD_BwE&gclsrc=aw.ds&aff_fcid=74b714b6435142bc8b7a9e96862be5d3-1709537562959-08237-UneMJZVf&aff_fsk=UneMJZVf&aff_platform=aaf&sk=UneMJZVf&aff_trace_key=74b714b6435142bc8b7a9e96862be5d3-1709537562959-08237-UneMJZVf&terminal_id=61f4cbc3c1c34f5590b7292ef35210b5&afSmartRedirect=y)

Let me know if you need any help.

SentiHassio1979 commented 4 months ago

For Mitsubishi users who no longer have access to the API.

Okay, I got my heat pump on HA with a LILYGO T-CAN485 print together with the integration of ESPHome. It took a bit of figuring out, but it worked and no more hassle with an API.

Let me know if you need any help.

Looks as a very solid working solution. Is there a risk that the people from myUplink going to disable this with next firmwares? I do have a preference to keep my heat pump running on latest firmware and would be waste of money if next month it will be disabled.

OnlyRobin commented 4 months ago

For Mitsubishi users who no longer have access to the API. Okay, I got my heat pump on HA with a LILYGO T-CAN485 print together with the integration of ESPHome. It took a bit of figuring out, but it worked and no more hassle with an API.

Let me know if you need any help.

Looks as a very solid working solution. Is there a risk that the people from myUplink going to disable this with next firmwares? I do have a preference to keep my heat pump running on latest firmware and would be waste of money if next month it will be disabled.

No, this would not be possible because this is done via the modbus of the heat pump.

Would only be possible if they remove the modbus function in the firmware, but the firmware comes from Mitsubishi.

SentiHassio1979 commented 4 months ago

For Mitsubishi users who no longer have access to the API. Okay, I got my heat pump on HA with a LILYGO T-CAN485 print together with the integration of ESPHome. It took a bit of figuring out, but it worked and no more hassle with an API.

Let me know if you need any help.

Looks as a very solid working solution. Is there a risk that the people from myUplink going to disable this with next firmwares? I do have a preference to keep my heat pump running on latest firmware and would be waste of money if next month it will be disabled.

No, this would not be possible because this is done via the modbus of the heat pump.

Would only be possible if they remove the modbus function in the firmware, but the firmware comes from Mitsubishi.

Ordered. Thanks for finding, sharing and helping! Much appreciated.

olivebadger14 commented 4 months ago

@OnlyRobin Hello, i noticed that on NIBE HP you need to enable modbus first on the Heat Pump but i cant find this setting on my MHI Hydrolution system.

Does this mean modbus is enabled by default somewhere else?

SentiHassio1979 commented 4 months ago

@OnlyRobin Hello, i noticed that on NIBE HP you need to enable modbus first on the Heat Pump but i cant find this setting on my MHI Hydrolution system.

Does this mean modbus is enabled by default somewhere else?

Checked on mine as well. Do you have the RC-HY20 as well? Left is RC-HY20 and right is RC-HY40 image My order from Aliexpress will be coming in today which means is useless????