Yvan Beerens
Published © GPL3+

HA + ESPhome automated lights

esp8266 wifi microcontrollers, on battery, to make seperate lights that are automated with the use of Home Assistant.

BeginnerWork in progress944
HA + ESPhome automated lights

Things used in this project

Hardware components

Esp8266
×1
18650 single battery holder
×1
PIR sensor
×1
LED (generic)
LED (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Resistor 1k ohm
Resistor 1k ohm
×1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×1

Story

Read more

Schematics

ESPhome build

My current build starting from the component to the ESP8266
PIR Sensor:
VCC conneted to 3.3V gpio pin
Ground to Ground pin
Output to D1 pin

LED:
Negative side to Ground pin
Positive side to Resistor - Resistor to 3.3v pin

Code

ESPhome configuration (PIR + LED)

Python
esphome:
  name: nodemcu-tester

esp8266:
  board: nodemcuv2

# 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: "Nodemcu-Tester Fallback Hotspot"
    password: "qtcr9jEcSxaI"

captive_portal:



binary_sensor:
    platform: gpio
    pin: D1
    name: "PIR Sensor"
    device_class: motion

output:
    id: light_output
    platform: gpio
    pin: D2

light:
  - platform: binary
    name: "Desk Lamp"
    output: light_output

Credits

Yvan Beerens
1 project • 0 followers

Comments