With Esphome I always get errors

with Esphome I always get errors here, maybe someone can help

INFO Reading configuration /config/esphome/chickendoor.yaml...
Failed config

cover.template: [source /config/esphome/chickendoor.yaml:49]
  platform: template
  name: Cover
  id: my_cover
  
  [open_position] is an invalid option for [cover.template]. Did you mean [open_action], [has_position]?
  open_position: 100 [source /config/esphome/chickendoor.yaml:52]
  
  [close_position] is an invalid option for [cover.template]. Did you mean [has_position], [close_action]?
  close_position: 0 [source /config/esphome/chickendoor.yaml:53]
  
  [current_position] is an invalid option for [cover.template]. Did you mean [has_position]?
  current_position:  [source /config/esphome/chickendoor.yaml:55]
    - condition: state
      entity_id: reed_switch
      state: off
      position: 0
    - position: 100
  
  [open_cover] is an invalid option for [cover.template]. Did you mean [open_action], [on_closed]?
  open_cover:  [source /config/esphome/chickendoor.yaml:61]
    - switch.turn_on: open_cover
  
  [close_cover] is an invalid option for [cover.template]. Did you mean [close_action], [discovery]?
  close_cover:  [source /config/esphome/chickendoor.yaml:63]
    - switch.turn_on: close_cover
  
  [stop_cover] is an invalid option for [cover.template]. Did you mean [stop_action], [discovery]?
  stop_cover:  [source /config/esphome/chickendoor.yaml:65]
    - switch.turn_off: open_cover
    - switch.turn_off: close_cover
  
  [set_cover_position] is an invalid option for [cover.template]. Did you mean [has_position]?
  set_cover_position:  [source /config/esphome/chickendoor.yaml:68]
    - service: cover.set_cover_position
      data: 
        entity_id: my_cover
        position: 
          - condition: state
            entity_id: reed_switch
            state: off
            position: 0
          - position: 100
binary_sensor:
  - platform: gpio
    pin: GPIO12
    name: "Chicken Door Reed Switch"
    id: reed_switch

switch:
  - platform: gpio
    pin: GPIO4
    interlock: &interlock [open_cover, close_cover]
    id: open_cover
  - platform: gpio
    pin: GPIO5
    interlock: *interlock
    id: close_cover

cover:
  - platform: template
    name: "Cover"
    id: my_cover
    open_position: 100
    close_position: 0
    current_position:
      - condition: state
        entity_id: reed_switch
        state: "off"
        position: 0
      - position: 100
    open_cover:
      - switch.turn_on: open_cover
    close_cover:
      - switch.turn_on: close_cover
    stop_cover:
      - switch.turn_off: open_cover
      - switch.turn_off: close_cover
    set_cover_position:
      - service: cover.set_cover_position
        data:
          entity_id: my_cover
          position:
            - condition: state
              entity_id: reed_switch
              state: "off"
              position: 0
            - position: 100

Probably not as you missed to post the errors here :wink:

2 Likes

Probably because this is rubbish YAML as far as ESPHome is concerned?

You are mixing Home Assistant service calls with ESPHome YAML.

Did you possibly get this code from GhatGPT - it looks like the type of error it makes…

2 Likes

These are also invalid.

Use close_action:, open_action:, stop_action: