Cover Template, Cannot figure how to have state working

Hi all,
I have something very basic I thought, but despite all my reading I cannot figure it out :frowning:
Situation:
HA version 0.113.3 (I have other issues with 0.114, so stay on 113 for now…)
I want to use Cover for shades switch:
I have there:
A command to send for start, stop, pause based on rfxcom service (and this is working fine)
A sensor on the curtain to tell me when it is closed or open… Xiaomi door and window sensor, also working great
I put all together like this:

- platform: template
  covers:
    curtain_gf_back_right:
      device_class: shade
      friendly_name: "Curtain Back Right"
      value_template: "{{is_state('binary_sensor.door_window_sensor_158d00025193e7', 'on')}}"
      open_cover:
        service: rfxtrx.send
        data:
          event: 0A14051800010401030000
      close_cover:
        service: rfxtrx.send
        data:
          event: 0A14051700010401020000
      stop_cover:
        service: rfxtrx.send
        data:
          event: 0A14051800010401030000

And I get that all the time:


ie Down never enabled, but pause and down working fine…
Of course I tried to set true or false directly to see if their is any issue with my command -> same result
I also tried to set position_template: 50 or position_template: "50" or position_template: {{ 50 }} -> always the same result !

Also I noticed that whatever I do, I always see this in dev screen -> states on my cover:

friendly_name: Curtain Back Right
supported_features: 11
device_class: shade

Please tell me I m not crazy and something else is wrong with my setup ? :frowning:

Thanks in advance by the way :slight_smile:

Your configuration looks good.

You need to watch the sate of binary_sensor.door_window_sensor_158d00025193e7 and confirm that it changes when the cover is open/closed.

You can use the developer tools template editor to monitor:

{{is_state(‘binary_sensor.door_window_sensor_158d00025193e7’, ‘on’)}}

But you will have to hit enter in the edit box for it to update.

Or you can look at the developer tools states menu which will update in real time.

Does it go to sleep and become unavailable?

Thanks a lot for your very fast answer !
As far as I can see, my sensor is working as expected and changes state…

But to rule that out, I replaced the value_template by a fixed position_template: 50 Which gives me the exact same result :frowning:
Just it case it can matter, I am using only the Core version of HA, inside a docker container…

What if you replace the value template with: '{{ false }}'

Does the cove change to closed?

Hi again,

Just tried it with value_template: "{{ false }}" and I get the same result :frowning: curtain is Open and Up button grayed out…
Is there some prerequisite of using Cover templates I might have missed ?

Nope. Post you’re cover config as it is now and I’ll have another look.

There may actually be an issue with the template cover. See Combine two entity for homekit bridge

Ok thanks.
I created an Issue: https://github.com/home-assistant/core/issues/38865