Flippo Posted March 22, 2021 Share Posted March 22, 2021 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: Â Settings: 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 9 Quote Link to comment
Vr2Io Posted March 23, 2021 Share Posted March 23, 2021 (edited) 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 March 23, 2021 by Vr2Io Quote Link to comment
mrbilky Posted March 23, 2021 Share Posted March 23, 2021 (edited) This should work sonoff s31 I have a half dozen flashed with Tasmota and integrated into home assistant Edited March 23, 2021 by mrbilky Quote Link to comment
Vr2Io Posted March 23, 2021 Share Posted March 23, 2021 (edited) 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.  Edited March 23, 2021 by Vr2Io Quote Link to comment
ich777 Posted March 23, 2021 Share Posted March 23, 2021 @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 Quote Link to comment
Flippo Posted March 23, 2021 Author Share Posted March 23, 2021 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. Â 1 Quote Link to comment
Flippo Posted March 23, 2021 Author Share Posted March 23, 2021 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. Quote Link to comment
Flippo Posted March 25, 2021 Author Share Posted March 25, 2021 I fixed the incorrect display of efficiency. A few problems that occurred when shifting the display within the dashboard should also be resolved. 1 Quote Link to comment
Vr2Io Posted March 30, 2021 Share Posted March 30, 2021 (edited) 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.   Screen shoot of communication / flash firmware under Unraid, install 3 component   Edited March 30, 2021 by Vr2Io Quote Link to comment
Flippo Posted April 9, 2021 Author Share Posted April 9, 2021 On 3/23/2021 at 11:05 AM, 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  Wishes sometimes come true. Here it is...  1 2 Quote Link to comment
ich777 Posted April 9, 2021 Share Posted April 9, 2021 Much appreciated! Thank you @Flippo Quote Link to comment
corgan Posted April 13, 2021 Share Posted April 13, 2021 (edited) 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   Edited April 13, 2021 by corgan Quote Link to comment
kevinshane Posted April 14, 2021 Share Posted April 14, 2021 awesome job, could you please support multiple sonoff pow? Quote Link to comment
Flippo Posted June 11, 2021 Author Share Posted June 11, 2021 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    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.  1 Quote Link to comment
Maor Posted August 29, 2021 Share Posted August 29, 2021 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. Quote Link to comment
Vr2Io Posted August 29, 2021 Share Posted August 29, 2021 (edited) 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 August 29, 2021 by Vr2Io 1 Quote Link to comment
HrzM Posted February 15, 2022 Share Posted February 15, 2022 (edited) On 4/14/2021 at 12:07 PM, kevinshane said: awesome job, could you please support multiple sonoff pow? Â Late reply. Same Problem. I edit /usr/local/emhttp/plugins/tasmotapm/status.php and add the number of channel to the array, looks like this: $json = array( 'Total' => $data['StatusSNS']['ENERGY']['Total']['0'], 'Today' => $data['StatusSNS']['ENERGY']['Today']['0'], 'Yesterday' => $data['StatusSNS']['ENERGY']['Yesterday']['0'], 'Voltage' => $data['StatusSNS']['ENERGY']['Voltage'], 'Current' => $data['StatusSNS']['ENERGY']['Current']['0'], 'ApparentPower' => $data['StatusSNS']['ENERGY']['ApparentPower']['0'], 'ReactivePower' => $data['StatusSNS']['ENERGY']['ReactivePower']['0'], 'Factor' => $data['StatusSNS']['ENERGY']['Factor']['0'], 'Power' => $data['StatusSNS']['ENERGY']['Power']['0'], 'Costs_Price' => $tasmotapm_costs_price, 'Costs_Unit' => $tasmotapm_costs_unit ); Â On http://IP_OF_YOUR_DEVICE/cm?cmnd=Status%208 you seen the number of the channel you need. Â Â Â Edited February 15, 2022 by HrzM Quote Link to comment
mbc0 Posted May 6, 2022 Share Posted May 6, 2022 Thanks for this fantastic plugin! would it be possible to add multiple plugs? I have 16 in the house and would be great to have one place to look at all of them 🙂 1 Quote Link to comment
1471 Posted October 26, 2022 Share Posted October 26, 2022 Stumbled across this plugin when watching THIS video on reducing power usage, works well! Â As others have mentioned, should get its added to the CA store so its easier to find as really good! Quote Link to comment
Seduron Posted December 7, 2022 Share Posted December 7, 2022 The "Nous A1T" Power Plug fits also for this Plugin. Works Great  Thanks a Lot ! Quote Link to comment
Twix Posted December 27, 2022 Share Posted December 27, 2022 Does this plugin still work? I use a tasmota device with 12.3.0 and I have no values at all on the dashboard. They are just empty. Quote Link to comment
Vr2Io Posted December 28, 2022 Share Posted December 28, 2022 (edited) On 12/27/2022 at 7:18 PM, Twix said: Does this plugin still work? I use a tasmota device with 12.3.0 and I have no values at all on the dashboard. They are just empty. 12.3.1.2 no problem.  You can enable web debug logging and check the error in web console  20:51:01.642 HTP: Command 20:51:01.651 SRC: WebCommand from 0.0.0.0 20:51:01.653 HTP: Bad userid and/or password  20:54:41.001 HTP: Command 20:54:41.006 SRC: WebCommand from 192.168.X.X 20:54:41.009 CMD: Grp 0, Cmd 'STATUS', Idx 1, Len 1, Pld 8, Data '8'  Edited December 28, 2022 by Vr2Io Quote Link to comment
Civic1201 Posted February 23, 2023 Share Posted February 23, 2023 I am having problems with this plugin and my flashed to latest Tasmota (12.4.0) Shelly Plug S. When the script is activated the Shelly will reconnect from time to time (flashing LED for WLAN) + lose power for 0.5 seconds. The idea was to use the plug for monitoring only my Unraid server. With all the reconnects it will be a nightmare.. When disabling the script everything is fine and there are no disconnects. Any ideas? Quote Link to comment
Keith Morden Posted March 14, 2023 Share Posted March 14, 2023 Is it possible, to save the stats to e.g. influxdb or another db? especially to use it for grafana? Quote Link to comment
NickI Posted March 14, 2023 Share Posted March 14, 2023 Amazing work, thank you! I came across this plugin while i was searching for a way to transmit the ups power consumption readings via mqtt to my home assistant setup. Do anyone know if something like this even exists? Quote Link to comment
Recommended Posts
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.