Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover: Percentage Displayed wrong / inversed #23904

Open
3 of 4 tasks
realdognose opened this issue Jan 27, 2025 · 4 comments
Open
3 of 4 tasks

Cover: Percentage Displayed wrong / inversed #23904

realdognose opened this issue Jan 27, 2025 · 4 comments

Comments

@realdognose
Copy link

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

I'm controlling some blinds (via knx) which have the following operation-constraints for both, position and angle:

  • opened := 0%
  • closed := 100%

Control works as expected, when attempting to close the blinds, 100% is send to knx, however the UI still shows the percentage-tooltip
as 0% for "closed" and 100% for "opened":

Image

Image

Applies for both sliders, position and angle.

Describe the behavior you expected

ToolTip should indicate the value actually beeing "send":

Image

Steps to reproduce the issue

View the percentage-tooltip of a blind configured like:

knx:
 cover:
    #UG
    - name: "Jalousien Foyer Klein"
      move_long_address: "2/0/0"
      stop_address: "2/0/1"
      position_address: "2/0/2"
      angle_address: "2/0/3"
      position_state_address: "11/0/2"
      angle_state_address: "11/0/3"
      device_class: "blind"

What version of Home Assistant Core has the issue?

2025.1.2

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue?

Any

Which operating system are you using to run this browser?

Any

State of relevant entities

Problem-relevant frontend configuration

Javascript errors shown in your browser console/inspector

Additional information

No response

@realdognose realdognose changed the title Cover: Percentage Displayed wrong Cover: Percentage Displayed wrong / inversed Jan 27, 2025
@karwosts
Copy link
Contributor

Frontend is just going to follow the percentage in the current_position attribute. Whatever is going in the background in KNX communication is not relevant, all covers have to follow the standard for cover.

If the attribute is not as you expect, you'll have to take that up in core.

@realdognose
Copy link
Author

realdognose commented Jan 28, 2025

Not sure if core would be the right place to address this, as the actual "position" of the sliders is correct,
just the value-description of the position-label is wrong (Should be 0, not 100 in my case):

i.e. attributes currently state 100 for fully open blinds, sliders all to the top. This equals 0 on the bus.
now, if core would change the attributes to report 0, wouldn't frontend render the sliders all down?

So basically, frontend needs to be able to interpret the value "different"?
Tricky thing is that the slider is right, but label is wrong. That means if core would just "invert" the
values then the sliders visual position would be wrong.

Image

Image

@karwosts
Copy link
Contributor

karwosts commented Jan 28, 2025

Home assistant global definition for covers has defined for covers 100% to mean fully open and 0% to be fully closed. https://developers.home-assistant.io/docs/core/entity/cover/#properties

This is not going to be changed on the frontend.

@realdognose
Copy link
Author

realdognose commented Jan 28, 2025

Well, this can't be addressed on the backend / core. (Not alone)

Because for both cases, 100=close and 100=open, the slider needs to be "up position", we can agree.
Only thing that would need to change, is the label. So, therefore, if the frontend only relies on a single variable
for both ui-elements, it can't handle it, no matter what the backend is setting there.

So, the core would require some modification plus the frontend as well.

(Nobody said, it would be easy :) )

The label basically needs to reflect the "actual_control_value" all the time, while the slider needs to become aware,
when it should be inverted.

this could be done by:

  • Modifying core to expose the actual_control_value all the time.
  • Exposing open_value as well (to be defined by the user setting up the cover-definition).
  • Then, the label always equals the actual_control_value and the slider-position equals MAX(open_value; actual_control_value)-MIN(open_value;actual_control_value)

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants