Error with "LEGACY_SYNTAX" for Template Cover Configuration in configuration.yaml

Hi everyone,

I’m fairly new to Home Assistant and don’t have much coding experience. I’ve been trying to create a custom cover with a 75% limit for opening using some help from AI, but I’m getting an error related to the following services:

  • service: cover.set_cover_position
  • service: cover.close_cover
  • `service: cover.stop_cover

The error I get is:
String does not match the pattern of “LEGACY_SYNTAX^”`

I would really appreciate it if someone could explain what’s going wrong and how I can fix it.

Thanks so much in advance!

Here’s the code I’m using:

  - platform: template
    covers:
      fyrtur_limited:
        friendly_name: "Fyrtur (75%)"
        unique_id: fyrtur_limited
        position_template: "{{ state_attr('cover.ikea_of_sweden_fyrtur_block_out_roller_blind', 'current_position') }}"
        open_cover:
          service: cover.set_cover_position
          data:
            entity_id: cover.ikea_of_sweden_fyrtur_block_out_roller_blind
            position: 75
        close_cover:
          service: cover.close_cover
          data:
            entity_id: cover.ikea_of_sweden_fyrtur_block_out_roller_blind
        stop_cover:
          service: cover.stop_cover
          data:
            entity_id: cover.ikea_of_sweden_fyrtur_block_out_roller_blind```

Hello ctrlvv,

This is not an error, it is a warning.
It is not causing anything to fail.

Search this forum for more information on how to affect your specific syntax if you would like to update your stuff to the current format and eliminate the warning in your code.

1 Like

Okay, thanks. I searched around a bit about “LEGACY_SYNTAX^” and found that I just needed to change service: to action:.

It was silly of me to be so focused on thinking the whole code was wrong and starting a completely new thread, instead of searching for “LEGACY_SYNTAX^” first.

As I said, though, it’s a warning and there is no plan to turn off the legacy style, so change at your leisure.

This could help you as well.

1 Like