Making a non-smart wall switch smart

I am wondering what is the path to achieve the following with minimal effort:

  1. Preferable no to minimal coding and no to minimal soldering (this is open for interpretation).
  2. Wall mounted (already existing) monostable switch connected to 230V that when pressed toggles light (relay) with no connection to HA (for reliability).
  3. At the same time if HA is available then “single” action is triggered in HA.
  4. When the button is pressed for more than eg. 3 seconds the light is turned off (optional).
  5. At the same time if HA is available then “hold” action is triggered in HA.
  6. If there was “double” action for two shord button clicks it would be a bonus.

There is no requirement for it to be extra small, it could be Arduino based for example. I prefer it to be wired (no zigbee and stuff) and connected to HA via USB. Though the last part is not critical.

The solutions I know about (and use in other contexts) and that do not meet all requirements:

  1. TuYa TS0041 - supports the single/hold actions, but it is battery based, wireless and doesn’t have relay.
  2. Moes MS-104BZ - has the relay, can be connected to wall mounted switch, but does not support single/hold actions and is wireless.

Any guidance here? I was reading about Firmata and MySensors, but I haven’t seen any similar use cases described.

if i was starting up again I would put Shelly’s into every switch

currently i have shelly (3) and some sonoff basic running tasmota

most of the shelly have power monitoring

1 Like

I second this. Shelly is the way to go.
Also, with ESPhome you can manage and program the devices with minimal effort if the original firmware is not to your liking.
Not sure if the original Shelly integration requires MQTT but ESPhome does not, which is also an upside in my view.

Indeed, a shelly 1 or sonoff mini (flashed with tasmota or esphome) would do it.

Theres no need to flash sonoff anymore.

Thanks for the pointers. However, I was not able to find any reference that Shelly 1 does what I want it to do. Ok, maybe it would be possible with its gpios and some custom code, but I would prefer to minimize that part. Else my next idea is something like arduino+serial2mqtt (doesn’t seem to be available in HA out of the box though).

It is a freely programmable esp8266, so it can do anything you want.
As mentioned earlier with ESPhome the programming effort stays minimal.
I don’t think you will find a device that OOTB does exactly what you want.
Custom requirements require customization.

A shelly 1 or sonoff mini flashed with Tasmota can do these things. With esphome probably too, but since my shellies and sonoff mini’s run Tasmota and not esphome, I have not tried it yet.

With Tasmota you can have single, double, triple, quadruple, five times click or singe, double click and long press, depending on the setoptions you set.

That integration has limitations that a sonoff flashed with Tasmota does not have, like automations that are working when HA is down. Besides, all my shellies, sonoffs and tuya (and other) devices are flashed with Tasmota, just having to maintain 1 integration is a big plus for me.

I have similar requirements… but I would add to be a zigbee device:
After a year with different options, I think that zigbee is the way to go. Less power consumption, battery operated devices, area extension with some devices acting as routers…
I also have some pre-existing push switch connected to a relay, so that many switches can control a single relay without using commuters.
I want to replace the relay with an smart one, i can do it using wifi, using for example a sonoff basic or mini with tasmota, with these settings:
Backlog ButtonTopic 0; SetOption73 1; SetOption32 10
and adding this rule
Rule1 ON button1#state=10 DO power1 2 ENDON
I use an optocoupler like this Módulo de aislamiento de optoacoplador de CA 220V, placa detectora de voltaje de 1 canal, TTL, 3 5V, SCM, prueba para microcontrolador, PLC adaptable de 24V|Circuitos integrados| - AliExpress
as 3,3v input to avoid long wires

But I don’t find an equivalent for zigbee. The zigbee modules I found allow only a toggle switch and not a push switch with the multiplle click options, (double click or long press)
I have tried the sonoff snzbmini or these relays from Avatto AVATTO 1/2/3/4 pandilla Tuya Zigbee Smart interruptor de luz con el Módulo 2 Control DE vía inteligente casa Auto interruptor trabajo con Alexa de Google|Módulos de domótica| - AliExpress?
but none of them have the multiple click ;-( , Do you know any option to have the same functionality as using wifi and tasmota??