HomeHome AutomationAdding Matter to Sonoff BasicR4

Adding Matter to Sonoff BasicR4

It went back to Basic Quite literarly

Among my emails from ITEAD, I received one with the promise of the latest releases in the Sonoff lineup. I wasn’t sure what was on the cards this time, but I promised to cover them in a timely manner. After all, who doesn’t like new devices, right? When the box arrived, I found 2 devices inside: Sonoff BasicR4 and Sonoff S-MATE2 Extreme. One of them has left me puzzled.

Sonoff BasicR4

It’s the third time the humble Sonoff Basic has undergone a design change. Each time changes are pretty superficial, bringing the Sonoff BasicR4 to a more modern standard by updating the shell or the IC inside. When I opened the box, I was in for a shocking discovery. Sonoff BasicR4 looks like Sonoff Basic – the one from ages ago. At least on the surface.

I recently praised the design team for the modern look of the shells in the Extreme series, and here we are looking at the equivalent of the “retro” design in home automation. Not everything is the same. Sonoff BasicR4 resembles the original Sonoff Basic, but there are small changes that will once again make this smart relay more attractive.

  1. Lower cost
  2. CE, FCC certifications
  3. ESP32 based

Sonoff Basic may seem simple in its name and functionality, but when used correctly, it could sit at the heart of amazing automation. The original Sonoff Basic has served me as a smart heating controller for years, and only recently it has been replaced by something that doesn’t look like it is about to explode – a budget ZigBee 3.0 Thermostat.

Inside Sonoff BasicR4 – $4.85

The entire board has been re-designed around ESP32-C3, a RISC-V microcontroller previously present in Sonoff Extreme. This enables Bluetooth 5.0 and better compatibility with the latest eWeLink features.

Anyone keen on flashing this thing with Tasmota or ESP Home will be happy to see a dedicated header with: 3V3, RX, TX, GND pads and a bootstrapping pin connected via button.

The placement of the header makes it possible to expose GPIO pins (you would need these 90-degree headers) on the side of the Sonoff BasicR4 for easy access and perhaps the utilisation of the RX|TX pair for external sensors. Access hatch can be made with a sharp knife, followed by some cleanup with a file.

This is exactly the approach I have taken when building my $5 Smart Heating System. A single Sonoff Basic with DHT11 was a core of my central heating for 4 years until I switched over to a ZigBee-driven inexpensive thermostat panel.

In eWeLink

Inside the app, not much has changed. eWeLink still offers all the options for Sonoff BasicR4 including timers, schedules and voice integrations via Alexa and Google Home. As the Sonoff BasicR4 has been updated to a more robust IC, you can also take advantage of the advanced default power on behaviour, inching and better support for local LAN connectivity.

A completely new is the support for eWeLink Remote – up to 8 devices. More about this in the

Other than that, the app does what it is supposed to – toggles the state of the relay ON/OFF from the card or the device menu. It does that fast regardless of the “Local LAN” state so you won’t be disappointed.

Sonoff S-Mate2 Extreme – $7.49

The second device is a Sonoff S-Mate2 Extreme the latest iteration of the switch utilising Sonoff eWeLink Remote protocol using 433MHz radio to connect to compatible Sonoff devices wirelessly. If you are not sure what problem Sonoff S-Mate2 Extreme is trying to fix, let me explain.

Sonoff S-Mate2 Extreme is a small, battery-operated switch that hides behind a wall switch and needs no external power supply to send the wall switch state to a compatible smart relay via eWeLink Remote. This way, you can easily automate any light switch regardless of your Live and Neutral configuration. As the name suggests, it’s a follow-up to the original S-MATE.

Sonoff S-Mate2 Extreme supports 3 channels and has an even longer-lasting battery (ITEAD claims 5 years): CR2477. It’s the same 1000mAh cell used in the latest update to Sonoff ZB Sensors. Sonoff S-Mate2 Extreme uses 3.3V logic to check the state of each switch and comes with a really cool WAGO-alike (ITEAD is making these now) and requires wires to connect your switch.

To use it, simply mount it behind your switch and pair it with a compatible Sonoff device mounted inside the ceiling rose. The cable linking the walls witch with the light is made redundant and can be terminated safely, or disconnected.

So far the eWeLink Remote compatible devices are:

When connected to a device, the following actions are available for the Automation panel for each channel in the eWeLink app:

  • Click
  • Double click
  • Long press

Note that the actual actions will depend on the type of switch you have connected to your S-MATE2. A small toggle at the side of the switch allows you to select push button mode and toggle mode.

Flashing Tasmota on Sonoff BasicR4

The next step is to integrate Sonoff BasicR4 with my NodeRED-based home automation server. If you don’t want to flash a custom firmware just yet, you can take a look at eWeLink API which allows over-the-cloud, non-invasive integration of Sonoff products, otherwise, follow these steps to flash Tasmota on Sonoff BasicR4.

If this is your first time, there are some things you should note:

  • DO NOT use mains to power your Sonoff device
  • unless you back up the current firmware, there are no ways of going back
  • you are doing this at your own risk
  • eWeLink remote protocol will not function

