Problem with sensor.dht

Hi,
i trying to configure dht11 sensor on home assistant.

I have conncted the dht11 to raspberry, tested with adafruit, and is ok.

When i restart raspberry and go to home asisstant home I hve this error:
The following components and platforms could not be set up:
sensor.dht

In homeassistant.log I found this:
2018-11-24 14:30:43 ERROR (MainThread) [homeassistant.config] Invalid config for [sensor.dht]: value is not allowed @ data['monitored_conditions'][0]. Got '–'. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.dht/

This is an extract of my configuration.yaml
# Sensors
sensor:
# Weather prediction
- platform: yr

  - platform: dht
    sensor: DHT11
    pin: 4
    monitored_conditions:
      – temperature
      – humidity

what’s wrong?

Strange. That looks right.

You’re not using tabs instead of spaces are you?
What does the whole sensor section look like properly code formatted for this forum?

BTW, don’t expect too much from the DTHxx sensors directly connected to the GPIO. Even with a physical pull up resistor, power filtering capacitor and very short wires (<100mm) the sensor values are very noisy. You will have to use a filter sensor. Even then it throws odd errors at start up.

I moved all my DHT sensors to Wemos D1 minis running esphomeyaml and communicating via mqtt. Now they are rock solid.

Do you have any other sensors in that file ? If not you don’t need the dash before the platform.

edit

Move the monitored conditions back left 1 space

    platform: dht
    sensor: DHT11
    pin: 4
    monitored_conditions:
     – temperature
     – humidity

Yes, this is the sensor sections:

# Sensors
sensor:
  # Weather prediction
  - platform: yr

  - platform: dht
    sensor: DHT11
    pin: 4
    monitored_conditions:
      – temperature
      – humidity

There are different types of hyphens in your yaml.
I front of platform they seem shorter.
Maybe a copy & paste problem.

1 Like

GREAT! there is a hyphens problem!

Thanks to all