b4ck5p4c3 / sp4ce-button

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repo is no longer maintained. Please see b4ck5p4c3/iot-devices

sp4ce-button

The Button

The Button is used to open the B4CKSP4CE door.

Protocol

When the button is pressed or released, down or up (respectively) is published to the bus/devices/opener.button/event topic.

Pressing the button will also turn on green light for 1.5 seconds.

Publish on or off to the bus/devices/opener.button/rainbow topic to control rainbow effect.

Hardware

The Button is powered with DC 5V.

3 addressable WS2812B LEDs are connected to GPIO2.

The button of the button is connected to GPIO4.

Building and Flashing

Secrets

Create and fill secrets.yaml:

api_password: <string> # used to flash OTA
wifi_ssid: <string>
wifi_password: <string>
mqtt_broker: <string>
mqtt_username: <string>
mqtt_password: <string>

Dependencies

You will need esphome to build the firmware.

pip3 install esphome

Flashing

One simple command will build the firmware and flash the ESP8266.

esphome run sp4ce-button.yaml

The ESP8266 is flashed Over The Air by default. If you have a USB-UART adapter connected, you will be able to use it to flash over UART.

About