Hi, this is done using a new feature called ‘magic switch mode’ in sonoff basic r4.
You will need to:
-
Bridge wires to both switches as below
-
Install sonoff basic R4 on the light fixture/fan.
Magic switch mode should be enabled by default in the ewelink app.
When pressing the switch, this should toggle the relay while sonoff basic stays online the entire time.
Does this work with custom firmware?
a) Tasmota is still being worked on.
b) For ESPhome, use this external component by ssieb
external_components:
- source: github://ssieb/custom_components@sswitch
components: [ magic_switch ]
refresh: 1min
magic_switch:
pin: 5
on_switch:
- light.toggle: light_1