jaroschek / home-assistant-myuplink

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

Entity names not resolving correctly #54

Open x3n0n10 opened 8 months ago

x3n0n10 commented 8 months ago

I was able to successfully set up a connection with my heatpump through myUplink, however as you can see in the screenshot below, apparently my heatpump isn't providing the correct names for all available entities.

image

Tried it with both version 1.0.3 and 1.0.4-rc1

jaroschek commented 8 months ago

Hello @x3n0n10, that problem is really strange (but thanks testing the pre-release version too.)

The integration tries to name the entities based in device name and parameter name. If there is a special category given it uses this string too. It just concatenates these strings to create a quite unique name for each entity.

Can you try and check the direct API response of the parameter points?

Go to the MyUplink Swagger site, and authorize (top right). Find your device ID by querying ​/v2​/systems​/me, enter it when querying /v2/devices/{deviceId}/points.

The response of /v2​/systems​/me should contain a property name inside product inside of each device. And each parameter in the response of /v2/devices/{deviceId}/points should contain a parameterName and a category.

Is there any of these properties missing for your device?

x3n0n10 commented 8 months ago

Turns out your source is not to blame here, the API itself is returning these strange values, for my device at least:

image

Tried different language codes just for fun, but to no avail.

jaroschek commented 8 months ago

Okay. Thanks for the update. The least thing I can do is ignore strings with this error message Text not found.

x3n0n10 commented 8 months ago

Fine by me of course, though I can understand if you don't want that kind of code in your project. The neatest solution is for the myUplink guys to get to work. But that might take a while.

jaroschek commented 8 months ago

Please try the new release: https://github.com/jaroschek/home-assistant-myuplink/releases/tag/1.0.5

As category names are optional I opted to ignore the category name if it contains the error message.

Yes, this should be avoided by the myUplink API itself. But this is a small change to solve this highly visible issue.

As adoption of this integration will rise (recent firmware updates for new API and this integration recently added to HACS defaults), there may be more challenges to come.

x3n0n10 commented 8 months ago

Just installed (re-added device to HA), but not there yet I'm afraid

image
jaroschek commented 8 months ago

Sorry... my fault! The release was to rushed...

I have fixed the problem of missing parameter name for entity name, if category is empty with the newest release: https://github.com/jaroschek/home-assistant-myuplink/releases/tag/1.0.6

x3n0n10 commented 8 months ago

There we go, happy now :) Thanks Stefan! Most of them look normal now. These ones are still a bit vague, probably because of the missing categories, but they aren't the most important fields to me.

image
jaroschek commented 8 months ago

Can you provide the json response for these writable parameters? Are they really provided with the same parameter name?

x3n0n10 commented 8 months ago

Sure thing! Yea parameterNames are all the same. modeOfOperation.json

jaroschek commented 8 months ago

Ok. That's hard to find a solution for. Event adding the parameter id would not help here. There is really nothing to differentiate these parameters in a readable form.

But hopefully this (and the category name problem) will be solved by the manufacturers, when the adoption and usage of the new myUplink API rises and more people will give them feedback.

As written in the issue #48 it is possible to be in contact with the manufacturers to work on a solution for such problems.