Problem zigbee switch for pump

Hi,

I’ve installed a sonoff zigbee switch to pilot the relay of my pool pump instead of the original clock.

The switch turn on the pump without problem, but sometimes when the switch is turned off, the switch stops the relay and then immediatly the zigbee switch automatically turn on, and the pump restarts.

It is like if an electromagnetic perturbation or a current peak upon switch off lead to restart the zigbee switch. I tried to put the switch farther from the relay but same problem occurs.

Anyone has any idea how to correct this problem ? Does I need to try another kind of switch as a wifi one may be ?

Thanks for help.

Are you sure that it switches of at all?
Relays csn become “sticky” and don’t let go, this will look like the switch turns off then on again in the UI because HA is sure it sent a off, then the switch updates and say “no-no, I’m still on”.

Yes. I went near the switch when I turn it off, I see the relay switch off and immediatly switch on. This is not systematic but occurs 50% of time. It is not a realy problem, with the clock no problem.
I can see the led of the sonoff swicth goging green (off) and immediatly (on).

You could DIY a switch with ESP-Home and keep the relay a distance away from the pump.