ESP32 and DHT11 - only humidity visible

Hi, all
I am a total beginner with HA and ESP. I have successfully flashed ESPhome to ESP32 and connected DHT11 sensor.
Here is my yaml.

  name: "yo-temp-humid"

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
 password: "smth"
ota:
 password: "smth"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-B82380"
    password: "WPUdiLtGi4IG"

captive_portal:
    
    
sensor:
  - platform: dht
    pin: GPIO2
    model: dht11
    temperature:
      name: "office"
    humidity:
      name: "office"
    update_interval: 30s

Here is the log output:
[10:28:20][D][dht:048]: Got Temperature=25.5°C Humidity=52.0%
[10:28:20][D][sensor:127]: ‘office’: Sending state 25.50000 °C with 1 decimals of accuracy
[10:28:20][D][sensor:127]: ‘office’: Sending state 52.00000 % with 0 decimals of accuracy

In the settings under integrations I can see 1 device and 1 entity

Only one sensor is visible - Humidity

What should I do to have both - Temperature and humidity?
Thanks

1 Like

You have only named one entity. (I would have expected an error here).

    temperature:
      name: "office temperature"
    humidity:
      name: "office humidity"

Yes, that was exactly the issue.
Thank you!