Wycofanie starszego szablonu cover

Wycofanie starszego szablonu cover

Ostrzeżenie · Zgłoszone przez Template

Ten element przestanie działać w wersji 2026.6. Napraw problem przed aktualizacją.

The legacy platform: template syntax for cover is being removed. Please migrate roleta_salon_okno to the modern template syntax.

Step 1 - Remove legacy configuration

Remove the roleta_salon_okno template definition from the configuration.yaml cover: section.

Note: If you are using cover: !include <filename>.yaml in configuration.yaml, remove the cover definition from the included <filename>.yaml.

Step 2 - Add the modern configuration

Add new template definition inside configuration.yaml:

template:
- cover:
  - open_cover:
    - entity_id:
      - switch.roleta2gora
      action: homeassistant.turn_on
    close_cover:
    - entity_id:
      - switch.roleta2dol
      action: homeassistant.turn_on
    stop_cover:
    - entity_id:
      - switch.roleta2stop
      action: homeassistant.turn_on
    default_entity_id: cover.roleta_salon_okno
    name: Okno Wysokie
    

Note: If there are any existing template: sections in your configuration, make sure to omit the template: line from the yaml above. There can only be 1 template: section in configuration.yaml. Also, ensure the indentation is aligned with the existing entities within the template: section.

Step 3 - Restart Home Assistant or reload template entities

Nie potrafie niestety dodać wiecej niż jednej rolety w configuration.yaml jak dam jedną to jest ok, jak chce dodać kolejne to pokazuje nastepujący błąd,

bad indentation of a sequence entry (250:3)

247 | name: Balkon1
248 |
249 | - cover:
250 | - open_cover:
---------^
251 | - entity_id:

Jak to ogarnąć najprościej, niestety nie jestem biegły w tym temacie?

template:
 - cover:
   - open_cover:
     - entity_id:
       - switch.roleta3gora
       action: homeassistant.turn_on
     close_cover:
     - entity_id:
       - switch.roleta3dol
       action: homeassistant.turn_on
     stop_cover:
     - entity_id:
       - switch.roleta3stop
       action: homeassistant.turn_on
     default_entity_id: cover.roleta_salon_balkon
     name: Balkon1 

 - cover:
  -  open_cover:
     - entity_id:
       - switch.roleta2gora
       action: homeassistant.turn_on
     close_cover:
     - entity_id:
       - switch.roleta2dol
       action: homeassistant.turn_on
     stop_cover:
     - entity_id:
       - switch.roleta2stop
       action: homeassistant.turn_on
     default_entity_id: cover.roleta_salon_okno
     name: Okno Wysokie

wszystkie encje template (cover, sensor, switch itd.) definiuje się jako listę pod kluczem template:.
Każda encja cover zaczyna się od - cover:(myślnik + spacja + cover + dwukropek).

template: → występje tylko raz w całym pliku.
pod nim jest lista → więckażda encja zaczyna się od -
- cover: → zaczyna definicję jednej rolety
wszystkie klucze wewnątrz jednej rolety (open_cover, close_cover, stop_cover, name, defaul_entity_id) muszą mieć takie sao wcięcie (najczęściej 6 spacji od lewej krawędzi, jeśli template: jest na poziomie 0)
listy akcji (np. - entity_id: …) są wcięte o 2 poziomy głębiej niż klucz open_cover: itd.

Jeśli masz już inne encje template (np. sensory, switche, binarysensor), po prostu doklej kolejne - cover: … na tym samym poziomie co istniejące - sensor:, - binary_sensor: itd.

Dla jakiś prostych konfiguracji możesz użyć → https://community.home-assistant.io/t/deprecation-of-legacy-template-entities-in-2025-12/955562

Dodajesz repo do HACS https://github.com/Petro31/hass-migrate-template
1.Instalujesz Legacy Template Migration Helper
2.Restart HA.
3. Wchodzisz w Urządzenia oraz usługi → dodajesz integrację Legacy Template Migration Helper

  1. Wchodzisz do Narzędzia deweloperskie → Akcje wpisujesz

Wszystkie stare formaty zostaną przetworzone na nowy format jako kopie utworzone w katalogu
\config\ migrated_templates Oryginalne pliki nie zostaną nadpisane.