[PLUGIN] Tasmota Power Monitor


Recommended Posts

Hi guys,

 

I want to introduce you to my Tasmota Power Monitor.

 

With this UnRaid plugin you can turn a Tasmota device into an energy monitor for your server.

I got the idea from corsairpsu-unraid, but since I don't have a suitable Corsair PSU, I found an alternative in a Tasmota Power Plug.

 

It shows the most common measured values and offers the option of costing for electricity consumption.

 

Dashboard:

grafik.png.c93a5b683b5f81032d83b20382f26aac.png

 

Settings:

grafik.png.a3170d5d1f22a5012fa7d8781cbb7ee2.png

The password is saved in plain text.

 

Introduction

Before you start, be sure that you protect your Tasmota device against incorrect operation. So that you don't accidentally turn off your server. I solved this for myself with the command: PowerOnState 4 This sets the on / off switch in the WebUI and on the device to always on. Therefore, check what would be best for your device before using it. Have a look at the Tasmota Documentation. Use the plugin and device at your own risk. I will not be responsible for any damage.

 

I use an Aisirer Power Monitoring Plug (AWP07L) with Tasmota firmware 8.5.1 and this template. {"NAME":"AWP07L","GPIO":[56,255,255,255,255,134,255,255,131,17,132,21,255],"FLAG":0,"BASE":18}

 

 

Created and tested with Unraid 6.9.1.

 

Installation as usual...

https://raw.githubusercontent.com/Flippo24/tasmotapm-unraid/main/tasmotapm.plg

  • Like 4
Link to comment

By checking around which smart plug fit this project, this is quite hard to confirm or buy a suitable hardware.

Seems Sonoff POW R2 is right thing to do that, ESP32 solution with unknow power metering chips ( suppose same chips / driving method as your smartplug ), so I have buy one for try.

 

Do you identify the efficiency reading quite low, does all reading come from Smartplug, none of that generate by plugin ? ( or it should be 94% instead 0.94% )

 

Thanks your Plugin !!!

 

Below are the video about flash POW-R2 with Tasmota firmware

 

Edited by Vr2Io
Link to comment
11 minutes ago, mrbilky said:

This should work sonoff s31 I have a half dozen flashed with Tasmota and integrated into home assistant

Does s31 have power metering feature ( circuity ) ?  It have, seems it is US version. So good.

 

image.thumb.png.630cc2dc15a293cd16271b66d318f13d.png

Edited by Vr2Io
Link to comment

Take a look at Tasmota Device Templates Repository. There you will find many devices that have a measurement option. Which exactly one owns cannot not say. Often, however, there is a power monitoring plug in the title. If you go to a device there is often something like "For more accurate energy consumption measurements this device requires power monitoring calibration". And in the GPIO table there are more entries than relay, button and LED. Compare it to other devices. Maybe that will help you with the selection.

 

The plugin only reads the values from the device. It sounds as simple as that. It shows the data that are called in the WebUI console with the Status 8 command. Only the price calculation takes place in the plugin. So power * price.

 

Nice Vr2lo you found the first bug. Of course you are right. It has to be 94%. This is shown as a factor in the WebUI. Will correct it. Maybe there will be some more. Then it's worth it.

 

  • Like 1
Link to comment
29 minutes ago, ich777 said:

@Flippo Thank you for the great Plugin!

Would it be eventually possible to integrate espurna: Github?

 

He also has a neat little RESTAPI that you can get data from: Click

Can you open a separate topic for it and post the url with all parameters for your request and a json with the answer. Then we can discuss it there. I think that it would be better off in a separate plugin. The structure would be almost identical.

Link to comment

Just a feedback, Sonoff POW R2 work great. I short the relay output, so won't power off out of expectation, then set "SetOption21" to 1 (Energy monitoring when power is off) to save unnecessary power usage from relay.

 

Thanks this plugin.

 

image.png.64aea41e12c65d488a29d9ebb2335c34.png

 

Screen shoot of communication / flash firmware under Unraid, install 3 component

 

image.png.a2acc21207bdd3082ad40c84ba34af67.png

 

image.thumb.png.2c5d05bf5e30ea67b60efe679eaabf10.png

Edited by Vr2Io
Link to comment
  • 2 weeks later...

This plugin breaks the layout.

 

I can't arrange the dashboard widget, the sort order randomly changes.

The widget is sometimes shown twice, but the corsair widget disappears.

 

Did you change the html classes while adapting from the Corsair PSU Plugin, because i use this also.

 

tnxs greetz Stefan

 

 

grafik.thumb.png.c501451133903087a2626f96aef317ac.png

Edited by corgan
Link to comment
  • 1 month later...
On 4/13/2021 at 5:06 AM, corgan said:

This plugin breaks the layout.

 

I can't arrange the dashboard widget, the sort order randomly changes.

The widget is sometimes shown twice, but the corsair widget disappears.

 

Did you change the html classes while adapting from the Corsair PSU Plugin, because i use this also.

 

tnxs greetz Stefan

 

 

grafik.thumb.png.c501451133903087a2626f96aef317ac.png

 

Hi Stefan,

maybe a bit late, sorry. I need to change the code a bit. Previously, I had the same problem with multiple ads when moving. Take a look at the use of @sortnr.

status.page

This was previously a fixed number. Now it is dynamic. I had a really hard time with this error. The table header has now been moved to the table body. It doesn't make sense, but otherwise I couldn't get it to work.

 

  • Like 1
Link to comment
  • 2 months later...

Can this plugin be searchable from Community applications?

I have a cheap tuya plug (BSD33), ripped the plug apart, flashed tasmota, calibrated power metering, and conected with the plugin. Works fine, although I would like to read the power consumpltion with MQTT and not http.

Link to comment
2 hours ago, Maor said:

read the power consumpltion with MQTT and not http.

Tasmota support MQTT and Http in parallel run.

 

I apply power off if power usage larger then xx watts ( actually won't power off due to I already short the reply switch ), then as result LED will on if power usage larger then xx watts and off once less.

 

20:22:40.842 MQT: stat/tasmota_B88B5C/WARNING = {"Time":"2021-08-29T20:22:40","MaxPowerReached":90}
20:22:40.856 MQT: stat/tasmota_B88B5C/RESULT = {"POWER":"OFF"}
20:22:40.861 MQT: stat/tasmota_B88B5C/POWER = OFF
20:22:46.876 MQT: stat/tasmota_B88B5C/WARNING = {"Time":"2021-08-29T20:22:46","MaxPowerReached":91}
20:22:46.890 MQT: stat/tasmota_B88B5C/RESULT = {"POWER":"OFF"}
20:22:46.895 MQT: stat/tasmota_B88B5C/POWER = OFF
20:22:52.842 MQT: stat/tasmota_B88B5C/WARNING = {"Time":"2021-08-29T20:22:52","MaxPowerReached":90}
20:22:52.858 MQT: stat/tasmota_B88B5C/RESULT = {"POWER":"OFF"}
20:22:52.863 MQT: stat/tasmota_B88B5C/POWER = OFF

 

Edited by Vr2Io
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.