Esp32 with two different sensors

Hi! I’m trying to get my first sensors in esphome and I’m feeling a bit stupid. Can I have two different sensors on same esp? In my situation it would be dht and soil moisture sensor. What I’m trying:

sensor:
  platform: adc
  name: "Soil"
  pin: 32
 ...

sensor:
  platform: dht
  ...

But the syntax check says error as there is duplicate key: “sensor”. Is this impossible to do or am I doing something wrong?

1 Like

You can only have one sensor: block, but you can list as many sensors as you want under it (until you run out of flash memory or RAM):

sensor:
  - platform: adc
    name: "Soil"
    pin: 32
    ...

  - platform: dht
    ...
1 Like

Oh I see. Thank you for the fast reply :slight_smile: