esphome / esphome-core

🚨 No longer used 🚨 - The C++ framework behind ESPHome
https://esphome.io/
GNU General Public License v3.0
545 stars 113 forks source link

Can't use relay's or GPIO for sensors #101

Closed mlares85 closed 6 years ago

mlares85 commented 6 years ago

I add the code for using a relay but it doesn't pass the verify step. *Nodemcu V2

ERROR [esphomeyaml.config] Unable to find component sensor.gpio
Failed config
  General Error: 
    - Platform not found: sensor.gpio

Code:

esphomeyaml:
  name: garage
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: '********'
  password: '********'

mqtt:
  broker: '192.168.1.121'
  username: ''
  password: ''

# Enable logging
logger:

ota:

sensor:
# Temperature/Humidity Sensor
  - platform: dht
    pin: D4
    temperature:
      name: "Garage Temp"
    humidity:
      name: "Garage Humidity"
    model: DHT22
# Garage Door
  - platform: gpio
    pin: D3
    name: "Garage Door"
brandond commented 6 years ago

You have it under the sensor section. If you're trying to use that pin to control a relay it needs to go in a new switch section. Take a second look at the example in the docs.

https://esphomelib.com/esphomeyaml/cookbook/relay.html

Alternately, if you're trying to use that pin as an input then you want binary_sensor: https://esphomelib.com/esphomeyaml/components/binary_sensor/gpio.html

mlares85 commented 6 years ago

Yeah I see it now. I saw switch and sensor and for some reason only saw 'sensor' and thought it was just an additional sub setting to the sensor section.

Thanks.