Oil Sensor

Having some issues validating this code, any ideas?

esphome:
  name: "oil-tank"
  friendly_name: "oil-tank"
  area: Cottage

esp32:
  board: esp32dev
  framework:
    type: arduino
 
Enable logging
 logger:
 
Enable Home Assistant API
api:
  encryption: 
    key: "AsiJx5ZDIPH5ADjXmF9y2VvXhcy/QALhntpgFODr3yw=" 
ota:
  - platform: esphome
    password: "192068ffe361577643055f4298f63657"
   
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

mdns:
  disabled: False

captive_portal:

 # OPTIONAL WEBSERVER - USEFUL WHEN TESTING. 
 
 web_server:
   port: 80
 
# this section defines how the sensor will work. Read on to see how I improved this.

sensor:
 platform: ultrasonic
 trigger_pin: G15
 echo_pin: G16
 name: "oil level"
 accuracy_decimals: 0
 update_interval: 10s


# battery powered version configuration - read more at ESPHome Deep sleep
deep_sleep:
  run_duration: 10s
  sleep_duration: 60min
    

Looks like your spacing is inconsistent, but that is not what the message is complaining about.

Looks like you missed putting the # to indicate a comment on two of your comments.

1 Like

looks like there is space in front of logger:

That’s the next issue it would complain about.

Change it around a bit now, but still no joy…

esphome:
  
  name: "oil-tank"
  friendly_name: "oil-tank"
  area: Home

esp32:
  board: esp32dev
  framework:
    type: arduino
 
logger:

api:
  encryption: 
    key: "AsiJx5ZDIPH5ADjXmF9y2VvXhcy/QALhntpgFODr3yw=" 
ota:
  - platform: esphome
    password: "192068ffe361577643055f4298f63657"
   
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

captive_portal:
  
mdns:
  disabled: False

 web_server:
   port: 80
 
sensor:
 platform: ultrasonic
 trigger_pin: GPIO15
 echo_pin: GPIO16
 name: "oil used"
 accuracy_decimals: 0
 update_interval: 60s 
 unit_of_measurement: "litre" 
  filters: 
  - lambda: return x * 1053;
  - sliding_window_moving_average: 
    window_size: 20 
    send_every: 10

  – calibrate_linear:#  
  – 110 -> 0
  – 95 -> 204
  – 75 -> 544
  – 55 -> 900
  – 35 -> 1320
  – 15 -> 1660
  – 0 -> 1800

  run_duration: 10s
  sleep_duration: 60min
    

Yep. :sweat_smile:

it’s missing # in front of comment.
Also web_server has space in front
And sensor: options have indentations wrong…

and theese?