今天无聊,本着尽量减少插件使用量的原则,将手头几个刚接触智能家居购入的易威联单火模块SA 018刷成esphome的固件。
模块用的是esp8285,背面有vcc gnd tx rx 触点,方便焊接刷固件。
接下来是esphome固件:
esphome:
name: sa018
platform: ESP8266
board: esp8285
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "123456789"
wifi:
ssid: "my_2.4G"
password: "123456789"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Sa018 Fallback Hotspot"
password: "123456789"
captive_portal:
switch:
- platform: gpio
pin: GPIO12
name: "Power Switch"
id: relay_sw
on_turn_on:
output.turn_on: led_sw
on_turn_off:
output.turn_off: led_sw
binary_sensor:
- platform: gpio
pin: GPIO04
id: hw_sw
on_state:
switch.toggle: relay_sw
output:
- platform: gpio
pin: GPIO13
id: led_sw
指示灯和物理开关都正常。
|