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
73.71k stars 30.84k forks source link

Myuplink Høiax connected water heater Model Id sensor fails to register #115520

Closed thytterdal closed 5 months ago

thytterdal commented 7 months ago

The problem

I have been having problems using this integration with my water heater lately as the integration tries to register the model_id field coming from the API as a numeric sensor as it does not provide a unit. This again seems to cause the update of data to fail until the integration is restarted and it manages to update once before failing again.

The response coming from the API for this point is:

  {
    "category": "18760NE2051223802688",
    "parameterId": "513",
    "parameterName": "Model id",
    "parameterUnit": "",
    "writable": false,
    "timestamp": "2024-04-13T08:55:37+00:00",
    "value": "18760NE2051223802688",
    "strVal": "18760NE2051223802688",
    "smartHomeCategories": [],
    "minValue": null,
    "maxValue": null,
    "stepValue": 1,
    "enumValues": [],
    "scaleValue": "1",
    "zoneId": null
  }

I have a fix for this locally. Would a pull request be welcome?

What version of Home Assistant Core has the issue?

core-2024.4.3

What was the last working version of Home Assistant Core?

core-2024.4.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Myuplink

Link to integration documentation on our website

https://www.home-assistant.io/integrations/myuplink

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

home-assistant[bot] commented 7 months ago

Hey there @pajzo, @astrandb, mind taking a look at this issue as it has been labeled with an integration (myuplink) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `myuplink` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign myuplink` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


myuplink documentation myuplink source (message by IssueLinks)

astrandb commented 7 months ago

Thank you for reporting this. There can be different approaches to fix this. One is just to skip creating a sensor for this parameter. model_id sounds like a very static value that should be displayed in the model field of the device and not as a sensor. This said, a guard to prevent crashes if the API delivers invalid values would be good. Or did you have anything else in mind? A diagnostic download from your device could be useful to see the whole context. Please drag such a file into this issue.

And finally, a PR is always welcome.

thytterdal commented 7 months ago

As you say this value is static and also present in the model field of the device. So it might be best to just skip the creation of it.

My current approach has been to add a category based description, using the same approach as you currently have for certain NIBEF entities in order to create the sensor.

I will provide a PR sometime later today to skip the creation of this sensor and others with the same problem.

astrandb commented 7 months ago

This integration does a lot of qualified guesses how to represent the API data in HA. The API spec is OK but the implementation by the different manufacturers differ a lot. I would therefore appreciate a diagnostic download file from your HA instance. Then we can make sure that the integration makes best use of the available data. If you dont want to leave the file here you can mail it to me directly at ake@strandberg.eu . The file is redacted so no sensitive data should be included.