Template cover - need to show open & close buttons always, regardless of position

I’ve created a template sensor for my garage door (shutter), as there are multiple ways to open it so I needed a separate position sensor to get the correct position. It works well, except in two situations: (1) sensor battery is dead, so no position updates and (2) door is stopped partly open.

The problem I’m finding, is that in (1), the sensor’s last state is ‘closed’, so the UI widget disables the ‘close’ button and I cannot close the door even if in reality, it’s been opened by another control. In (2), I can’t fully open a part-open door without first closing it because the UI widget thinks it’s already open.

Can anyone suggest a way to make that UI widget keep both the open and close buttons enabled always?

Thanks!

I don’t know if you can solve the issues via the built-in controls but there is a custom plugin that I have that should be able to do what you want.

the buttona re disabled by default once the cover is in the called position but there is an option you can set to prevent disabling the buttons.

all the info for the various options is in the readme.

Thanks @finity ; if I don’t find a way with the default control, I’ll take a look at that :slight_smile:

And if you like the way that control looks I have a whole suite of plugins at the same github repo that control different types of entities so you can keep pretty much the whole front end controls similar and have a consistent themeing to the buttons.

1 Like

Did you ever find a way to keep both open and close buttons ‘on’? I have just come across exactly the same issue as you after fitting a new garage door with 3 buttons instead of the old one with just one button. I kind believe what a complete pain it is.

I think i found an answer.

I have a blind control hardware, modified with a sonoff (eWeLink) smart 3 gang DC relay (open, close, stop) using inching of 0.5secs to simulate a human button press.
Unfortunately have not yet incorporated any sensors to understand state or position.
And configured a cover template for it.

I found that a cover.template defined in configuration.yaml. without a value_template or position_template defined, will default to optimistic: true in calculating the state and position of the cover.
This means it may hold a state of open or closed (position 100 or 0) even when it was stopped or interrupted or otherwise doesn’t really know for sure that’s the case.

Ref here for more info: Template cover - Home Assistant

The solution for me is to set:
optimistic: false

The state of the cover (in my case a blind) is then: Unknown

This means the buttons in the UI for the cover are always available.

It looks like some clever folks have developed some timed covers in HACS i might try calculate position and state while also leaving buttons available. Or probably better to use some reed switch sensors to determine position. But for me this is more a ‘nice to have’. I just want to be able to control my blinds!

Hope that helps!