Skip to content

Instantly share code, notes, and snippets.

@mallendeo
Created March 25, 2023 16:48
Show Gist options
  • Save mallendeo/0ef63a4af1057cc659bd662693b32aa3 to your computer and use it in GitHub Desktop.
Save mallendeo/0ef63a4af1057cc659bd662693b32aa3 to your computer and use it in GitHub Desktop.
ESPHome config
/.esphome/
/secrets.yaml
esphome:
name: lock
esp8266:
board: esp01_1m
ota:
password: !secret ota_password
wifi:
ssid: !secret ssid_name
password: !secret ssid_password
fast_connect: true
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: 'Lock Fallback Hotspot'
password: !secret ap_password
captive_portal:
mqtt:
broker: example.com
username: !secret mqtt_username
password: !secret mqtt_password
logger:
baud_rate: 0 #need this to free up UART pins
uart:
baud_rate: 115200
tx_pin: GPIO1
rx_pin: GPIO3
switch:
- platform: template
name: "Relay1"
id: "Relay1"
optimistic: true
turn_on_action:
- uart.write: [0xA0, 0x01, 0x01, 0xA2]
turn_off_action:
- uart.write: [0xA0, 0x01, 0x00, 0xA1]
- platform: template
name: "Relay2"
id: "Relay2"
optimistic: true
turn_on_action:
- uart.write: [0xA0, 0x02, 0x01, 0xA3]
turn_off_action:
- uart.write: [0xA0, 0x02, 0x00, 0xA2]
mqtt_username: test
mqtt_password: 00000000-0000-0000-0000-000000000000
ssid_name: IOT
ssid_password: IOT_p@sswd
ota_password: ota_p@sswd
ap_password: ap_p@sswd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment