Cover template last state after reboot

Hello everyone!

I was wondering if someone could help with this “not so problematic” problem :slight_smile:

After I reboot Home Assistant, all devices restores the previous states correctly but my three template covers. Does this happens to you? I had to create a startup automation to send a close_cover command, if not, my garage doors are always shown as opened after reboot.

Here are my configuration:

- platform: template
  covers:

## Window cover

    persiana_suite:
      friendly_name: "Persiana da suíte"
      open_cover:
        service: script.persiana_suite_abrir
      close_cover:
        service: script.persiana_suite_fechar
      stop_cover:
        service: script.persiana_suite_parar

## Garage door

    garagem_casa:
      friendly_name: "Garagem de casa"
      optimistic: true
      open_cover:
        service: script.garagem_casa_abrir
      close_cover:
        service: script.garagem_casa_fechar

They all work great anyways…

Thanks!

Hi, did you manage to resolve this? optimistic: true does noet work in my case

Hello sir! I have this working for quite a while now. Here an example of a custom template cover working 100%:

cover.yaml

- platform: template
  covers:
    persiana_suite:
      value_template: "{{ is_state('input_boolean.persiana_suite', 'on') }}"
      entity_id: input_boolean.persiana_suite
      friendly_name: "Persiana da suíte"
      open_cover:
        service: script.persiana_suite_abrir
      close_cover:
        service: script.persiana_suite_fechar
      stop_cover:
        service: script.persiana_suite_parar

input_boolean.yaml

persiana_suite:
  name: "Estado persiana da suíte"

script.yaml

# Broadlink

persiana_suite_abrir:
  sequence:
  - service: broadlink.send
    data:
      host: 192.168.20.30
      packet: sgGEAwwXDBcMFwwXGAwLGAsYDBcMFxgLDBcMGBcMCxgMFxgLDBcYCwwXDBcMGAsYFwwMFxgLDBcMFwwXGAwLGAwXDBcYCwwXDBcMGBcMnTEYDBcMFwwMFwwXDBcMFxgMCxgLFwwYCxgYCwwXDBcYDAsXDBgXDAwXGAsMFwwXDBcMFxgMCxgXDAwXDBcMFxgMCxgLGAwXGAsMFwwXDBcY/Z0xGAsYCxgLDBcMGAsYDBcYCwwXDBcMFwwXGAwLGAsYFwwMFwwXGAsMFxgMCxgMFwwXDBcYCwwXGAsMGAsYCxgXDAwXDBcMFxgLDBgLGAwXGAydMRgLGAsYCwwXDBcMFwwXGAwMFwwXDBcMFxgMCxcMFxgMDBcMFxgLDBcYCwwYCxcMGAwXGAsMFxgLDBcMGAsYFwwMFwwXDBcYCwwYCxcMGBf9nTEYDBcMFwwMFwwXDBcMFxgLDBgLGAsYCxgXDAwXDBcYCwwYCxgXDAwXGAsMFwwXDBcMGBcMCxgXDAwXDBcMFxgMCxgLGAwXGAsMFwwXDBcYDJ0xGAsYCxgMCxgMFwwXDBcYCwwXDBcMFwwXGAwLGAwXGAsMFwwYFwwLGBcMDBcMFwwXDBcYCwwXGAsMGAwXDBcYCwwXDBgLGBcMCxgMFwwXGP2dMRgLGAsYCwwXDBcMFwwXGAwMFwwXDBcMFxgLDBcMFxgMCxgMFxgLDBcYDAsXDBgLGAwXGAsMFxgLDBcMGAsYFwwMFwwXDBcYCwwXDBgLGBcMnTIXDBcMGAsMFwwXDBcMFxgMCxgMFwwXDBcYCwwXDBcYDAsYCxgXDAwXGAsMFwwXDBgLGBcMDBcYCwwXDBcMFxgMCxcNFwwXGAsMFwwXDBcYDZ0xGAsYCxgLDBcMFwwYCxgYCwwXDBcMFwwYFwsMGAsYFwwMFwwXGAsMFxgLDBcMGAwXDBcYCwwYFwwLFwwYDBcXDAwXDBcMFxgMFwsYDBgLDAABB50xGAsYDBcMCxgMFwwXDBcYCwwXDBcMGAsXGAwLGAsYGAsMFwwXGAwLGBcMDBcMFwwXDBcYCwwXGAwLGAsYDBcYCwwXDBgLGBcMFwwYCxgLDAABB50xGAwXDBcMDBcMFwwXDBcYCwwYCxgLGAwXGAsMFwwXGAsMFwwYFwwMFxcMDBcMFwwXDBgXDAwXFwwMFwwXDBcYCwwYCxgLGBcMGAsYCxgLDAAF3AAAAAA==
  - service: input_boolean.turn_on
    entity_id: input_boolean.persiana_suite
  - delay: '00:00:03'
  alias: "Persiana abrir"

persiana_suite_fechar:
  sequence:
  - service: broadlink.send
    data:
      host: 192.168.20.30
      packet: sgGEAwsYDBcMFwwXGAsMFwwYCxgLGBcMDBcMFxgLDBcMFxgMCxgYC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CxgLGAsYDAsYCwABCJ0xGAsYCxgLDBcMGAsYCxgXDAwXDBcMFwwXGAwLFwwYFwwMFwwXGAsMFxgLDBgLGAsYDBcYCwwXGAsMFwwXDBgXDAwXDBcYCxgLGAwXDAsYDAAF3AAAAAA==
  - service: input_boolean.turn_off
    entity_id: input_boolean.persiana_suite
  - delay: '00:00:03'
  alias: "Persiana fechar"

persiana_suite_parar:
  sequence:
  - service: broadlink.send
    data:
      host: 192.168.20.30
      packet: sgH2ABgMFwwXDAwXDBcMFwwYFwsMFwwYCxgLGBcMDBcMFxgLDBcMGBcLDBgXDAwXDBcMFwwXGAsMFxgLDBgLGAwXFwwMFxgLDBcYCwwXGAwLGBcMnTIXDBgLGAsMFwwXDBcMFxgMCxgMFwwXDBcYCwwXDBcYDAsXDBcYDAsYGAsMFwwXDBcMFxgMCxcYDAwXDBcMFxgLDBcYDAsXGAsMGBcMDBcYC54xFwwYCxgLDBcMFwwXDBcYDAsYDBcMFwwXGAsMFwwXGAwLGAsYGAsMFxgLDBcMFwwXDBgXDAsYFwwMFwwXDBcYDAsYFwsMGBcMDBcYCwwXGAAF3AAA==
  - delay: '00:00:03'
  alias: "Persiana parar"

Be sure to include the above entities on the recorder settings so it can restore the previous state after a reboot.

Hope it helps.

1 Like

thnx, I will give it try :+1:

1 Like

Done, 100% success :grinning: thnx again

1 Like

Amazing! I’m glad I could help. Cheers!