ESPHome compiler warning

I have the following configuration in ESPHome and when I compile I get the warning messages:

/config/esphome/bath_drawer.yaml: In lambda function:
/config/esphome/bath_drawer.yaml:101:26: warning: ‘void esphome::cover::Cover::stop()’ is deprecated (declared at src/esphome/components/cover/cover.h:146): stop() is deprecated, use make_call().set_command_stop() instead. [-Wdeprecated-declarations]
id(win_open).stop();
^
/config/esphome/bath_drawer.yaml:104:27: warning: ‘void esphome::cover::Cover::close()’ is deprecated (declared at src/esphome/components/cover/cover.h:140): close() is deprecated, use make_call().set_command_close() instead. [-Wdeprecated-declarations]
id(win_open).close();
^
/config/esphome/bath_drawer.yaml:109:26: warning: ‘void esphome::cover::Cover::stop()’ is deprecated (declared at src/esphome/components/cover/cover.h:146): stop() is deprecated, use make_call().set_command_stop() instead. [-Wdeprecated-declarations]
id(win_open).stop();
^
/config/esphome/bath_drawer.yaml:112:26: warning: ‘void esphome::cover::Cover::open()’ is deprecated (declared at src/esphome/components/cover/cover.h:134): open() is deprecated, use make_call().set_command_open() instead. [-Wdeprecated-declarations]
id(win_open).open();

Can someone assist to correct my config.

esphome:
  name: bath_drawer
  platform: ESP8266
  board: d1_mini

  on_boot:
    then:
      - switch.turn_off: win1
      - switch.turn_off: win2

wifi:
  ssid: "xxxxxxxxx"
  password: "xxxxxxxx"
  ap:
    ssid: "Bath Drawer"
    password: "judy1234"

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

web_server:
  port: 80
    
output:
  - platform: gpio
    id: 'win_1'
    pin: D2
  - platform: gpio
    id: 'win_2'
    pin: D1

switch:
  - platform: output
    name: "win1"
    output: 'win_1'
    id: win1
  
  - platform: output
    name: "win2"
    output: 'win_2'
    id: win2
    
  - platform: restart
    name: "Bath Restart"
    id: restart_bath
    
  - platform: gpio
    name: "Underfloor Heating"
    pin: D7
    inverted: True



cover:
  - platform: template
    name: "drawer Control"
    id: win_open
    optimistic: true
    assumed_state: true
    open_action:
      - switch.turn_off: win2
      - switch.turn_on: win1
      - delay: 14s
      - switch.turn_off: win1
    close_action:
      - switch.turn_off: win1
      - switch.turn_on: win2
      - delay: 14s
      - switch.turn_off: win2
    stop_action:
      - switch.turn_off: win1
      - switch.turn_off: win2
      
binary_sensor:
  - platform: gpio
    pin: RX
    name: "Limit Switch"
    device_class: door
    on_release:
      then:
        - switch.turn_off: win2
        - switch.turn_off: win1
        
  - platform: gpio
    pin: D5
    name: "drawer Control Button"
    filters:
      - invert:
      - delayed_on_off: 50ms
    on_press: 
      then:
        - lambda: |
            if (id(win_open).position == cover::COVER_OPEN) {
              if (id(win1).state){
                // drawer is opening
                id(win_open).stop();
              } else {
                // drawer is open and not moving
                id(win_open).close();
              }
            } else {
              if (id(win2).state){
                // drawer is closing
                id(win_open).stop();
              } else {
                // win is closed and not moving
                id(win_open).open();
              }
            }

dallas:
  - pin: GPIO2

sensor:
  - platform: dallas
    address: 0x9203139779F68228
    name: "Bathroom Floor" 
    
  - platform: wifi_signal
    name: "Bath Drawer RSSI"
    update_interval: 120s

That is not something you can fix by adjusting your config. Please report it here:

It’s only a warning (for now) your cover should continue to function as expected.

1 Like

Hi, Yes its working at the moment, but I’m concerned that after an upgrade at some point it will break.

Yes it will. Which is why you have to report it so that it gets put on the to do list of things to fix.

Reported it…

1 Like