We have recently moved into our newly build home and in the early stages of designing i decided to install smart switches everywhere.
Next to fully automated lighting the goal was to have physical wall mounted switches available in case:
- we want to turn on/off none physically connected lights (e.g. Hue) with physical switches
- someone has the need to operate the lights manually (e.g. someone who is not HA savvy)
- use those same switches to trigger other stuff besides the lights
- the Home Automation fails for whatever reason, still be able to turn on the lights.
After having investigated and piloted several options i ended up going for the Sonoff T3 TX touch switches flashed with Tasmota firmware. These units running Tasmota are rock solid! I have over 30 switches running without a single glitch yet.
When running Tasmota on these switches you get the option of Multi Tap (double, triple, quadro, penta press) and Hold besides the standard single press option. This opens up a can of possibilities for triggers towards a Home Automation solution. (e.g. single press is turn on lights, double press is trigger scene x, HOLD is toggle ceiling fan)
Unfortunately enabling these options in Tasmota decouples the physical buttons from the relays and some settings and rules are required to make this usefull and work in all cases.
This post is meant to share my configuration with the community for anybody who finds it interesting and has a similar use case.
Automation Flow:
Switch details:
Type: Sonoff T3 TX touch (but is applicable to any of the TX touch switches)
Firmware: Latest tasmota release (currently 9.4.0)
Tasmota configuration:
- make sure to connect your tasmote firmware to you MQTT broker!
LedState 0 (disables unwanted led blinking)
SetOption1 ON (limit button presses to penta/hold no reset)
SetOption73 ON (decouple button from relay)
SetOption32 10 (HOLD detection 1 second)
SetOption30 1 (discover relays as lights)
SetOption19 1 (enable HA Autodiscovery)
**** Below rule configuration is only applicable in case you want redundancy. If HA or MQTT broker goes down the switches will no longer work as HA and MQTT are required for the switches to function. This rule temporarily disables the MQTT button presses and couples the button with the relay untill MQTT broker connectivity is restored ****
Tasmota rule configuration:
Rule1 ON Mqtt#Disconnected DO setoption73 0 ENDON ON Mqtt#Connected DO setoption73 1 ENDON
Rule1 1
Node-Red configuration: (you can also use HASS automations)
note: enabling SetOption73 in Tasmota decouples the button press from the relay. Instead every button press sends a MQTT message. This requires even a single button press to be processed using MQTT!
MQTT in node β
Switch node β
HA Call Service node β
Switches auto discoverd in HA (due to setoption19 1 in Tasmota):
My quick write up so far. Hope you find it useful. Need help⦠let me know!