WHY THE HECK can't we freely configure a Cover to interpret its percentage value as "percentage open" or "percentage closed"?

@Jpsy, I don’t wont to bury this hope :slight_smile: !! That’s the reason why I want to discuss this here again. Nobody will change the KNX standard, therefore my switches will always show 100% as closed.

I think the problem is, that KNX is used mainly in Europe, but it is coming more and more, especially in the private sector.

I completely agree that changing the interface between integrations and home assistant core should not be changed (too many dependencies, not only to KNX integration). But what about a home assistant internal property to invert the behaviour…?

For me the current behaviour is also not correct.

Roller shutter completely open should be 0
Roller shutter completely closed should be 100.

I hope that this will changed so that moving the slider to the right will close the cover and not open it.

This works for the slider (now slider to the left means open, slider to the right means close).

But the Up and Down buttons are now wrong. How can I invert those buttons as well?

Not possible. I have investigated several hours / days to find a solution. The only chance is a change in home assistant, but who knows if this ever will happen.

Best regards

Okay…yes I hope that they will change this soon. It should be a very easy modification I think.

The issue here is that value_template and position_template cannot been set concurrently in a template cover, so HA assumed the cover is open, when position is 100 and cover is closed when position is 0.

I found a “solution” which fits my needs, using two rows in an entities-card, except than just one. The first row uses the original entity, to control the cover with the buttons, the second row shows a slider and uses the template reverse entity, like the one you have:
image

  - type: entities
    entities:
      - entity: cover.rollladen_arbeitszimmer
        name: Rollladen
      - entity: cover.revers_rolladen_arbeitszimmer
        type: custom:slider-entity-row
        full_row: true
        hide_state: false

For the slider I use the custom slider-entity-row:

There is another custom card I use, which looks a bit different, but works for me too:

Maybe this helps you to find a solution, that fits your needs :wink:

1 Like

Hi @tobi-bo

Thanks for the tip. Maybee I will use this. But still I hope that men will implement this soon.

Another request for a solution here. I’m having a KNX automated home as well. And 100 means 100% covered. Period. :100::grin:

Even Openhab and other IoT platforms do it this way. So it would be great if a solution could be found for that problem.

1 Like

I have a slightly different but related request. Some of the comments further up this thread resonate.

I have written an integration for a projector screen. I was able to arrange for 0 to be closed and 100 to be open so that isn’t the problem. The problem is that semantically I want closed to mean fully up (retracted into the ceiling) and open to mean partially or fully down (depending on aspect ratio). I also want the cover icons to be yellow/active when the screen is partially or fully down.

Unfortunately, HA considers “closed” to mean down so all of the lovelace cards are back to front. I proposed a new device class to reverse the semantics for screens (TL:DR) but haven’t really gained any traction.

Anyway, in this context I’d like to suggest that if the option is ever added to invert the percentage position, could we also add an option to invert the semantics of open/closed?

1 Like

I case you haven’t noticed, this forum is in English. Please post your questions in English.

just use this: invert the open and close service.

      open_cover:
        service: cover.close_cover
        data:
          entity_id: cover.raamverduistering_stookhok
      close_cover:
        service: cover.open_cover
        data:
          entity_id: cover.raamverduistering_stookhok
      stop_cover:
        service: cover.stop_cover
        data:
          entity_id: cover.raamverduistering_stookhok

maybe this was intruduced after the question was raised.

First and foremost I agree with many of the sentiments on both sides of the arguments. When I first set out to automate blinds: Automated Window Blinds - Spark Core - Projects & Stories - SmartThings Community
I looked at this in a way that I felt was pragmatic. I looked at the state of the blinds, where open let in the most light. So my code was as such closed: 0% no light is allowed in and the blinds are slanted upward. Open: 50% of servo range and light can fully pass through. 100% is not mapped to a state, but can be called with an open 100% command. For venetian blinds I still feel this makes the most sense. I can entirely see where a garage door or other entities it makes the most sense to look at this the other way. When it comes to blinds though, I’m sorry I was the first to create these integrations so I get to say! :wink:

1 Like

With your script the buttons are inverted. The buttons are working good. It is only the slider that is wrong.

@jjhtpc It 's quite simple. You have a cover at a window. You move the cover down across the window…so you slide to the right to close the cover.

That is in my opion the only logic working.

% closed or % open. I don’t care but understand both arguments. And of course more options are always better so satisfy every need.

I would be more interested in an option, where I can define which state is set, if 0%, [1-99%] and 100% closed/open. Because I like to have it “on” if closed and partly closed and not if open and I’m reverting it with card-mod-entry per shutter.

