Set up DHT22 sensor with Raspberry Pi's GPIO

Hi everyone,

I am just starting out with Home Assistant so I might have overlooked something super obvious, but I am already stuck and would appreciate some help…

I am trying to set up two DTH22 temperature/humidity sensors connected via GPIO to the Raspberry Pi 2 that HASS is running on.
I can read them out just fine using Adafruit_Python_DHT and I have added the following to my configuration.yaml, as directed here.

Sensor 1:
  platform: dht
  sensor: DHT22
  pin: 14
  name: Gardensensor
  monitored_conditions:
    - temperature
    - humidity

However, hass --script check_config gives the following error:

Testing configuration at /home/pi/.homeassistant
16-08-29 13:23:15 ERROR (MainThread) [homeassistant.loader] Unable to find component Sensor
Failed config
  General Errors: 
  - Component not found: Sensor

Successful config (partial)

Do I need to install additional components in order to get it to work? I can’t really tell from the guide…

Your config is not correct. Remove the 1 in first line.
As from documentation:

sensor:
  platform: dht
  sensor: DHT22
  pin: 23
  name: Living Room
  monitored_conditions:
    - temperature
    - humidity

You don’t give name with “Sensor 1” just with the name property.

3 Likes

Oh, of course. Thanks a lot!

1 Like