dii2Hu

ESP8266 4-way control socket connected to HASS

 
Overview

ESP8266-12F is used as the core to make a 4-way socket strip with 4 independent buttons.
It is used to connect to HASS.
After the ESPHome plug-in recognizes the firmware with ESPHome, the code can be upgraded via wifi.
The 4-way buttons independently control the 4-way output and can set the main switch. This production is not used for the time being, so the relevant code is not written.
1m: # Enable wifi hotspot (captive portal) ap: ssid: "************" password: "***********" web_server: port: config (optional) platform: gpio name: "配置1" id: kaiguan1 pin: number: 16 ip: tcp : port: config (optional) tcp: port: config/opt: -p esp: -m: power: -s ap: -m: power: -s ap: -m: power: -s ap: -m: power: -s ap: -m: power
:   -s ap : -m: power: -s ap: -m: power: -s ap: -m: power: -s ap   : -m :     power   : -s ap   : -m   : power: -s ap: -m: power: -s ap:   -m   : power: -s ap: -m:     power   :     -s     ap     :   -m   : power     :       -s       inverted: no   - platform: gpio     name: "Switch 2"     id: kaiguan2         pin:       number: 14       inverted: no   - platform: gpio     name: "Switch 3"     id: kaiguan3         pin:       number: 12       inverted: no   - platform: gpio     name: "Switch 4"     id: kaiguan4     pin:       number: 13       inverted: no binary_sensor:   - platform: gpio     pin:       number: 5       mode: INPUT_PULLUP inverted       : True     name: "Self-reset switch 1"     on_press:       - switch.toggle: kaiguan1   - platform: gpio     pin:       number: 4       mode: INPUT_PULLUP       inverted: True     name: "Self-reset switch 2"     on_press:       - switch.toggle: kaiguan2   - platform: gpio     pin:       number: 0       mode: INPUT_PULLUP       inverted: True     name: "Self-reset switch 3"     on_press:       - switch.toggle: kaiguan3   - platform: gpio     pin:       number: 2       mode: INPUT_PULLUP       inverted: True     name: "Self-reset switch 4"     on_press:       - switch.toggle: kaiguan4


 

 




















 









     






     












     









   








   
















 
 

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-19 15:17:55
  • Embedded Systems Designer Exam Outline
  • msp430datasheet
  • Op amp
  • A simple and easy to make FM transmitter
  • How to calculate delay time in ADS environment?
  • Design Considerations for Electric Vehicle Charger Circuit Topologies

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号