Two DHT11 on one ESP32 ESPHOME -Hassio

Hello.

First post, and im sorry to say im not familiar wtih everything byt im trying to get my head around.
And yes… ive done a few gooogle searches before posting… but might not have hit the correct string.
i appologise if there is a post somewhere about this.

im running Home Assistant 0.106.6

My trouble is running two DHT22 (AM2302) on a single ESP32
They show up in log, but home assstant doesnt show temp.
ESPhome log:
[11:05:51][D][dht:048]: Got Temperature=22.5°C Humidity=32.6%
[11:05:51][D][sensor:092]: ‘buddy hot’: Sending state 22.50000 °C with 1 decimals of accuracy
[11:05:51][D][sensor:092]: ‘buddy hot’: Sending state 32.60000 % with 0 decimals of accuracy
[11:05:57][D][dht:048]: Got Temperature=24.1°C Humidity=30.2%
[11:05:57][D][sensor:092]: ‘buddy cold’: Sending state 24.10000 °C with 1 decimals of accuracy
[11:05:57][D][sensor:092]: ‘buddy cold’: Sending state 30.20000 % with 0 decimals of accuracy
so they are giving readings.
Homeassistant does display the humidity from both sensors, but not temp
in configration->entities it warns with no uniqe ID so i guess thats where my trouble is…
my Config file looks like this: (ive tried to give them ID)
sensor:

  • platform: dht
    model: AM2302
    pin: 4
    temperature:
    name: “buddy hot”
    humidity:
    name: “buddy hot”
    id: buddyhot
    update_interval: 60s
  • platform: dht
    model: AM2302
    pin: 5
    temperature:
    name: “buddy cold”
    humidity:
    name: “buddy cold”
    id: buddycold
    update_interval: 60s

Still no luck… ive tried the basic “sketch” without ID and the humidity shows on dashboard, but not temp.

why does the humidity on the sensors show in the overview? and not the temp?
Is there a quick fix for this?

Please format your code. You are using the same name for both temperature and humidity for each device. This is what is used to create entity_id in home assistant. Try changing them to "buddy hot temperature" and so on.

1 Like

thank you…
but why did the humidity show/print in dashboard?
And i tried to give different id to separate the different sensors…
(asking since im curious)

but got the temp up in homeassistant now…

The id is internal to esphome, the name is used in home assistant.

1 Like