HomeHome AutomationFlashing Tasmota on Sonoff POW R2

Flashing Tasmota on Sonoff POW R2

Make it yours!

It was a matter of moments before I decided to ditch the eWeLink app and flash Tasmota on Sonoff POW 2. If you are interested in off the box functionality, take a look at the hands-on post. I’m going to turn my soldering iron on and start hacking. We all knew this was coming.

Modifying PCB on Sonoff POW 2

I have to give it to the ITEAD guys, they made a splendid job in making this Sonoff board hackable. All you have to do is to add the female header or male pins to the dev pads and you are off to the races.

I had female headers available so I picked a 1×6 header and soldered it neatly to the board. It’s a 5 min job, even if you have to wait for your soldering iron to heat up. It used to be the case, but not any more thanks to YIHUA 992DA+.

I’m sure you have noticed neatly labelled pins on the PCB. For a moment, I wondered where is GPIO00, which is needed for Tasmota, but a quick inspection of the ESP8266EX on the PCB reveals that the pin is mapped to the physical button! Awesome!

Flashing Tasmota on Sonoff POW 2

Tasmotizer tool makes flashing a breeze, so use this guide to flash the firmware and configure Tasmot for Sonoff POW 2. I would strongly recommend, that you back up your firmware first and rename it to match the device you are backing up. Consider using a permanent pen to mark your device accordingly (inside the enclosure?) as the backup of the firmware is device-specific.

DO NOT connect the Sonoff POW to mains during the operation. FTD1232 is more than capable to keep the ESP8266 alive for the flash.

Sonoff POWFTD1232
VCC3.3V (or VCC)
GNDGND
RXTX
TXRX

Buy Sonoff POWR2

Buy it using these links to support NotEnoughTech.

Using Tasmota on Sonoff POW 2

If the flash has been successful and you didn’t configure Tasmota on Sonoff POW R2 it will advertise as new AP. Connect to it and load the configuration page. The device’s IP should be 192.168.4.1 but double-check this in the WiFi manager. You are looking for the gateway IP address.

The first configuration mage will ask you for the WiFi credentials. Fill that in and wait for the Sonoff to reboot. Remember, at this point, your Sonoff POW R2 will have a new IP assigned to it by the router. In the tasmota screen, go to Configuration/Configure Module and select the Sonoff POW R2 (or POW if you are using older board). This will map the buttons, lights and power consumption details.

MQTT

It’s the most convenient (but not only) connection protocol for your Sonoff, visit Configuration/Configure MQTT to connect to your broker. I recommend the following changes:

  • client ID
  • topic
  • reverse %prefix%/ %topic%/ to %topic%/%prefix%/

I’m swapping the topic and prefix around as I find it more convenient to read. Don’t worry too much about this, as the correct topic format is visible in the Console option in the Tasmota firmware. Copy it from there to your MQTT setup.

The MQTT topics will depend on your configuration, so you have to adjust the topics in my examples. I have included some basic flows in my NodeRED, so you can see how you can trigger the relay and how you can intercept the state and power use data.

The MQTT rate of data is set by default to 300 sec. If you need the energy info posted more often, check out the Configuration/Configure Logging menu and adjust the Telemetry value.

HTTP

MQTT is not the only way to control the device. You can do so with HTTP endpoints. If you want to secure the HTTP endpoints with a password (which you should), visit the Configuration/Configure Other, menu. To create the HTTP POST Request use the format below.

https://xxx.xxx.xxx.xxx/cm?cmnd=Power%20TOGGLE 
xxx.xxx.xxx.xxx = Sonoff's IP
Power = command type
TOGGLE = value

https://xxx.xxx.xxx.xxx/cm?&user=USERNAME&password=PASSWORD&cmnd=Power%20On USERNAME,PASSWORD = use your web access credentials in sonoff settings
xxx.xxx.xxx.xxx = Sonoff's IP
Power = command type
On = value

//Get power info
https://xxx.xxx.xxx.xxx/cm?&user=USERNAME&password=PASSWORD&cmnd=Status%208
USERNAME,PASSWORD = use your web access credentials in sonoff settings
xxx.xxx.xxx.xxx = Sonoff's IP
Status = command type
8 = value

In this post, you will find the list of all commands that you can issue. The list is long and the commands listed can take more than one parameter. The response given will contain a JSON object with the current device state. If you want to learn more about JSON I have the basic tutorial for you.

Conclusion

Tasmota on Sonoff POW R2 is the way to go! I’m going to use the new device for 2 projects. One Sonoff POW R2 will drive my 3D Printer and provide power use calculations for each print in my mobile notifications project. The other one will monitor my washing machine, as I’m constantly forgetting about it. What other uses could you think of? Let me know in the Reddit discussion thread.

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.

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

Nora – Google Assistant in NodeRED

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

DIY Smart Washing Machine – for about 15 bucks!

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

Things they don’t tell you about IKEA Trådfri

0
There are things you should know about IKEA Tradfri before you make your purchase

Smart Home

Never mind Evvr Smart Switch, look at that panel!

0
Evvr Smart Switch brings 2 part module to enable no-neutral ZigBee and Z-Wave connections to your wall switches turning them smart without compromise!

Aqara TRV will support Matter!

0
Aqara just released Aqara TRV - their ZigBee 3.0 thermostatic radiator valve to control your heating - with... Matter support

Shelly Motion2 is EVERYTHING

0
I always wanted a universal node that delivers all environmental data at once - Shelly Motion2 comes very close to that.

Sonoff NSPanel Pro is missing everything!

0
Today, on "how not to launch a product" we revisit a launch firmware for Sonoff NSPanel Pro - a new smart panel from ITEAD that looked very cool at first...

Shelly Pro 4 PM: everything *4

0
I'm ashamed. Shelly Pro 4 PM had been on my shelf for months now, waiting for my time and attention. I really wanted to cover it sooner rather than later, but Shelly had other things that caught my eye including no-neutral Shelly L and...