With this out of the way, some tools are needed. In my guide, I used the following items:

  • FTD Flasher
  • MiniWare TS101 Soldering Iron (review)
  • JimiHome toolset (always handy to have)
  • headers of your choice
  • small knife and heat source
  • small files
  • label maker

Locate the dev pads (3.3V, GND, RX, TX) on the PCB, and solder the header in 90 degree orientation. You can use other headers or solder the wires directly if you don’t need extra pins for anything fancy. I used a hot knife to cut the hole in the enclosure to expose freshly soldered pins, then cleaned up burned edges with small files and printed out a label.

Plug in your FTD using the following schematics (if you have a voltage jumper, set it to 3.3V, don’t use 5V). Bear in mind that sometimes you have to swap RX|TX connections depending on how your FTD is labelled. It’s also important that your USB port supplies enough power. Avoid old USB ports and long USB cables. If you can’t connect with your Sonoff Basic R4, chances are the port isn’t supplying enough power to get it started.

FTD FlasherSonoff BasicR4
VCC3,3V
GNDGND
RXTX
TXRX
GPIO02/8/9 – button?

Hold the button down and power your Sonoff BasicR4. You are pulling the bootstrapping pin to GND while doing so and allowing the device to enter flash mode. Release the button once the device is connected to power from FTD.

I’m going to use the WebInstaller to flash the Tasmota binary file. It’s the most streamlined way to flash your firmware, however, this tool doesn’t offer an option to back up your current firmware. Check out my esptool tutorial if you want to keep the backup of the eWeLink firmware.

Tasmota configuration for Sonoff BasicR4

Unfortunately, there was no ready-made template I could use, so I had to do some pin-hunting. After trial and mostly errors, I came up with the following configuration:

{"NAME":"BasicR4","GPIO":[32,1,1,1,224,1,288,1,1,1,1,0,0,0,0,0,0,0,1,1,3232,3200],"FLAG":0,"BASE":1}

As you can see there are some changes here, but most importantly – I don’t know if this was a bug, but I was not able to map the button. It’s strange as in eWeLink firmware it worked as expected.

Perhaps someone will find the reason why this is not working and I will update the writeup accordingly. The above template has the button specified for your convenience. If you want to learn more, I have a post about using Tasmota specifically.

Adding Matter to Sonoff BasicR4

Thanks to the ESP32 update, the humble basic can support Matter. Flashed with Tasmota, enabling matter support was as easy as enabling the configurator in the menu. However… Nothing ever is as simple. The Sonoff BasicR4 worked beatufily with Amazon Echo, and after scanning the QR code, I could control the device via Matter and through the usual Tasmota options (WebUI, REST, MQTT).

Switching to Google Home, however, posed some problems. Without additional steps, I could not connect Sonoff BasicR4 via the Google Home app. It would complain about it being not Matter certified.

To enable Tasmota as a Matter-certified device, you must follow these steps. Sonoff BasicR4 linked to Google Home without further problems but appeared offline since. I’m not sure what is the problem, but I keep on digging. It looks like going with Alexa was the right call after all.

Final thoughts

It’s nice to see a new Sonoff BasicR4 upgraded and sold at a lower cost. It might be basic, but with a bit of work on your part, you can turn it into an interesting automation scenario. Let me know your most creative use of Sonoff Basic or any other single-channel relay in this Reddit thread.

🆓📈 – See the transparency note for details.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

Smart Ideas with

Automate your space in with these ecosystems and integrate it with other automation services

client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image

Learn NodeRED

NodeRED for beginners: 1. Why do you need a NodeRED server?

0
To server or not to server? That's a very silly question!

Best Automation Projects

Tuya SDK for beginners: Intro to Tuya Cloud API

0
Working with Tuya Cloud API. A guide to Cloud automation for beginners, get started with REST!

NEST your old thermostat under $5

0
Nest-ing up your older thermostat under $5

Sonoff Zigbee Bridge – review

0
Sonoff line up will soon include Sonoff Zigbee Bridge and more Zigbee sensors - here is the first look

DIY Smart Washing Machine – for about 15 bucks!

0
Learn how to add washing machine notifications to your Google Home on the cheap

Nora – Google Assistant in NodeRED

0
Integrate Google Assistant with NodeRED thanks to Nora - NodeRED home automation

Smart Home

I damaged the cheapest Smart Socket with power metering for you

0
Sonoff S60 has an exeptional price for a smart socket with a power meter - I decided to check it out and see how flashable it is

The end of Tasmota? Sonoff SwitchMan M5 Matter

0
These are one of the least expensive Matter devices to automate your lights. Will Sonoff SwitchMan M5 Matter put an end to Tasmota?

Meros TRV to the rescue?

0
I got my hands on another TRV - this time from Meross. I heard good things about the brand so I wanted to see if Meross TRV would be good to manage smart heating.

Aqara brings Thread sensors but…

0
Aqara brings new Thread sensors to their ecosystem. First sensors to support Matter this way are Aqara Motion and Light Sensor P2 and Aqara Contact Sensor P2

Multi-lights for your ceiling from Aqara

0
This is the biggest light I held in my hands so far. It's ZigBee and it comes from Aqara - meet Aqara Ceiling Light T1M