Add a delay between each descent

Hello,
I created a simple map so that I could lower all my shutters at the same time. The problem is that when I switch on the button, all the shutters don’t go down at the same time. I think I should put a few seconds delay between each action.


type: entities
entities:
  - entity: switch.volet_baie_md
    name: Baie
    icon: mdi:window-shutter-open
  - entity: switch.volet_bureau_md
    name: Bureau
    icon: mdi:window-shutter-open
  - entity: switch.volet_hangar_md
    name: Hangar
    icon: mdi:window-shutter-open
  - entity: switch.volet_garage_md
    name: Garage
    icon: mdi:window-shutter-open
state_color: true
show_header_toggle: true
title: Volets

Is it possible for example to put a - delay: 00:00:00.500
thank you

To do that you’ll need to create a script and run it from a button.

I tried to find examples to guide me, but I couldn’t find! Do you have a lead?

Scripts docs are here.

Button docs are here

Good morning
I just found how to add a delay between each descent of the roller shutter. Here is what I did.
In my configurations.yaml I creat this

switch:
  - platform: template
    switches:
      tousvolets:
        friendly_name: "Tous les volets"
        value_template: "{{ is_state('switch.volet_hangar_md', 'on') }}"
        turn_on:
          - service: switch.turn_on
            target:
              entity_id: switch.volet_hangar_md
          - delay: "00:00:00.500"   
          - service: switch.turn_on
            target:
              entity_id: switch.volet_baie_md
          - delay: "00:00:00.500"    
          - service: switch.turn_on
            target:
              entity_id: switch.volet_bureau_md
          - delay: "00:00:00.500"
          - service: switch.turn_on
            target:
              entity_id: switch.volet_garage_md 
        turn_off:
          - service: switch.turn_off
            target:
              entity_id: switch.volet_hangar_md
          - delay: "00:00:00.500"    
          - service: switch.turn_off
            target:
              entity_id: switch.volet_baie_md
          - delay: "00:00:00.500"    
          - service: switch.turn_off
            target:
              entity_id: switch.volet_bureau_md
          - delay: "00:00:00.500"
          - service: switch.turn_off
            target:
              entity_id: switch.volet_garage_md  
      volethangar:
        friendly_name: "Volet Hangar"
        value_template: "{{ is_state('switch.volet_hangar_md', 'on') }}"
        turn_on:
          service: switch.toggle
          target:
            entity_id: switch.volet_hangar_md
        turn_off:
          service: switch.toggle
          target:
            entity_id: switch.volet_hangar_md
      voletgarage:
        friendly_name: "Volet Garage"
        value_template: "{{ is_state('switch.volet_garage_md', 'on') }}"
        turn_on:
          service: switch.toggle
          target:
            entity_id: switch.volet_garage_md
        turn_off:
          service: switch.toggle
          target:
            entity_id: switch.volet_garage_md
      voletbureau:
        friendly_name: "Volet Bureau"
        value_template: "{{ is_state('switch.volet_bureau_md', 'on') }}"
        turn_on:
          service: switch.toggle
          target:
            entity_id: switch.volet_bureau_md
        turn_off:
          service: switch.toggle
          target:
            entity_id: switch.volet_bureau_md
      voletbaie:
        friendly_name: "Volet Baie"
        value_template: "{{ is_state('switch.volet_baie_md', 'on') }}"
        turn_on:
          service: switch.toggle
          target:
            entity_id: switch.volet_baie_md
        turn_off:
          service: switch.toggle
          target:
            entity_id: switch.volet_baie_md

in my card

type: entities
title: Volets
show_header_toggle: true
entities:
  - entity: switch.tousvolets
  - entity: switch.volethangar
  - entity: switch.voletbaie
  - entity: switch.voletbureau
  - entity: switch.voletgarage
footer:
  type: buttons
  entities:
    - entity: switch.volet_hangar_stop
      show_icon: true
      show_name: true
      name: STOP HANGAR
    - entity: switch.volet_baie_stop
      show_icon: true
      show_name: true
      name: STOP BAIE
    - entity: switch.volet_bureau_stop
      show_icon: true
      show_name: true
      name: STOP BUREAU
    - entity: switch.volet_garage_stop
      show_icon: true
      show_name: true
      name: STOP GARAGE

I would now like to display a different icon when the pane is open or closed. For this, I always added in my configurations.yaml file this



homeassistant:
  customize: !include customize.yaml

and i creat folder customize.yaml

In customize.yaml there are

switch.volethangar:
  friendly_name: Volet Hangar
  templates:
    icon_color: >
      if (state == 'on') return '#ff0000';
      return '#00b300';
    icon: >
      if (state == 'on') return 'mdi:window-shutter-open';
      return 'mdi:window-shutter';

The code is clearly visible here

the problem is that when i wish on the button the image does not change despite the code

Why ?

You might find that adding them all to a group makes them work together. This issue is pretty common with lights as well.

For my test, I only assigned to “switch.volethangar” and not to all switches

Why did Volet Hangar not change at that time? Since he’s the only one allowed to change icons?