My Sonoff Mini hardware switch is unreliable

Hi

Ive recently managed to get ahold of some sonoff minis, and I flashed with Tasmota following the excellent guide here on Superhouse. Only problem I have is now that it is installed using my existing light switch as a toggle - it seems very unreliable - sometimes I try to turn it on or off and nothing happens. I can toggle the switch 7-8 times and it does not register with the device. It seems to happen if you try to turn it on and off a few times in quick succession, but it also sometimes just happens out of the blue.

Any ideas on what i can try to fix it?

Cheers!
Cint

Hi Cint!

So far I haven’t seen any reliability issues with the Mini, but perhaps I’ve been lucky.

Do you have them linked to any sort of home automation controller, such as OpenHAB, Node-RED, Home Assistant, etc? Do they respond reliably if you control them via the network?

Yes I have it hooked up to Node-Red using MQTT and that works well. I also have a debug output on the sonoff’s stat/# topic and if I view this while toggling the switch I get no output when the problem occurs. When the switch works I see “ON” or “OFF” in the logs.

That sounds like an electrical problem with the switch. Can you disconnect the switch from the Mini (for safety) and check continuity through the switch when you flip it? Does it behave consistently?

Hi Jon

Ive just been up and tested the continuity of the switch from the sonoff ends of the switch wire and it seems perfect. Could it be anything to do with the length or type of the cable? Its just standard UK lighting cable though, nothing unusual.

Cheers
Cint

Ive just experimented with the same switch and sonoff. But this time attached with a 20cm switch cable and it seems to work perfectly, I can switch it on and off 20-30 times no problem.

Interesting. I didn’t think to ask how long the cable is, because I assumed it was directly behind the switch.

The external switch is wired to a 3.3V logic input on the microcontroller, so if the wire is long it could have problems with electrical noise. This would be especially bad if the cable goes near wires that are carrying mains voltage.

How long is the cable?

Ah right! The cable is about 3-4m long, I had to put my sonoff up in the loft as there is no neutral at the switch.

It also runs pretty close to the 240V cabling so I can try to create some clearance and see if it helps.

Cheers!
Cint

I’d love to hear the outcome of this :slight_smile:

Hi Jon

I finally managed to get around to separating the cables a bit yesterday, so they have about 50mm between them now. No problems so far but Ill monitor it for a few days any post here once I know how successful it was. By the way, have you made any progress on producing the programming board for the Sonoff mini?

I’ve made one, but the design is likely to change now that I’m working on a standardised header for ESPxx programmers. Auto-reset works perfectly and I’m fairly happy with how it came out.

Most of the PCB will be fine, I just need to update the pinout on the programming header to match what I settle on for the programmer.

1 Like

Hi Jon

That is great I need to get one when available its too dodgy soldering onto those tiny pads!

Re my switch - it is still slightly unreliable maybe not as bad as before but still annoying. I can think of 2 fixes:

  1. Shield the wiring somehow
  2. Use 2 sonoffs - change my line in/line out light switch cable to a line/neutral, then use that to power another sonoff which only detects the toggling of the wall switch then publishes to mqtt. Then I can have a standard sonoff in the attic which does the actual light switching.

Cheers
Cint

1 Like