Category Archives: Switches

Review of the first Matter device from Sonoff: Mini R4M

Today, I want to show you a rather interesting and perspective device from a well-known Chinese brand. Should you buy it today? You can read this article to learn about its pros and cons.

SONOFF MINI Extreme Wi-Fi Smart Switch – or MiniR4M – is almost entirely a carbon copy of the MiniR4. Visually, it’s only distinguishable by the plating color on the contacts. It’s green here.

Disassembling the MiniR4M

The build of both devices is also almost identical, the only difference being the controller microcircuit. The previous device has Esp32-DOWD installed, but this one has Esp32-C3.

View from the relay’s side.

The PCB looks like this. The contacts are well-soldered, and the power tracks have a proficient cross-section. Note that the L In and S1 contacts used to connect the relay are interconnected. So, take safety precautions when connecting the device to a 220v network since the relay will have a high voltage.

How to add the MiniR4M to your smart home with eWeLink

Let’s start with the native app for Sonoff devices since you’ll only be able to upgrade its firmware and unlink the relay from the switch in said app.

In the image below, you can see the pros and cons of using the device with different smart home apps compared to eWeLink.

So, let’s hook the MiniR4M to the wires and connect it to the network. Here are multiple possible ways to connect it.

In my case, I connected the Shelly switch (actually a button) to the S1 and S2 connectors, the cable to L In and N, and the lamp to L Out and N.

After its first boot, after a few seconds, a pop-up to add the device to SmartThings has already appeared on my phone. Since I decided to add it to eWeLink first, I closed this pop-up.

So, after the device turns on, an LED will start blinking with a “2 short, 1 long” pattern, which means the device is in pairing mode. If that doesn’t happen, hold the button on the case for ten seconds. The phone should discover the new device. Also, connect your phone to a 2.4GHz network since the MiniR4M does not support 5GHz. One of the steps is entering the password to your Wi-Fi network. Just follow the steps on the screen.

After you add the device to the app, you can control and set it up. On the main screen, only the on/off setting is visible, but there’s way more in the app. From the settings, I’m highlighting “Switch Mode” – here, you can choose the switch type, which you will connect to the relay. In my case, it’s “Pulse Mode.” If you have a regular switch, select “Edge Mode.” In the settings, you can also disconnect the switch from the relay, change the device’s behavior during power loss, turn off the LED, etc.

This amount of features should be enough for the average user, but since Sonoff positions this device as a Matter device, it should work in multiple smart home apps. By default, just as I thought, MiniR4M is a cloud device. So, let’s try to add this device to other systems using the Matter protocol.

And here is where the fun begins…

Attempts to add the MiniR4M to Home Assistant

To clarify, when writing this review, the device received a 1.0.1 firmware update, and the eWeLink app got a 5.0.1 update. So, while reading this text, all the bugs may have already been fixed.

So, to add a Matter device to a compatible smart home system, you must have a QR code. It’s already there on MiniR4M’s case, and it’s also there on the box the device came in. But hypothetically, let’s imagine that the box was already thrown away, and the device was installed on a mounting box that’s inaccessible. Here, the stock app comes to our aid, which can generate the QR code required to pair the device to Home Assistant.

For that, in the app (in the device’s plugin), click the “Enable Pairing Mode” button. In response, we get a pop-up with the QR code and, take note, two underscores without numbers. Meanwhile, the device goes into pairing mode, followed by the LED (two short and one long flash).

For convenience, I printed the screenshot with the QR code and will now attempt to use it to add the MiniR4M to Home Assistant. On the phone, in the Home Assistant app, open “Settings” – “Devices & Services,” then click the “+” button below and select the first option – “Add Matter device.” After a few seconds, the camera app will open, and we must scan the QR code. After we do that, we get an error. The device refuses to connect.

But there’s more. After returning to the eWeLink app, the MiniR4M is offline. To work with it, reset the device to factory settings. For that, hold down the button on the case for 10 seconds. But, of course, you need physical access to the device.

