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

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…

1 Like

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:

I’ve just created a topic for this in the feature requests. Please vote to let this happen!

I found two solutions which works fine for me:

1.)
image

2.)
image

It acts like i want. If i close the cover (slide to the right 100%). Status is “geschlossen (closed)” and the wert (value) is 100%.

I will post the steps which are needed asap.

I’m curious how you did that! Didn’t find a good solution myself.

Hi delcara. Here my solution:
First of all thanks to Marius.

You can use any kind of technology. I use KNX.

1.) KNX configuration

knx:
  - name: "Jalousie sofa"
    stop_address: "1/3/52"
    position_address: "1/3/53"
    position_state_address: "1/7/57"
    angle_address: "1/3/55"
    angle_state_address: "1/7/58"
    invert_position: false 
    invert_angle: true
    travelling_time_down: 38
    travelling_time_up: 38

this creates cover.jalousie_sofa

2.) Create a cover inverted helper object. This helper is needed to define that 0 is open and 100 is closed.

cover:
  - platform: template
    covers:
      jalousie_sofa_inverted:
        friendly_name: Jalousie sofa inverted
        position_template: >
          {{100 - (state_attr('cover.jalousie_sofa','current_position')|int)}}
        set_cover_position:
          service: cover.set_cover_position
          data_template:
            entity_id: cover.jalousie_sofa
            position: >
              {{100 - position}}

3.) Now create a card and put all together:

# That is the information card
  - entity: cover.jalousie_sofa # Here i use the KNX object with attribute current_tilt position (Winkel)
	attribute: current_tilt_position
	type: custom:multiple-entity-row
	state_header: Winkel
	unit: '%'
	name: Jalousie Sofa
	icon: mdi:information-outline
	tap_action: # -> i don't want a tap action!
	  action: none
	entities:
	  - entity: cover.jalousie_sofa # Use the KNX Object for status purpose (Open->closing->closed)
		name: Status
	  - entity: cover.jalousie_sofa_inverted # Here i use the inverted helper for the current_position of my cover.
		name: Auf/Ab
		unit: '%'
		attribute: current_position

# That's the KNX Object		
  - entity: cover.jalousie_sofa
	name: Komplett Auf/Ab
	icon: mdi:window-shutter

# That's the slider (inverted) for steering the position	
  - type: custom:slider-entity-row
	entity: cover.jalousie_sofa_inverted
	attribute: position
	full_row: false
	hide_state: true
	icon: mdi:window-shutter
	name: Schrittweise

# That's the KNX object for steering the tilt positon of the cover	
  - type: custom:slider-entity-row
	entity: cover.jalousie_sofa
	icon: mdi:angle-acute
	attribute: tilt
	hide_state: true
	name: Winkel

That’s it. Now you get a good working cover steering :slight_smile: If you still have question, just ask :slight_smile:

Here some gifs:

10-04-2022_14-33-28

10-04-2022_14-36-17

3 Likes

Here’s a question: How does it behave when triggered from other integrations like Alexa or HomeKit through HA? When you call “Cover to 25%” or “Close Cover”?

sorry that i have not yet tested. I will try this asap

1 Like