Hi guys,
i’m heaving trouble using my AM2301 temperature Sensor on my esp8266MOD. I’m sitting in my office and get the following readings:
[20:30:31][D][dht:048]: Got Temperature=-9.5°C Humidity=20.9%
[20:30:31][D][sensor:126]: ‘Greenhouse Temperature’: Sending state -9.50000 °C with 1 decimals of accuracy
[20:30:31][D][sensor:126]: ‘Greenhouse Humidity’: Sending state 20.90000 % with 1 decimals of accuracy
Setup:
GND connected to GND
OUT connected to D1 (GPIO5)
VCC connected to VIN
i already tryed different lenghts of cable. i tryed using 3v3 on VCC. i tryed using a 1k Ohm resistor (as described in the Data Sheet between out and VCC). Nothing changes significantly.
Here is my code:
esphome:
name: greenhouse1
friendly_name: greenhouse1
esp8266:
board: nodemcu
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
`key: "***"`
`ota:
password: "***"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
`ssid: "Greenhouse1 Fallback Hotspot"`
`password: "***"`
captive_portal:
sensor:
- platform: dht
pin: GPIO5
`model: AUTO_DETECT`
`temperature:`
`name: "Greenhouse Temperature"`
`unit_of_measurement: "°C"`
`icon: "mdi:thermometer"`
`device_class: "temperature"`
`state_class: "measurement"`
`accuracy_decimals: 1`
`humidity:`
`name: "Greenhouse Humidity"`
`unit_of_measurement: "%"`
`icon: "mdi:water-percent"`
`device_class: "humidity"`
`state_class: "measurement"`
`accuracy_decimals: 1`
update_interval: 60s
The spacing should be right… im just to dumb to format it…
I am out of ideas what to change… Any of you have a solution?
Thank you in advance.
regards,
Moet