Adding the device to Home Assistant while bypassing eWeLink

Since we already know how to add Matter devices, no additional problems should arise. Hold the button and eventually scan the QR code on the case or the box. The QR code that you printed before serves no use anymore. The device should connect without problems in two tries at most.

In Home Assistant’s Matter integration, the device will use a “Switch” entity by default. You can always change it to a different one, for example, Light. The next part is like always – use the device however you want in Home Assistant with nearly instantaneous response time.

Home Assistant’s Matter integration has a setback. We can’t, at least not in the current version of the Matter integration, “share” the device with a different smart home system. But how does Google Home combat this issue?

Adding the MiniR4M to Google Home

Just like before, put the device into pairing mode by holding the button on the case for 10 seconds. Of course, this will reset the device to factory settings. Theoretically, after that, your phone should “discover” the device and show the corresponding pop-up. All you have to do from there is click the “Add” button and scan the QR code.

If that doesn’t happen, open Google Home. In the second tab, click the “Add +” button, then select “New Device” – “Next.” In the window that opens, select “Matter-enabled device.” Scan the QR code and wait. All left to do is select the room and name the device.

From Google Home, you can turn the device on and off.

But the fun part is that from the app, you can generate a working QR or a pairing code to connect with other systems (or to save it for later). Apart from that, you can directly add the device to pre-installed smart home systems without opening the QR code scanner.

Conclusions

In my opinion, the first Matter device from Sonoff came out interesting and perspective. According to the retailer’s vision, there should be “an out-of-the-box cross-platform experience.” But, considering the device is still recent, it doesn’t work as well as the end user would think. Even in eWeLink, the relay can ignore commands for half a minute. Bugs with QR code generation only bring more inconveniences. Hopefully, firmware updates will make the “fever” go away.

Maybe someone is waiting to install a custom firmware, like ESPHome or Tasmota. Sorry to disappoint, but according to the regulations for Matter devices, the bootloader is locked, which means you can’t change the firmware other than through OTA updates.

So, I can’t recommend this device despite considering its low price, at least for now.

Setting up Lovelace UI on NSPanel

In one of my previous articles, I introduced you to a way to flash NSPanel for better compatibility with Home Assistant. We used ESPhome as a basis, which controlled the ESP32 controller. But we left the firmware of the device screen unchanged, which allowed us not to change the appearance. In turn, the screen with the microcontroller “communicated” with each other using the NSPanel Protocol.

I suppose that someone may not like the standard NSPanel interface. Perhaps you will not even be satisfied with the limited number of screens. Let me remind you that you can switch interface screens using swipes. There are only three of them.

That is why today, I offer you a way to change the NSPanel interface to an alternative one called NSPanel Lovelace UI.

Preparing and flashing NSPanel

I chose Tasmota as the main firmware in NSPanel Lovelace UI. Although it is possible to add an ESPHome component, I didn’t succeed with ESPHome and decided to configure Tasmota. That’s why I’ll tell you about this particular firmware.

So, let’s start with flashing Tasmota firmware to the ESP32 controller in NSPanel. If you, like me, have already installed ESPHome on this device, the easiest way is to “update” over the air (OTA). Go to the NSPanel web interface, select the previously downloaded firmware file from your computer at the bottom of the page and click “Update.” After about a minute, the device will reboot with the new Tasmota firmware.

upload firmware Esphome

If you still have the original “factory new” firmware, you will have to disassemble the NSPanel and download the Tasmota firmware using a USB device, sometimes called a TTL converter. I already told you how to do it in this article.

After flashing and rebooting the device, the microcontroller will not connect to your Wi-Fi because it does not know anything about it yet. It will create its own open Wi-Fi access point with the word Tasmota in the name. Then, connect your smartphone to the network and enter the address 192.168.4.1 in your browser, the temporary address of our NSPanel. Here you can choose your Wi-Fi network and save your password. Save the settings. After rebooting, the NSPanel will connect to your Wi-Fi. I highly recommend specifying a static address for our device in the router settings.

