Try to make a template of type 'cover'

Hi,
whats worng here? Test is ok, but syntax is wrong?

Thanks for helping out

Tht one looks ok to me. Are there any more templates defined below?

no

But can’t find any relevant samples to show how to set up a temlate cover. The documentation includeed isn’t very elpful.

What do you want the template cover to do? You already seem to have a cover entity to get the state from? The template can for instance used to create a cover from e.g. switch entities and sensors to detect end states. What do you have in Home Assistant that you want to look like, and control like it is a cover?

I get the same if you only put that line in, look right at the bottom of the dialog and it says it needs more


Adding an action:

I have a roof window plus blindes and the both shouldn’t collide, if possible.

Yes, found out that you get error messages during typing … ok, this isn’t reeally an errpr, because work isn’t done so far. Ok, accepted

Now I havee the probleem to set the position. I only want to hand it over, no changes for now. Docu says its calles ‘position’, but no idea how to note it down in yaml, tried lot of syntax, nothing works.

data:
      position:  {{ position }}

Didn't work, for example

You’re missing quotes around the template.

data:
      position:  "{{ position }}"

You can’t pull the position out of thin air, you need to tell it what to get the position from. Below is an adapted version of a cover of mine. I may have made some typo’s simplyfying it for you, but this is what it could look like. You can use the GUI to build something similar but then you need to remove the outer quotes from the templates.

- cover:
    - name: "Rechter keukengordijn"
      device_class: shade
      state: "{{ states('cover.onveilig_kkgordijn_rechts') }}"
      position: "{{ state_attr('cover.onveilig_kkgordijn_rechts', 'current_position') | int(0) }}"
      availability: "{{ has_value('cover.onveilig_kkgordijn_rechts') }}"
      open_cover:
        - if:
          - condition: state
            entity_id: binary_sensor.openclose_11
            state: 'off'
          then:
          - action: cover.open_cover
            target:
              entity_id: cover.onveilig_kkgordijn_rechts
          action: script.open_keukengordijn_rechts
      close_cover:
        - if:
          - condition: state
            entity_id: binary_sensor.openclose_11
            state: 'off'
          then:
          - action: cover.close_cover
            target:
              entity_id: cover.onveilig_kkgordijn_rechts
      stop_cover:
        - action: cover.stop_cover
          target:
            entity_id: cover.onveilig_kkgordijn_rechts

Oh, yes, now it works

Where is the yaml code of this templates stored?, have seven window/cover combinations and with the UI tool which produces phantom errors, it is tedious ,

UI does not store yaml.

Oh my god. So no chance to get this template working.
Problem:
I managed to have one, but with endleess ckicking, now as I know the result I want a second but get the error:

And I do EXACTLY the same as before.
I also get this errors at my first try, but after some clicking it works magically.
Is there another way to create a cover template?

Covers require an open and a close action. That’s non-negotiable with cover entities. You are not providing them.

What are you even trying to do? You’re taking an existing cover entity and making it into another cover? That seems odd.

No!
My roof window has a blind (outside). When I open the roof window (electrically) and the blind is down … collision. Same when I close the blind and window is open.
It make sense to have templates!!
This is the only way I find to intersept commands and inject the appropriate precoutions.

Ok then, you need to provide the minimum to make a working cover:

  1. name
  2. state
  3. open_cover
  4. close_cover

If you need to have postion, then you also need to include a position template and set position

You can create them either in the UI or yaml. The UI as said does not crete yaml. Mine was made in yaml because I use features not available in the UI (that I stripped out to simplify the example).

Thanks. Is there a chance to do such things with a blueprint?

There are also template blueprints, but these do not have GUI support yet. So configuration still needs to be done in YAML.