Is this a new Sonoff device? Sonoff Mini

Sadly in the past electricians didn’t think switches would ever require a neutral. It is building code in many areas now to run neutral to switch boxes.

Dimmers are effectively using the light bulb as a return, always passing a small current through. A dimmer also is just a chopper, knocking part of the A/C wave off to lower the voltage. As such it turns on and off with each wave, only needing to be active when the bulb is being fed.

A device like a Sonoff must run continuously to run the processor, maintain the WiFi connection, etc. So it either needs to pass a current through the bulb, or have a neutral.

Problem with passing current through the bulb is that it doesn’t work well with LED bulbs because they require such low currents. So you end up with flickering. And when the bulb is turned on, that current path goes away so the “neutral” disappears. Fine for a dimmer in series, but would deprive the processor in a Sonoff of power.

Unless you do some tricks like interrupting the power to the load every few mS to charge a capacitor to power the processor. Which incidentally is what the “no neutral” smart switches do.

Hi, I’m using Touch switches which uses Gateway and the gateway connects to wifi router and can be operated via ios app and also manual touch. It has no compatibility with Alexa or Google voice. If I use Sonoff Mini with this touch switch (without using Gateway) is it possible to make it Alexa compatible swifch.
Shashi

Hay Bro dont come to new zealand all our lights switch in wall have netrual in them LOL

1 Like

Yes - it seems some countries do. When a normal switch is used, what is natural connected to?
In the uk we have 3 conductors, live into switch, switched live out of the switch to the lamp, and earth.

Neutral is not switched in a normal dumb switch. It is just looped.

In a smart switch it is used to power the smarts.

That’s very true Nick but there are special cases where a double pole ‘mech’ is used to switch some sensitive equipment which requires total isolation from the grid system. UPS devices are one such device where this is often recommended by the manufacturer.

In some types of non-domestic installation double pole isolation is a specific requirement.

Good points.

Did you continue to investigate this? I wanted an extra input to the mini so just used the OTA pin header. Once flashed with ESPhome, this pin is available as GPIO 16, well I think so, I’m about to try it. That header pin is way easier to break out than soldering directly to the board.

I did not test myself, but others have.
I would agree using the DIY pin (GPIO16) will be the easiest and is what I plan as well.
On the Tasmota Template page, someone added what I have found to be the best explanation so far:

Cheers!
DeadEnd

Hi,
Yesterday I flashed sonoff mini from ewelink firmware (DIY flash) to tasmota with success.
Now I wanted to go to esp home and I stuck on error during flashing by Tasmota OTA

Sonoff Basic Module

Tasmota

Upload Failed

Not compatible

My script is:

esphome:
  name: sonoff_mini_01
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_pwd

# Enable logging
logger:

substitutions:
  hostname: "sonoff_mini_01"

# Enable Home Assistant API
api:

ota:

# used just for testing, otherwise no need for it
#web_server:
#  port: 80

# tasmota template: {"NAME":"Sonoff Mini","GPIO":[17,0,0,0,9,0,0,0,21,56,0,0,255],"FLAG":0,"BASE":1}
# tasmota template decoded: GPIO: GPIO00 17 Button1, GPIO04 9 Switch1, GPIO12 21 Relay1, GPIO13 56 Led1i, GPIO16 255 userdef; BASE: Sonoff Basic

status_led:
  pin:
    number: GPIO13
    inverted: true

binary_sensor:
  - platform: gpio
    pin: GPIO00
    id: reset
    internal: true
    filters:
      - invert:
      - delayed_off: 10ms
    on_press:
      - switch.toggle: 
          id: relay_1

  - platform: gpio
    name: "$hostname switch"
    pin: GPIO04
    id: switch_1
    on_press:
      then:
        - switch.turn_on:
            id: relay_1
    on_release:
      then:
        - switch.turn_off:
            id: relay_1

switch:
  - platform: gpio
    name: "$hostname relay"
    icon: "mdi: lightbulb_outline"
    pin: GPIO12
    id: relay_1
    restore_mode: restore_default_off

i also tried with esp8285 as board
Do you have any idea what I do wrong?

Mario do you have a button toggle switch? This code appears to be for a button. Are you using a sonoff mini or sonoff basic?

You should use sonoff-basic.bin instead of sonoff.bin.

1 Like

I may have missed it, but can this be flashed OTA using tuya-convert?

It can be flashed OTA, but not with tuya-convert. Instructions on the sonoff website, or here :

1 Like

@patfelst
Typically you can tell something can be flashed with Tuya Convert when it says to use the “Smart Life” app. There are a few others, but that is the most popular one for manufacturers.

thanks for your replies @francisp @DeadEnd. Do we know for sure Tuya-convert won’t work? I might get one and try it, the DIY method looks overly complicated! I mean, it’s an ESPxxxx, so once in OTA flash mode, surely it doesn’t matter what firmware is on it to begin with?

Tuya-convert only works on tuya firmwares. Sonoff doesn’t use tuya firmware

1 Like

@patfelst
Tuya-Convert is a program created to mimic the connection to the Tuya server. It is pretending to be the web server that the device is looking for to get a new firmware. That is why it only works on devices that use smart app - the smart app is actually pulling the firmware to the device from this mimic web server.

Hopefully that makes sense (and is mostly correct :slight_smile:)

Tuya convert works by pretending to be a tuya server. Sonoff never tries to connect to a tuya server, so it does not work/