Configuring NSPanel with Tasmota firmware

The first thing to do is to specify a device template for Tasmota. To do this, go to the device’s IP address in the browser. In “Configuration,” click Configure Other and paste the following template code:

{"NAME":"NSPanel","GPIO":[0,0,0,0,3872,0,0,0,0,0,32,0,0,0,0,225,0,480,224,1,0,0,0,33,0,0,0,0,0,0,0,0,0,0,4736,0],"FLAG":0,"BASE":1,"CMND":"ADCParam 2,11200,10000,3950 | Sleep 0 | BuzzerPWM 1"}

Don’t forget to leave the “Activate” checkbox.

Download Berry Driver in Tasmota

  1. Download the autoexec.be file from the Berry Driver repository.
  2. In Tasmota, go to Consoles > Manage File System and download the previously specified file.
  3. Reboot your NSPanel.

Updating the Nextion screen firmware on NSPanel

Now let’s update the screen firmware. To do this, in Tasmota, go to Consoles > Console and, depending on the version, use one of the following commands:

EU Version: FlashNextion http://nspanel.pky.eu/lui-release.tft
US Version Portrait: FlashNextion http://nspanel.pky.eu/lui-us-p-release.tft
US Version Landscape: FlashNextion http://nspanel.pky.eu/lui-us-l-release.tft

Press “Enter.” The firmware download and screen flashing will start. Depending on the network speed, the process may take five minutes. Wait until the download is finished and reboot the device.

Setting up Home Assistant

Installing the AppDaemon plugin

The easiest way to install AppDaemon is through the Home Assistant Supervisor Add-on Store. It will connect automatically to your Home Assistant instance.

Adding the babel package to AppDaemon (optional)

To localize the interface (date in your language), add the babel package to your AppDaemon. In the AppDaemon settings tab, in the python packages field, enter the text “babel” and save the settings.

Installing Studio Code Server and Home Assistant Community Store

To configure the NSPanel Lovelace UI, you will need to edit the apps.yaml file. Editing yaml files will be more convenient in the Studio Code Server interface.

HACS is the Home Assistant community store that will allow you to easily update integrations and community automation through the Home Assistant web user interface. You will get notified about updates. You can install them by simply clicking a button. I already wrote about how to install HACS in my previous articles.

Install Lovelace AppDaemon Backend Application

  1. Click on the Home Assistant web interface on the left menu bar on HACS.
  2. Click “Automations” on the right panel.
  3. In the lower right corner, click “Explore & download repositories.”
  4. Type NSPanel and click NSPanel Lovelace UI Backend in the list that appears.
  5. In the bottom right corner of the panel, click “Download this repository with HACS.”
  6. Now a confirmation panel will appear. Click “Download” and wait for the download.
  7. You now installed The Backend Application, and HACS will notify you when updates are available.

Configure MQTT on Tasmota and in AppDaemon configuration

First, set up a connection to your MQTT server in Tasmota.

Please fill in the “Topic” field as it will be in the configuration. Change “Topic” to something unique for your device, you’ll need it later in the appdaemon/apps.yaml settings.

Now configure the MQTT connection in the AppDaemon configuration file. Please add your MQTT server configuration, user, and password to appdaemon.yaml. Then restart the AppDaemon container after adding the MQTT configuration. You will find this file here: config/appdaemon/appdeamon.yaml
secrets: /config/secrets.yaml

appdaemon:
  latitude: 52.0
  longitude: 4.0
  elevation: 2
  time_zone: Europe/Berlin
  plugins:
    HASS:
      type: hass
    MQTT:
      type: mqtt
      namespace: mqtt
      client_id: "appdaemon"
      client_host: 192.168.75.30
      client_port: 1883
      client_user: "mqttuser"
      client_password: "mqttpassword"
      client_topics: NONE
http:
  url: http://127.0.0.1:5050
admin:
api:
hadashboard:

