ESPHome Action light.turn_on

Compiler error “unable to find light.turn_on action”, using ESPHome Builder in HA suggests this action but apparently the compiler didn’t get the email.

esphome:
  name: hw-recirc-new
  friendly_name: HW-Recirc_new
  on_boot:
    priority: -10
    then:
      - light.turn_on: blue-led

Post all your yaml, not just a snippet. The actual cause of the error may be elsewhere.

Seems unlikely as this only occurs when the on_boot construct is in the code.

esphome:
  name: hw-recirc-new
  friendly_name: HW-Recirc_new
  on_boot:
    priority: -10
    then:
      - light.turn_on: blue-led


esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "RSvxeJksnimh4Wze9hJN5usAobtoQ2UxTue2m88bEdI="

ota:
  - platform: esphome
    password: "350558855464be28c05f4a477d43ba56"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Hw-Recirc-New Fallback Hotspot"
    password: "tfwaspTGbRJh"

captive_portal:

Where is the yaml for the light you are trying to turn on? You will need that before trying to call any action on it.

It seems you were correct. Another case where the compiler reports an error incorrectly. I have copied the original code, replacing the incompatible platform: esphome construct with the esp8266: platform, moved the on_boot to within the primary esphome: code, corrected the dallas sensor platform code. That now compiles correctly.
Thanks for the help.

I want to turn 2 lights on instead of 1 …

          - light.turn_on: 
              id: gangkeuken
              id: gangslaapkamer
              brightness: 1.0

when compiling it gives an error … Duplicate key “id”

what am I doing wrong ?
is there another way ?

Thanks

Start a new topic, post your full yaml - tacking onto the end of a solved topic won’t get you too many answers.

1 Like

Look at the documentation, it teaches you how to use these things like Light, Sensors, etc.