[PLUGIN] Tasmota Power Monitor


Recommended Posts

Most likely, without an update to the plugin, simply having it installed will prevent the dashboard from loading.  Since it is outside of CA's control (author could never be bothered to publish) there's no warnings etc I can give regarding this short of this post and the usual warning from FCP about "Unknown plugin installed"

Link to comment
  • 2 months later...
21 hours ago, Wetterchen said:

Confirm thats plugin is not working on 6.12 anymore. 
So i hope somewhere can update this plugin. 

I have created new page files for 6.12

 

image.png

 

These need to be loaded into /usr/local/emhttp/plugins/tasmotapm/

 

I would create a temp dir as /boot/tasmota and put files here

 

cp /boot/tasmota/* /usr/local/emhttp/plugins/tasmotapm/ into go file for now. Will try and create a plugin at somepoint or @Flippocould add to his repo and publish.

 

status.page statusmove.page

  • Like 1
  • Thanks 1
Link to comment
30 minutes ago, SimonF said:

I have created new page files for 6.12

 

image.png

 

These need to be loaded into /usr/local/emhttp/plugins/tasmotapm/

 

I would create a temp dir as /boot/tasmota and put files here

 

cp /boot/tasmota/* /usr/local/emhttp/plugins/tasmotapm/ into go file for now. Will try and create a plugin at somepoint or @Flippocould add to his repo and publish.

 

status.pageUnavailable statusmove.pageUnavailable

 

You're a legend 🥳

 

You beat me to it, was just looking at your repos git history (mainly the NUT one) to see what updates were required to migrate from 6.12 and how that would translate to this project.

 

My first time looking at Unraid plugins, but I'm a senior dev by trade so was giving it a go, looking through dev threads and 6.12 update changes to try and reverse what needs updating.

 

Looks like the dev wants a new owner for the projects:

 

Would you mind doing what you did for the NUT and IPMI projects and taking ownership? The plugin also requires posting onto CA as its currently unlisted.

 

I can take what you've done and publish a fork, with some guidance as this is the first Unraid plugin I'm looking at (especially CA publishing), but you seem to know what you are doing 😉

Edited by unraidyn
Link to comment
12 minutes ago, unraidyn said:

 

You're a legend 🥳

 

You beat me to it, was just looking at your repos git history (mainly the NUT one) to see what updates were required to migrate from 6.12 and how that would translate to this project.

 

My first time looking at Unraid plugins, but I'm a senior dev by trade so was giving it a go, looking through dev threads and 6.12 update changes to try and reverse what needs updating.

 

Looks like the dev wants a new owner for the projects:

 

Would you mind doing what you did for the NUT and IPMI projects and taking ownership? The plugin also requires posting onto CA as its currently unlisted.

 

I can take what you've done and publish a fork, with some guidance as this is the first Unraid plugin I'm looking at (especially CA publishing), but you seem to know what you are doing 😉

Are you able to test with a real device as i only used test data as dont have hw 

 

needs a code tidy still also

Link to comment
53 minutes ago, unraidyn said:

 

Currently waiting on a time frame to update my box, will report back with findings, will probs be an hour or so.

Created fork and adding to ca. Make take time to appear.

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

 

Link to comment
32 minutes ago, SimonF said:

Created fork and adding to ca. Make take time to appear.

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

 

 

You amazing person you!

 

Just updated to 6.12, relitively smooth but had a panic with "Unmountable: Unsupported or no file system" after enabling the "Permit exclusive shares:" option. Luckily a reboot fixed it, panic over for now.

 

Now to take a look at this!

 

349496925_Screenshot2023-06-16at22_35_26.thumb.png.5eda8d327aefd30ba6c4dd9f6a0432be.png

 

Appears to be working - however, there appears to be a pretty nasty bug.

 

After a few seconds (iterations), the values stop updating at the set interval (tried at the default 1000ms, 2000ms, etc) and instead start racing along faster and faster until either the tab or browser crashes.

It also caused the plug to overload and reset as well, presumably due to the amount of requests being performed overloading its little webserver.

 

There is a video of it malfunctioning attached.

 

 

 

This is with the default polling rate of 1000ms, in FireFox 114.0.1.

 

Now that to me smells like instance stacking or something recursive calling successive setIntervals, causing it to scale exponentially. I'll start to debug, remembering to refresh regularly haha

Edited by unraidyn
specifics
  • Like 1
Link to comment

Doing some debugging, it appears to be an N+1 problem. For some reason, the network calls to `/plugins/tasmotapm/status.php` are being stacked upon each setInterval call.

 

When each interval passes, by default every 1000ms, N+1 calls occur. Thats how it spirals so quickly.

Link to comment

Found the problem, it is indeed recursion:

 

https://github.com/SimonFair/tasmotapm-unraid/commit/42d19aa714319843114c626059dd9c5fae094a90#diff-ffc2f4755a67ff8df0cc721d1c185eee2502fd60ec1193caf6b36ecb34f1b9dbR106

 

The setInterval call needs to be at the page level as its a repeat call not a delayed call, as at the moment its nested within the tasmotapm_status() method, meaning each time its calling itself N+1 times.

 

The fix should be to move the setInterval call outside of the method. You can replace the page load call to start itself with the setInterval code.

 

I can submit a PR if you'd like.

Link to comment
6 minutes ago, unraidyn said:

Found the problem, it is indeed recursion:

 

https://github.com/SimonFair/tasmotapm-unraid/commit/42d19aa714319843114c626059dd9c5fae094a90#diff-ffc2f4755a67ff8df0cc721d1c185eee2502fd60ec1193caf6b36ecb34f1b9dbR106

 

The setInterval call needs to be at the page level as its a repeat call not a delayed call, as at the moment its nested within the tasmotapm_status() method, meaning each time its calling itself N+1 times.

 

The fix should be to move the setInterval call outside of the method. You can replace the page load call to start itself with the setInterval code.

 

I can submit a PR if you'd like.

Have a release a version with no refresh until I have time to fix.

Link to comment
On 3/18/2023 at 2:13 PM, Squid said:

Most likely, without an update to the plugin, simply having it installed will prevent the dashboard from loading.  Since it is outside of CA's control (author could never be bothered to publish) there's no warnings etc I can give regarding this short of this post and the usual warning from FCP about "Unknown plugin installed"

@SquidCreated 6.12 version and added to CA.

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

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.