Configure NSPanel in AppDaemon

Add the following minimum configuration to the apps.yaml file located in config/appdaemon/apps/apps.yaml

nspanel-1:
  module: nspanel-lovelace-ui
  class: NsPanelLovelaceUIManager
  config:
    panelRecvTopic: "tele/tasmota_your_mqtt_topic/RESULT"
    panelSendTopic: "cmnd/tasmota_your_mqtt_topic/CustomSend"

Specify tasmota_your_mqtt_topic according to the topic used in the Tasmota MQTT configuration.

If your settings and configuration are correct, you should see the following screens on NSPanel:

Getting acquainted with an example of a complete NSPanel Lovelace UI configuration

Below, under the spoiler, you will find the full text from my NSPanel configuration file. Also, look at the images of several interface screens of my particular configuration. You can see the screensaver screen with the weather in the header of this article.


That’s it for today. See you!

P.S.

After pressing the switch button, the relay response time of the device with Tasmota firmware became a little longer than it was with ESPhome. Perhaps the reason is that NSPanel is waiting for a command to turn on the relay from Home Assistant. At the same time, in ESPHome, all the “magic” happens only in the device without waiting for a response from Home Assistant.

I changed Tasmota on the NSPanel and installed ESPhome with the Lovelace UI component. You can find the ESPhome configuration file in my GitHub repository at this link. I changed Tasmota on the NSPanel and installed ESPhome with the Lovelace UI component. You can find the ESPhome configuration file in my GitHub repository at this link. Now the switches are working quite lively and, frankly speaking, it is more familiar to me to configure ESPhome.

Introduction to a powerful single-channel WiFi relay Shelly1

Today, I want to acquaint you with an intriguing device. It’s a Wi-Fi relay based on the ESP8266 controller, which is why it will be easy to add to your smart home. In the articles on the site, you have already come across devices from other companies that use ESP32\ESP8266 (for example, Sonoff.) (  1,   2,   3  )

Shelly is a pretty new yet powerful startup from Bulgaria. The company’s devices earn a lot of European and Americal quality certificates, as well as various awards in the smart home field. Shelly has a market on AliExpress and its internet shop with prices in Euros. It has cheap delivery almost worldwide.

Today, this company has a powerful production. Shelly produces a wide range of relays, lighting devices, meters, switches and sockets, wireless buttons, and all kinds of sensors for the smart home.

The hardware part of Shelly 1

You can use Shelly 1 for both remote controlling your outlets and lighting. The advantage here is that you can control the lighting remotely (using an app) and the usual switch simultaneously.

As you can see in the photo, the device is compact. The main task in its development was to make sure that the device fits into an outlet box with an outlet or switch body. Let’s look at how engineers succeeded in this task. Below, there are two outlet boxes for plasterboard, one being deeper.

As you can see, in the first photo with a smaller outlet box, the body of an outlet or a switch will protrude about three to four millimeters. Take this into account when buying electrical before repairs. Also, find a place for wires. I must say, I used a standard outlet. There are also those whose body is slightly distant from the plane of the wall.

If you use switches, pay attention to the flex switch I already wrote about, its interior is very compact, and the switch won’t “look” out of the outlet box.
We see a deeper outlet box in use in the second photo. When using a case of similar size, there shouldn’t be any problems with free space for Shelly 1. Besides, you can place Shelly 1 in a regular mounting box.

One of Shelly 1’s wiring diagrams can be like this:

When mounting, note that the relay of the device can take up to 16A. As you already understood, you don’t need the switch to control the relay. Terminals “0” and “I” are relay outputs, and such contacts are named “dry” sometimes. It is because they don’t connect to the main logic circuit of the device. In theory, you can connect devices with a low supply voltage to such contacts and control the supply of voltage to such devices using Shelly 1. The supply voltage on the Shelly 1 relay should apply to the terminals “L” and “N.”

