Remember the original Sonoff BASIC? – the cheapest mains controller on the planet (if a bit rough around the edges) – that was YEARS ago. I reviewed and messed around with them and I still use the original as you;ll see in another recent blog entry… along with most other Sonoff kit. Well, I recently received my first SONOFF BASICR4 and S-MATE EXTREME devices.
Ok, here’s the kit along with my crude attempt at removing the photo background. On the left we have the new BASICR4 complete with manual and 4 screws – this looks pretty much like the original – indeed this seems to be the original molding.
On the lower left, we have the revamped S-MATE (S-Mate Extreme or S-Mate 2) complete with manual, wire and nifty connector. Turned over you see a simple SONOFF title along with 6 screw connections S, S, S, S1,S11, S111. And there’s a TINY momentary/toggle option button on the RIGHT side (left in the photo above).
The S-MATE-2 unit has 6 connections – three are common – the other three are for switching – or rather to assist a normal switch or 2 or 3. Inside is a battery – a BIG CR2477 battery – so the device can operate in wall switch sockets where no neutral is available. The device can work alongside, say, a MiniR4 or simply be a sub-device of the Sonoff NSPanel Pro.
I’ve set mine to the latter (just power up and read the QR code then short any pair to start the mating process – takes seconds – done).
From there on, the NSPANEL Pro, when you short a contact pair on Switchmate Extreme, will show that the contact has been made. Depending on which of the two available modes of the Switchmate is used, it may show “channel1 click”, “channel1 double-click” or “channel1 long-press” – the same goes for channel 2 or 3. What you do with that is up to you. If you don’t have NSPANEL Pro you could have, say, up to three MiniR4 devices directly working with the 3-channel Switchmate. Simple. No idea how long that battery will last but by the size of it I’d be disappointed if you didn’t get a couple of years out of it.
One use for the battery-powered SMATE is, well, let’s say you have the MiniR4 controlling a room light but you still want the original wall switch to do something. On the wall switch (assuming it’s not a changeover upstairs/downstairs arrangement) disconnect the two wires from the switch (common sense here, do this with the power turned off) and short using, say, chock-block so the light is totally controlled by the R4. Then put the S-MATE behind the now-disconnected wall-switch and connect, say, an S and S1 (see photos above) to the original switch contacts. With the right setup, not only can the R4 control the light by whatever means (the button or, say, MQTT or eWeLink control), but also the original switch remains functional.
There is a point here… I don;t see anyone mentioning this – but here in Southern Spain I have pretty standard wall switches and backing boxes and NO WAY can I squeeze the Switchmate or other Sonoff devices (ZBMINIL2 for example) behind the switch – or on either side of it for that matter. Does this ring a bell with anyone?
What I’d like to know, having given up on a multi-sensor ESP8266 battery powered design, is how they managed this on a single (if large-ish) battery, with more than one input. My first ever ESP8266 project could wake up using GPIO16 but still consumed too much power for a single button-battery but here we have a unit ideal for wall-switch updating that does the job. I have 3 adjascent wall switch just waiting for this device. Just disconnect the wires behind the wall switch (see comment above) and short then so the lights stay on permanently, fasten this Switchmate to the wall switches and control devices with something like Sonoff BASICs where the, say, ceiling lights are sited (and hence clearly have live and neutral available).
Moving on to the BASICR4, I’m not sure what that switch below-left is all about – maybe the house breaker – though I’ve never seen a breaker like that before. Don’t ask what that pink background is – I dread to think as my office is definitely not pink and the sheet was definitely white.
Anyway that ON-OFF switch has nothing to do with the Sonoff BASICR4 – it’s just to indicate that you (or your “qualified electrician”) should ensure the power is off before working on the Sonoff – but then – surely an electrician would know that already?
No surprises – 220-240v in on the left, load out on the right, download the eWeLink APP, turn the power on, scan the QR code (top right) – well, that’s new (the QR code).
So I applied power – the blue indicator light flashed to show the unit was in pairing mode) – I hit “+” in the APP and seconds later the BASICR4 was paired with the APP – maybe the instructions need updating as I certainly did not scan or go anywhere near the QR code at the top of the unit.
So now I could turn the BASICR4 on and off with it’s own button OR with the button on the APP. Within the APP you can add schedules and on-off timers or a loop timer. I note the schedules sadly do not include dusk and dawn – so I see this device ending up hooked up to Tasmota.
The schedules also merely offer one day or multiple/all days of the week so my BIGTIMER isn’t out of business yet. I often have different light settings for winter and summer and turn lights on at dusk and off at midnight. About time Sonoff updated eWeLink. Sonoff BASICR4 remains true to it’s name – basic – I hope the price reflects that.
I went into settings after ensuring the BASICR4 was working perfectly. “Current version 1.0.1” – I touched that area in the APP to be greeted with “Device offline”. I think they meant “up to date” as the APP allowed me to change the name. I’ll drop Sonoff a line.
Interesting – as I turned the device ON and OFF either locally – or via the APP – the solitary blue light on the unit remained ON. That would not have been my decision – at the very least they could have PWM’d the light to be half brilliance when off – or full brilliance when on. For a couple of pence extra they could have used an RGB LED and given us RED for on, BLUE for OFF and maybe yellow for bad WiFi??
Alternatively for NO extra cost, full blue for on, half brilliance blue for off, quick flash for pairing, slow flash for no WiFi. They’ve used flashing for pairing mode but as far as I can tell, nothing to differentiate ON or OFF.
I can feel Tasmotizing coming on – why they didn’t make an obvious pin for programming when they’ve gone to the trouble of providing gnd, TX, RX and 3v3 on the board I don’t know – it’ll be there – I just have to find it. So we have (underside view) ground (without a hole), rst, tx, rx then unmarked – then 3v3 without a hole. On the TOP view we have left to right 3v3, rx, tx, gnd. The latter is correct. Also – GPIO4 for the relay, GPIO6 for the LED, GPIO9 for the button.
{"NAME":"Sonoff Basic R4 ESP32C3","GPIO":[0,0,0,0,224,0,544,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
So it seems we have in fact a 4-way connector with gnd, tx, rx and 3v3 – no programming pin. It turns out that’s the big button as with the original ESP8266-based BASIC except now GPIO9 – but then, long-pressing that button puts the unit into pairing mode according to the spec. I have now just Tasmota-flashed the BASICR4 though so it DOES work.
Ok, so I put in a basic template instead of the one above – and the light now comes on when the output is on. It also magically flashes when checking for WIFI after a power-up just like my older BASICs do.
AND they put an NTC sensor in there – and didn’t think to make that user-readable.
I plan to take this a lot further.. I can put an S-MATE downstairs where I have a 3-way wall switch – what I really need is another S-MATE upstairs where I also have a 3-way wall switch. Not yet figured out how to get a pair of these to emulate a traditional upstairs-downstairs changeover switch set but I’m sure it’ll come to me (you know what I mean – you’re upstairs and turn the hall light on – come downstairs and turn it off and vice-versa so the two switches are interacting.). I want to emulate that with S-MATEs or some other ESP-based solution.
Finally, after Tasmotising the ESP32-based BASICR4, I happened to notice on the web that by invoking SETOPTION146 1 (or so146 1) I can – if I wish – see the ESP32 temperature. So, to demonstrate – from Node-Red in MQTT… I recently realised that setting the teleperiod (it is already at 300 seconds so no change) immediately invokes a TELE response – handy…. in the test below, MQTT just returned OFF and 66.8 (centigrade) – hardly room temperature – I must say, I fail to see why it is so warm with the load off.
The original Sonoff BASICs
Before leaving this subject – does anyone remember the original Sonoff BASICs – I say that in plural as I still have at least two of the original BASICRF units – I call it BASICRF2-TAS. I also have in front of me – one of the original BASICS (no RF) – Let’s quickly compare:
The new BASICR4 is pretty much identical visually to my original BASICRF unit. A quick look at AliExpress suggests the price of the original Sonoff BASIC units hasn’t changed much all the way up to BASICR3 – so that’s good – the R4 is a bit new for AliExpress so there isn’t any pricing yet.
I’ve just done some testing and the new BASICR4 has a blue light which comes on solid when there is a network connection – you can turn that off if you like. I can find no way to get that indicator to show if the output is on or off (not in the factory firmware – I can in Node-Red) – you can hear the relay click but that’s not a cast iron indicator of on-off state.
The original? Well, I can’t remember what the BASICRFR2 green indicator did in eWeLink – but having converted the unit to run TASMOTA firmware I can tell you for sure that in Tasmota the LED flashes on WiFi connection AND shows the relay output state.
It is also notable that GPIO2 was brought out as IO2 in earlier models and hence could easily have a temperature sensor added to it (no HOLE unfortunately, just a pad) and of course, Tasmota directly supports several of them – my favourite being the Dallas DS18B20 (and if nothing else you could use it to monitor for overheating) – up to now, no such luck with the ESP32-based BASICR4 which has it’s own sensor but as you’ll see above you can read the internal ESP32 sensor.
Both boards on their PCBs have gnd, serial in, serial out and 3v3 available for programming (with the mains input disconnected) and as the original BASIC unit was ESP8266-based and Sonoff used the pushbutton on the unit to turn the relay on and off, connected to GPIO0 – hence that could be held in on power-up to act as a programming pin so it was easy to program TASMOTA onto the board. The new R4 board is ESP32-based for no user-advantage that I can see other than that the ESP32-based device CAN talk to MATTER – whereas the older device cannot – as evidenced by lack of MATTER QRCode in the old hardware. Lets hope that doesn’t push the price up – as I write this, Tasmota and MATTER on Google HOME isn’t perfect.
I also note that though I could tasmotize the BASICR4 with just my FTDI, when I tried then setting up WiFi etc, I needed mains power in – as presumably the FTDI wasn’t QUITE putting out enough power. Done.
On eWeLink – for example – you can setup the R4 in eWeLink with a schedule – any time on or off, one day a week, all days or any combo, but that’s it. What if you want the unit to turn on/off at dusk/dawn? What if you want it to only operate on certain months of the year etc? With Tasmota that’s easy – and particularly if you have – for example – a Raspberry Pi SBC running the house or office – perhaps running Node-Red? In that case, my own node-red-contrib-bigtimer lets you set up much more complex schedules.
Pete, take a look
That’s what S-MATE is for – I had mine up and running – sadly due to sheer late-night incompetence I blew it up – waiting for a replacement to arrive.
but here he shows how to do the same with a basic r4, using a double rocker switch… how it does, i don’t know, probably an additional capacitor inside which keeps the power or for the little time of the switch to change it’s position? take a look at 1:30 for how it connects them, this way there’s always a side of the switch connected to the live line