
SwitchC6 is an IoT single-live wire switch controller. It integrates the ESP32-C6-MINI-1 core controller and a magnetic latching relay, supports connecting to electrical load circuits of AC 100 ~ 230V, and helps quickly build IoT smart homes. The controller comes pre-installed with ESP-NOW control firmware, and provides related control protocols and SDKs, allowing users to wirelessly control it with any ESP32 device. The back adopts a rail clip design, making it easy to install on DIN rails, suitable for embedded smart home control, upgrading single-live wire lighting circuits, and other application scenarios.
Step 1. Create New Device

Step 2. Create Device Name
CONTINUE.
New Device Setup.
NEXT.
Step 3. Choose Device Type
ESP32.
SKIP.
Step 4. Start Edit YAML File
EDIT. We can customize device functionality through YAML files.
The following is the core part of the code. Relevant references and explanations are provided below.
external_components:
- source: github://m5stack/esphome-yaml/components
components: espnow_switch
refresh: 0s espnow:
id: espnow1
auto_add_peer: true
peers:
- XX:XX:XX:XX:XX:XX
on_broadcast:
- lambda: |-
id(sw1).handle_broadcast(data, size); - XX:XX:XX:XX:XX:XXswitch:
- platform: espnow_switch
id: sw1
name: "SwitchC6 Device 1"
espnow_id: espnow1
mac_address: "XX:XX:XX:XX:XX:XX"
retry_count: 40
retry_interval: 300 espnow:
id: espnow1
auto_add_peer: true
peers:
- AA:BB:CC:DD:EE:01
- AA:BB:CC:DD:EE:02
on_broadcast:
- lambda: |-
id(sw1).handle_broadcast(data, size);
id(sw2).handle_broadcast(data, size);
switch:
- platform: espnow_switch
id: sw1
name: "SwitchC6 Device 1"
espnow_id: espnow1
mac_address: "AA:BB:CC:DD:EE:01"
retry_count: 40
retry_interval: 300
- platform: espnow_switch
id: sw2
name: "SwitchC6 Device 2"
espnow_id: espnow1
mac_address: "AA:BB:CC:DD:EE:02"
retry_count: 40
retry_interval: 300 INSTALL again to flash and wait for it to complete.
SAVE and INSTALL in the top-right corner, then choose Manual Download in the popup.
Factory format(Previously Modern)
CONNECT to connect to the device.

INSTALL

Settings -> Device & services to check the device.
Discover section.