The device’s power supply voltage range is extreme, from 110V to 240V alternating current or 24-60V direct current. You can also change the power mode using a jumper on the case, and then the power supply voltage will be 12V DC. The jumper is under the plug, and getting to it can be quite hard.

There is a connector nearby where you can download custom firmware for Shelly 1, but I don’t think there’s much point in doing that. The fact is that Shelly allows you to unpair your devices from your cloud and enable local management. Such actions make it possible to control Shelly 1 from alternative smart home management systems, such as Home Assistant. In addition, you can control the relay even from the browser.

Configuring and managing devices in the Shelly app

Firstly, download and install the official Shelly application on your smartphone. Then register your account, which allows you to manage Shelly devices from anywhere in the world where there is access to the network.

To set up and add the device to your home, connect the wires as shown in the photo below.

Once turned on, Shelly 1 will create its Wi-Fi hotspot, and you can now connect and configure your device. To do this, select the “Add device” item in the menu. Once detected, you will see it in the list. Then you can add it to the necessary room or change the picture of the device.

To go to Shelly 1’s settings, click on its image in the “room window.” As you can see, the list of possible parameters is big. We can use the timer and schedule of the device. Below, in the “Cloud” section, we can disconnect the device from the cloud. In the “Settings” section, you will find the settings of Shelly 1 regarding the device behavior after power loss. There are four options for the status after power-on: “on”, “off”. “save state after power consumption”, and “according to the state of the switch”. In my opinion, this is a unique and quite useful feature. In addition, in the settings, there is an opportunity to indicate which switch you will use, keyboard (button, flex), or regular.

It is also interesting that we can choose what our relay will control, for example, an outlet or lighting.

In the settings, we can also reboot the device, remove it or reset it to factory settings.

Shelly 1’s web interface

To access the web interface of Shelly 1, you need to know its IP address. To do this, you can look at the address in the router settings. But, to not do it every time, you should set a static IP address for the device. The interface of the page is a bit like the interface of the application, but in my opinion, a larger computer screen will be more comfortable.

There are even more settings here than in the mobile version. One of the more interesting points in the web interface is the ability to enable and configure MQTT. But you are warned that turning it on will disable the cloud connection, which is not a huge loss when the possibility of controlling the device in alternative smart home systems appears.

Shelly 1 and Home Assistant

As soon as the Shelly device appears on your local network, Home Assistant will immediately “see” it.

All you have to do is confirm the configuration settings and choose a room for the device. By the way, the device that “flies” into Home Assistant is the same device you selected in the Shelly app. Now you can control the device with Home Assistant and the response time is almost instantaneous.

Sonoff POW Elite – power meter with relay, WiFi. Up to 20A

Approximately a week ago, in the official internet shop of a Chinese company Sonoff two devices appeared, marked as POWR316D and POWR320D. It’s the same device, with two modifications that differ only in the maximum allowable current flowing through it. And these are 16 and 20 Amps. I will review the devices as one, and the user must know the difference between the models when ordering the device.

SONOFF POW Elite features

  • Model – POWR316D/POWR320D
  • Case material – PC V0
  • Dimensions – 98x54x31 mm (DIN Rail mountable)
  • Input/Output – 100-240 В 50/60 Hz, 16A/20A Max
  • Wi-Fi – IEEE 802.11 b/g/n 2,4 GHz
  • WiSoC – Espressif ESP32 240 MHz with connection to Wi-Fi 2,4 GHz and Bluetooth 4.2

From the specifications, it is clear that the “brain” of the device is already familiar to us ESP32. Theoretically, we can change its firmware to alternatives called Tasmota or ESPhome.
The power meter has the possibility of mounting on a standard DIN rail.
You can install several such devices in an electrical switchboard and control the supply voltage, for example, outlets in your home. In this case, you should ensure a stable Wi-Fi signal between your router and the power meter in the shield. After all, its metal body can shield the passage of radio waves between devices. I will also warn readers against such a power meter at the main entrance to the apartment or house since its allowable power will not be enough for all your appliances.

