HA를 경유해 주방후드 제어하던걸 주방후드 플러그의 esphome에 web서버를 설치하고 주방 벽스위치로 HTTP Request 컴포넌트를 통해 직접 제어하는 걸로 변경.
이 경우 HA서버 없이 제어 가능하고 외부연결이 끊겨도 제어가능.
HA 구성요소를 통한 esphome에서 주방후드 제어:
esphome:name: zemi-kitchenarea: Kitchenesp8266:board: esp01_1mbinary_sensor:- platform: gpioid: button3name: "Kitchen Bottom"pin:number: GPIO16inverted: trueon_multi_click:- timing:- ON for at most 0.5s- OFF for at least 0.01sthen:- light.toggle: light3- timing:- ON for 0.6s to 3s- OFF for at least 0.1sthen:- homeassistant.service:service: switch.toggledata:entity_id: switch.hood
HTTP Request 컴포넌트를 이용한 주방후드 제어:
esphome:name: zemi-kitchenarea: Kitchenon_boot:priority: 600.0then:- switch.template.publish:id: hoodstate: ONesp8266:board: esp01_1mhttp_request:useragent: esphome/deviceverify_ssl: falsebinary_sensor:- platform: gpioid: button3name: "Kitchen Bottom"pin:number: GPIO16inverted: trueon_multi_click:- timing:- ON for at most 0.5s- OFF for at least 0.01sthen:- light.toggle: light3- timing:- ON for 0.6s to 3s- OFF for at least 0.1sthen:- switch.toggle: hoodswitch:- platform: templatename: "Hood Switch"id: hoodturn_on_action:- http_request.post: "http://192.168.1.212/switch/neo12_relay/turn_on"- switch.template.publish:id: hoodstate: ONturn_off_action:- http_request.post: "http://192.168.1.212/switch/neo12_relay/turn_off"- switch.template.publish:id: hoodstate: OFF