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.8k stars 30.06k forks source link

Myuplink integration handles enum-controls incorrect #117942

Closed hakwest closed 2 months ago

hakwest commented 4 months ago

The problem

Myuplink integration do not handle writable enum-controls correct.

When the response from Myuplink contains a enum-control that is writable the integration do not handle the response as expected. It should create a writable-control with the enum values. Instead it creates a sensor that can't be used to set any enum-value. The response below shows the myuplink-swagger-response for the "comfort mode" that have four enum-value for the warmvater comfort-mode.

{ "category": "VVM 310, 3x400V", "parameterId": "47041", "parameterName": "comfort mode", "parameterUnit": "", "writable": true, "timestamp": "2024-05-22T15:02:03+00:00", "value": 0, "strVal": "economy", "smartHomeCategories": [], "minValue": null, "maxValue": null, "stepValue": 1, "enumValues": [ { "value": "4", "text": "smart control", "icon": "" }, { "value": "0", "text": "economy", "icon": "" }, { "value": "1", "text": "normal", "icon": "" }, { "value": "2", "text": "luxury", "icon": "" } ], "scaleValue": "1", "zoneId": null },

What version of Home Assistant Core has the issue?

core-2024.5.3

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

Myuplink

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

home-assistant[bot] commented 4 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 4 months ago

Thank you for reporting this issue. This is the first example we see where there is an enum datapoint with writable attribute set to true. This entity should probably be implemented with the select platform. We will put it on the to-do list for the integration.

hakwest commented 4 months ago

Perfect - looking forward for a release with this implemented. :-)

astrandb commented 3 months ago

@hakwest I have now prepared a PR that adds a select entity for data points with multiple enum values. It works in theory (pytest) but I need to verify the functionality in real life before submitting the change. Are you comfortable with running a HA development environment? If not, I think the easiest way is if you share access to your device via the myUplink web site. Please contact me on ake@strandberg.eu if you are willing to assist with the final verification.