本帖最后由 jyz_0501 于 2020-3-5 22:40 编辑
用ESPHOME刷写了囧牌模块,一直以来用的GPIO的switch,所以在HA中也是以SWITCH的域存在的,switch和light的图标和一些方面吧 还是不太一样的,强迫症的我,感觉还是换成light比较好。
switch的请参考 @natic的帖子 https://bbs.hassbian.com/thread-7635-1-1.html
light使用的是output 平台 现在以单开模块为例~~~
esphome:
name: cookroom_light
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
wifi:
ssid: "***********"
password: "********"
fast_connect: True
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "************"
password: "***********"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
mqtt:
broker: 192.168.*.*
username:
password:
web_server:
port: 80
output:
- platform: gpio
pin: GPIO5
id: gpio5
binary_sensor:
- platform: gpio
pin:
number: GPIO14
mode: INPUT_PULLUP
inverted: True
id: "button1"
internal: true
on_press:
- light.toggle: light1
light:
- platform: binary
name: "CookRoomLight"
output: gpio5
id: light1
status_led:
pin: GPIO13
|