Terminals for connection for both input and voltage output wires are in the lower part of the housing. There are four terminals, and you clamp the wires with screws. To access the clamping screws, remove the cover on the bottom of the housing. On the case near screws, there are markings for the corresponding wires.

At the top of the case above the display are status indicators with a single button to control the relay. This button also performs a device reset function.

eWeLink app features

The program interface is the same for almost all switches. Here’s quick access to the relay state switch from the card and the main menu. Detailed information on power consumption is also displayed here. The following information will be available to users

  • Electricity consumption for today (kWh)
  • Electricity consumed yesterday (kWh)
  • Electricity consumed per month (kWh)
  • Current (A)
  • Voltage (V)
  • Power (W)

The settings section will show the power status, we can turn on local control, and we can add schedules, timers, and cycles. Other settings allow you to add notifications based on relay status or power consumption goals for the day or month.

The values on the display and in eWeLink are updated every 5 seconds.

Smart Controls

eWeLink is compatible with smart speakers from Alexa and Google Home.
There is a possibility of integration with SmartThings. But unfortunately, you can’t control anything but turning the relay on or off. It is not possible to obtain information on electricity consumption through such integrations. There will be alternative firmware for the device. It’s probably already made. Both Tasmota and ESPHome allow you to transfer power usage statistics to Home Assistant, and from there, you can send them to Alexa or SmartThings.

What’s inside

Usually, Sonoff devices come with everything needed to tinker with the firmware, and the Sonoff POW Elite is no different. The PCB contains contacts for ESP32 (TC, RX, GND, Vcc), and something tells me that the button links to GPIO00, which enables the firmware mode.

The antenna got printed to the PCB. Unfortunately, there is no connector for connecting an external antenna, which makes another argument against a weak Wi-Fi signal.

The display controller chip is on the same side as the ESP32, with several contacts next to it to connect to the display itself. By the way – the screen has no backlight, which can be inconvenient at night. On the other hand, few control electricity consumption in the middle of the night.
ЗOn the back of the PCB, we see the elements of the power supply system (small transformer, capacitors, and filters). The large item on this side of the board is the relay.

This relay exactly controls the supply of voltage to the output of the power meter. In my opinion, the manufacturer could install a more powerful relay because, as you can see in the photo, there is more than enough space on the board. Maybe in a while, we will see an updated model of this power meter from Sonoff, but already designed for more power. It would be interesting to install one at the entrance to your home to control the electricity consumption inside your home. Logically, such a power meter would cost more, but I think the price here would differ only due to the cost of a more powerful relay.

Meeting the NSPanel switch and flashing ESPHome

Last year, the Chinese company Sonoff started crowdfunding, where they presented an interesting smart device. By the end of 2021, Sonoff introduced NSPanel. This device is a rectangular device with a colored touch display sized 3,5 inches and two physical buttons.

The touch display was also created by Sonoff, this is a Nextion model.

There are two versions of the NSPanel, and they differ only in size. One is for the US market, and the other one is for the EU countries. The power and logical parts of the devices are the same. As a “brain“, the company chose the Espressif ESP32-DOWD V3, which allowed working in Wi-Fi 4 802.11n/g/n networks. Bluetooth 4.2/5.x is only used when setting up the device.

Connecting NSPanel to the power grid

To set up and control the device you need to download the eWeLink app, it must be familiar with Sonoff devices owners. If you do not have an account yet, create it, or log onto your account. eWeLink lets you control connected devices from all around the world where the Internet connection is established.

So, to connect the NSPanel on the phone you need to turn on Bluetooth. After that, connect the device to the power grid.

Use safety precautions when working with high voltages!

In the eWeLink app press “add new device“. Then, you will see the device on the screen, tap on it to add it. Then, you may need to enter your Wi-Fi credentials. After connecting, the NSPanel most likely will ask you to update its firmware. Do it, because this update may contain bug fixes or performance improvements. The update may take a while.

