The SwitchC6 component reads and controls a single-live-wire switch through ESP-NOW.

| Item | Information |
|---|---|
| Product Name | SwitchC6 |
| SKU | K140 |
| Main Function | Single-live-wire switch control |
| Communication Interface | ESP-NOW |
| ESPHome Component | m5stack_switchc6 (external component) |
| ESPHome Version Requirement | / |
Add the External component:
external_components:
- source: github://m5stack/esphome-yaml/components
components: [m5stack_switchc6]
refresh: 0s Add the ESPNOW component:
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:XX.Add the Switch component:
switch:
- platform: m5stack_switchc6
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: m5stack_switchc6
id: sw1
name: "SwitchC6 Device 1"
espnow_id: espnow1
mac_address: "AA:BB:CC:DD:EE:01"
retry_count: 40
retry_interval: 300
- platform: m5stack_switchc6
id: sw2
name: "SwitchC6 Device 2"
espnow_id: espnow1
mac_address: "AA:BB:CC:DD:EE:02"
retry_count: 40
retry_interval: 300 After SwitchC6 communicates with the ESPHome gateway over ESP-NOW, switch entities appear in Home Assistant.