Need help with *master* cover switch using cover template

Hi, I’m trying to create a “master” cover to be able to shut all of the blinds in the kids room.

The following is my code in configuration.yaml:

cover:
  - platform: template
    covers:
      kids_rooms:
        friendly_name: \u05ea\u05e8\u05d9\u05e1\u05d9\u05dd \u05d7\u05d3\u05e8\u05d9 \u05d9\u05dc\u05d3\u05d9\u05dd
        position_template: "{{ (cover.cover_ephraim_north_48 + cover.cover_ephraim_west_47 + cover.cover_reut_west_34 + cover.cover_shira_north_35 + cover.cover_naama_west_26) // 5 }}"
        set_cover_position:
            service: cover.set_cover_position
            entity_id:
              - cover.cover_ephraim_north_48
              - cover.cover_ephraim_west_47
              - cover.cover_reut_west_34
              - cover.cover_shira_north_35
              - cover.cover_naama_west_26
          open_cover:
             service: cover.open_cover
             entity_id:
               - cover.cover_ephraim_north_48
               - cover.cover_ephraim_west_47
               - cover.cover_reut_west_34
               - cover.cover_shira_north_35
               - cover.cover_naama_west_26
         close_cover:
            service: cover.close_cover
            entity_id:
              - cover.cover_ephraim_north_48
              - cover.cover_ephraim_west_47
              - cover.cover_reut_west_34
              - cover.cover_shira_north_35
              - cover.cover_naama_west_26
         stop_cover:
            service: cover.stop_cover
            entity_id:
              - cover.cover_ephraim_north_48
              - cover.cover_ephraim_west_47
              - cover.cover_reut_west_34
              - cover.cover_shira_north_35
              - cover.cover_naama_west_26

But I’m getting the following error:

 Jul 06 13:59:31 automaty hass[19696]: 2017-07-06 13:59:31 ERROR (MainThread) [homeassistant.components.cover.template] UndefinedError: 'cover' is undefined

Also, if there are any idea’s on how to shorten the code, it would be appreciated.

Thanks,

Tsvi

Can you call it cover when the service is called cover? Same thing with open_cover, close, set_position and stop?

Ok so the issue is with the template, as we’re setting up the covers we can’t request the value of other covers in the meantime.

I’m trying to find a smart way to either get around it, or maybe this should be considered a bug?

In the meantime I set the value to 50 so I can use the buttons, but I’d eventually like to put a few ‘master’ switches which would also reflect the current status

So the issue is somewhere else:

    position_template: "{{ (cover.cover_ephraim_north_48 + cover.cover_ephraim_west_47 + cover.cover_reut_west_34 + cover.cover_shira_north_35 + cover.cover_naama_west_26) // 5 }}"

This had to be changed. You can’t call cover directly, rather you call states.cover.my_cover.attributes.current_possition.

I’m still looking for a way to shorten the duplication of the entity_id’s.

Thanks,

Tsvi