The power part of the switch includes two relays that can withstand up to 16A of current. This means that you can connect two additional electric devices. It could be not only lighting devices but also, for example, a warm floor controller. Below is a switch connecting scheme.

Setting up the NSPanel in eWeLink

In the eWeLink application, you can switch one of the switch relays to thermostat mode, then the built-in thermal sensor can control the temperature in the room. For the thermostat, choose the heating or cooling mode depending on the device you want to connect (heater or cooler). Set the target temperature in the room and the device will turn off when it reaches the target temperature.

To reach the thermostat screen on the switch, swipe right on its screen. One more swipe will lead you to widgets. These are pictograms with which you can control other smart devices. This way you can control plugs or bulbs, and also their groups. In addition, you can create widgets to load a scene.

You need to create widgets in the eWeLink app. The max widget number is 8.

To control the device using voice assistants create the appropriate integration in the eWeLink app. In addition, Sonoff allows controlling the switch in a local network, which enables integrations into alternative smart home control systems. Enable the corresponding item in the device settings.

Getting ready to launch ESPHome

I think that this smart device is “smart” only when it can work independently of cloud services. NSPanel can work locally but sadly, its widgets don’t work without a network connection. Essentially, you can only control two relay devices through a local network.

Just as I stated above, the logical part of the switch is a Nextion display that is connected to the esp32 controller. Such a tandem gives us hope for the ability to easily load alternative firmware. And really, “tasmota” firmware already exists for our device, work on creating an NSPanel component for ESPhome is also in full swing.

Let’s look at the PCB of the logic unit. To take it out, lightly press the screwdriver on the groove in the center. Remember to turn off the power beforehand!

Now you need to unscrew two screws that hold the protective plate. After you carefully remove the plate, you will see the PCB with the esp32 controller microcircuit.

You will see 5 contacts in the lower corner. They are marked as 3V3, ESP_TX, ESP_RX, GND, and IO0. The last contact is a “zero” pin controller. To switch the controller to firmware mode, connect it to the neutral wire.

To flash the controller’s firmware, you will need a usb2uart (USB to TTL converter) adapter. Before you connect it to the computer, set the voltage to 3.3V, this is important!

Using Dupont wires, connect the adapter to the PCB: VCC – 3V3, GND – GND, RX – ESP_TX, TX – ESP_RX. Connect the IO0 pin on the PCB to the neutral wire on the contact pad (green wire on the picture)

Pay attention: If the Dupont wire contacts protrude beyond the contact holes on the board, they will touch the metal plate of the display. This can lead to a short circuit and both the USB adapter and NSPanel chips failure! To avoid this, disconnect the display cable and remove the PCB from the chassis.

Downloading ESPHome onto the NSPanel

Now you can confidently download the ESPHome firmware. Connect the USB adapter to the computer, and in the device manager, look what COM port it received. Now, in the ESPHome interface, you can create a new node. To be honest, downloading empty code onto esp32 and then working with the created node using Wi-Fi would be enough. To do this, select the firmware option of the ESP controller connected to the computer. Then, select the COM port in the popup. Downloading the firmware takes a few minutes. The contacts need to stay connected!

After the firmware is loaded, disconnect the wires and assemble the switch. After connecting the NSPanel to the network, you can use the switch just like a regular esp32 controller. Now let’s download an already prepared code.

After reboot, the switch will have a familiar interface. I want to warn you: There’s no official thermostat support, so I didn’t add it in the code. The thermostat, just like some widgets, could be added by JSON requests. The format which JSON should have can be read here. And here you can find another variant of the code, already bundled with some widgets and a thermostat. One thing, you will need to replace the device IDs with yours.

For an example of scene widgets, I added code that will turn off melodies on the built-in NSPanel booster (piezodynamic). You can add and load any scene with Home Assistant.

After the official release of NSPanel components for ESPHome, I plan to update the article, so check for updates. In addition, there is a way to fully change the interface and switch from the NSPanel Protocol, since onboard of the switch we have Nextion display and esp32, but that is a topic for another article.