Skip to content

Feature request Sonoff POW: Send power reports when power changes more than a specified percentage #2157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
epmsmid opened this issue Mar 13, 2018 · 10 comments
Labels
enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended

Comments

@epmsmid
Copy link

epmsmid commented Mar 13, 2018

Is it possible to add a feature to send a power report when the power usage changes more than a certain percentage? E.g. like the Fibaro Wallplug E/F?

From the usermanual page 13 and 15:
image

image

This way the reporting interval can higher and you can still respond to power changes.

@arendst arendst added the enhancement Type - Enhancement that will be worked on label Mar 13, 2018
@arendst
Copy link
Owner

arendst commented Mar 14, 2018

Working on it...

arendst added a commit that referenced this issue Mar 14, 2018
5.12.0e
 * Add command PowerDelta 0..100 (percentage) to Energy
monitoring devices to report on active power load change (#2157)
@arendst
Copy link
Owner

arendst commented Mar 14, 2018

Provided command PowerDelta <percentage> to latest pre-release. See Wiki > Commands for option usage.

@arendst arendst added the fixed Result - The work on the issue has ended label Mar 14, 2018
@arendst
Copy link
Owner

arendst commented Mar 14, 2018

I'm now struggling with the definition 80%.

Current release calculates the percentage by dividing the difference by max_power. This will send one report for coarse changes but small changes are unnoticed.

I'm testing with dividing the difference by min_power. This works ok for fine changes but will send several reports with coarse power load changes...

I'm in doubt what to release...

EDIT: I'll keep current release. If more fine reporting is needed just decrease the default 80%.

@epmsmid
Copy link
Author

epmsmid commented Mar 14, 2018 via email

@epmsmid
Copy link
Author

epmsmid commented Mar 15, 2018

While rereading the above it's possibly better not to calculate the percentage of the change against the last value, but against the lowest value of the previous and the current power.

I think the the formula for the change should be:

= absolute value of ( - ) / minimum value of ( and * 100%

I think this gives a better resolution.
So a change from 20W to 100W will give a percentage of 80/20100% = 400%
and a change from 100W to 20 W will also gie a percentage of 80/20
100% = 400%

Otherwise a change from 20W to 100W will give a percentage of (100-20)/20100% = 400%
And a change from 100W to 20W will give a percentage of (20-100)/100
100% = -80%

It's possibly a good idea to also implement a bucket for high priority message, to protect against flooding reports.
Maybe it's a good idea to make the buckets user configurable.
Then you get these parameters:

  • Bucket reset interval (Default 30 seconds?)
  • Bucket size for high priority reports (Default 6? -> average reporting interval every 5 seconds)
  • Bucket size for low priority reports (Default 3? -> average reporting interval every 10 seconds)
  • High priority report change percentage (Default 80%?)
  • Low priority report change percentage (Default 15%?)

@epmsmid epmsmid closed this as completed Mar 15, 2018
@epmsmid
Copy link
Author

epmsmid commented Mar 15, 2018

Sorry, accidentally closed the issue.

@epmsmid epmsmid reopened this Mar 15, 2018
@arendst
Copy link
Owner

arendst commented Mar 15, 2018

Other than reporting on power change I see no reason to discriminate in high or low percentage change. The home automation tool already monitors overall energy uses so the only advantage is the possibility to react on any major power change (percentage set with PowerDelta).

Keep in mind that power measuring could take several seconds so reporting every 5 seconds is a no-go anyway.

I'll need to fine tune current solution, that uses your last proposed solution already, for the pow and will come back here when done.

arendst added a commit that referenced this issue Mar 15, 2018
@epmsmid
Copy link
Author

epmsmid commented Mar 16, 2018

The reason for discriminating high and low percentage is to protect agains flooding reports.
When the used power fluctuates just above the low percentage, a lot of power messages will be sent. This is why Fibaro limits the number of low percentage messages per time interval. E.g. 1,0W -> 1,2W -> 1,0W ->1,2W etc. When the percenage is set to 15% every change causes an immediate report.
I think big fluctuations as high is 80% are rare.
The reason for this feature request is that I use power changes to trigger scripts. With this feature, the power change is reported earlier.

@arendst
Copy link
Owner

arendst commented Mar 17, 2018

For now I leave it as it is. I suggest you play with the percentage to get a functional environment. If you come across a life problem just let me know and show.

@ascillato
Copy link
Contributor

Hi @epmsmid

Now there are rules in Tasmota. Please, see if this new feature can solve your issue. Thanks!

@arendst arendst closed this as completed Jul 2, 2018
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
5.12.0e
 * Add command PowerDelta 0..100 (percentage) to Energy
monitoring devices to report on active power load change (arendst#2157)
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended
Projects
None yet
Development

No branches or pull requests

3 participants