NodeMCU + Home Assistant

yaml file configuration

esphome:
  name: sr04
  friendly_name: sr04

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "fadoviojdnfadfajonbomlzelabcdEk="

ota:
  password: "dfasdflkdjfladflkad"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Sr04 Fallback Hotspot"
    password: "fadfaffa"

captive_portal:


sensor:
  - platform: ultrasonic
    trigger_pin: GPIO5
    echo_pin: GPIO4
    name: "Ultrasonic Sensor"
    update_interval: 3s

  - platform: dht
    pin: GPIO14
    model: DHT11
    temperature:
      name: "Home Temperature"
    humidity:
      name: "Home Humidity"
    update_interval: 60s    
 
light:
  - platform: status_led
    name: "Switch state"
    pin:
      number: GPIO2

binary_sensor:
  - platform: gpio
    pin: GPIO12
    name: "PIR Sensor"
    device_class: motion

DIY ESPHome Multisensor – Temp, Humidity, RGB LED, Motion and LUX

https://www.youtube.com/watch?v=9Yu57vjz7AY


Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.