Yes I understand your statement. The reality is we probably need different types of covers. Venetian blinds as I coded for are very different than roller shades and both are different than vertical shades.

Also if anyone really needs this I think my code was adapted to be used with a continuous rotation servo. You could always write the code the way you need it.

Once again thank you Marius!!!

I took your idea one step further and actually renamed my existing 5 entitity_id’s with _hidden and created templated ones with the original entity_id. My templates look like this:

      kitchen_blind_2:
        friendly_name: Kitchen 2
        value_template: >
            {%- if state_attr('cover.kitchen_blind_2_hidden','current_position')|int > 98 %}closed
            {% else %}open{% endif %}
        position_template: >
          {{100 - (state_attr('cover.kitchen_blind_2_hidden','current_position')|int)}}
        set_cover_position:
          service: cover.set_cover_position
          data_template:
            entity_id: cover.kitchen_blind_2_hidden
            position: >
              {{100 - position}}
        open_cover:
          service: cover.set_cover_position
          data_template:
            entity_id: cover.kitchen_blind_2_hidden
            position: >
              {{states("input_number.kitchen_blind_2")}}
        close_cover:
          service: cover.set_cover_position
          data_template:
            entity_id: cover.kitchen_blind_2_hidden
            position: 99

I have routines in Node Red which monitor the input_number presets for the open position which will call set_cover_postion with the new input_number value so they automatically adjust to the new desired position. The same could of course be done with automations…

2 Likes

Sorry for the newb question but can you please tell me which file to modify and how to enter this code?
My buttons in the shutter are working the opposite and it drives me crazy as well.
Thanks :pray:t2:

14 months later. Any movement on this? Who do I have to bribe?

I have outside venetian blinds on every window. Their function, just like curtains is to stop light when they are closed. So closed = 100% (of light stopped)

It is a lot of work to get this to function properly.
Install File editor and add this to configuration.yaml and add this for an inverted slider - Yes one for each blind on your house!! Code from Marius several posts above^^

#https://www.home-assistant.io/integrations/cover.template/
cover:
  - platform: template
    covers:
      christina_blind_inverted:
        friendly_name: Christina blind inverted
##        device_class: shade
        position_template: >
          {{100 - (state_attr('cover.blind_2','current_position')|int)}}
        set_cover_position:
          service: cover.set_cover_position
          data_template:
            entity_id: cover.blind_2
            position: >
              {{100 - position}}

Add a new empty card in lovelace

type: entities
entities:
  - entity: cover.blind_2
    name: Christina's cool blinds
    tap_action:
      action: none
    icon: mdi:blinds
  - entity: cover.christina_blind_inverted
    type: custom:slider-entity-row
    full_row: true
    hide_state: true

Looks real nice and the navigation to the incorrect slider is disabled too.

image

1 Like

I 100% agree it must be configurable. (100% meaning fully configurable :crazy_face: ). Crucial for the WAF, and templates won’t do. Buttons will look inverted and voice integrations will also be messed up. I’ve templated over 10 covers for other reasons and it is a pain.

To the industrialists who say the default should be safe I do want to state that this is a bad argument for the value of the percentage.

First of all: e.g. an awning is not safe when expanded: the wind will destoy it. And I have rollerblinds in front of inward turning windows. They must never go down when the window is open. But for a garage door, things are different.

But more importantly: Systems can be made safe without the usability suffering. A terrible accident happened in the Netherlands because a motorized vehicle did not brake by default when a cable snapped. That does not mean that 0% brake is full brake, or that you should constantly press the brake to be able to ride. Even more so in software, how a system is engineered safely should not dictate how it is used. Users are usually not engineers and the UI should be loosely coupled to the inner workings.

Also metaphores are broken. If you call something a cover, then 100% should mean fully covered. If you call it a blind, then 100% should be fully bllinded. I’m Dutch, but I’d like someone English to explain what is the flaw in that logic.

If you want it to work differently, then call it differently. My HA is rife with remote controlled dimmers. But we all call them light in HA because that is how we perceive it. Had we all called them dimmers, 100% dimmed would mean lights off. Go explain that to your wife :crazy_face:

And to the lighting enthousiasts: I buy my blinds to make it dark, so I can sleep. So I’m not letting the light in - that is what windows are for. I’m trying to keep light out. I guess I’m a Glass Half Empty kind of guy. :grinning:

6 Likes

So, if we all agree it should be configurable, is there any timeline for adding this feature? Personally, I can’t wait :wink: