Cover template

Hi,

I try to configure cover template but its not working. In log file I have this:
2017-07-03 10:37:00 ERROR (MainThread) [homeassistant.components.cover.template] No covers added

My configuration:

configuration.yaml

cover:
  - platform: template
    covers:
      cover_roleta_kuchnia:
        friendly_name: 'Kuchnia'
        open_cover:
          service: homeassistant.turn_on
          entity_id: switch.kuchnia_up
        close_cover:
          service: homeassistant.turn_on
          entity_id: switch.kuchnia_down
        stop_cover:
          service: homeassistant.turn_off
          entity_id: switch.kuchnia_down

According to the documentation , either a value_template or position_template must be supplied.

Try it like this:

cover_roleta_kuchnia:
  friendly_name: 'Kuchnia'
  value_template: "{{is_state('switch.kuchinia_up', 'on')}}"
  open_cover:
    service: homeassistant.turn_on
    entity_id: switch.kuchnia_up
  close_cover:
    service: homeassistant.turn_on
    entity_id: switch.kuchnia_down
  stop_cover:
    service: homeassistant.turn_off
    entity_id: switch.kuchnia_down

Ok it is working. But I do not need the state of the cover. How can I configure this without taking state cover into account? I’m using relays to control my blinds so I cant check position of my blinds.

thank you. It made the cover work for me too.

Is there a way to setup a timer to enable the use of the position slider. For instance, if we know the opening and closing time of the cover, we can use that information and the initial position information to set any position we want.

Covers use state to determine what functions are available. If it’s up, the down button is active. If it’s down, the up button is active. It also uses state to determine what icon to show.
You could set the state to a fixed value I suppose, but you lose much of the functionality of the cover. You would be just as well off to add an input_boolean to control your cover.

OK. I set fixed position_template: “50” . And its works. Thanks for help :slight_smile:

1 Like

It also occurs to me that you could call a script that does two things.

  1. calls the switch.turn-on service to open your blinds
  2. sets an input_boolean to the on state that represents the state of your blinds.

This should work reasonably well, but will have a problem on startup where the state might not match the existing state.

is possible see your configuration?don’t work for me