Contains the ESPHome .yaml that allows you to modify your ESP controlled wall switch such that a button press can trigger a Home Assistant automation without toggling the relay state. This is useful when you have smart bulb installed and want to avoid accidentally cutting power to the smart lights.
After installing smart bulbs (e.g. HUE or IKEA smart bulbs) which are controlled by a mechanical wall switch, the usual problems that arise are:
- power to the bulbs is cut by accidentaly toggling the wall switch
- an additional remote is mounted around the location of the mechanical switch to control the smart bulbs
- need to inform all visitors to not toggle the mechanical switch
- bypass the switch by physically connecting the switched wires behind the switch
Use a smart switch where the button press action is not linked to the the relay control.
This project contains the .yaml file for ESPHome for a Gosund-SW9 smart switch that supports the following functionalities:
- Switch-1 and Switch-2 to control each relay (exposed to home asssistant)
- Switch-Cngf used as a configuration to enable/disable the control of relay-2 by a short press on the mechanical button-2 (exposed to home asssistant)
- Short Press, Long Press, Double Press and Press and Hold actions for both mechanical switches
- The "Press and Hold" action on the mechanical button-1 will toggle the Switch-Cnfg and flash the Button-2 LED for confiramtion
- Turn on both buttons' LEDs on boot
- Close relay-2 on boot
- Set Switch-Cnfg to the ON state on boot