Skip to content
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

Bugfix: Backend: Alerting: periodic onSetSumState doesn't override SumStateSchedule #2561

Conversation

DerStoecki
Copy link
Contributor

Issue

SumState not sending Emails because of onSetSumState.

Reason

Periodic OnSetSumState Event (~ every 5 min) of Edge -> refreshes scheduled Message and the "stateSince" timestamp even if the sumState is the same.

Solution

Check if the SumState changed and then update the stateSince time.

To my shame, when I reviewed the PR I only tested the Alerting mechanism with like 1-3 min delay, but when we configured an Edge with 15 min alerting we didn't receive an alerting mail (however I did when i had a delay of 3 min or so). After some debugging we found out, that the OnSetSumState Event gets triggered roughly every 5 min / periodically.

OnSetSumState gets send ~every 5min -> the oldMsg would be constantly updated and therefore would never be send.
This behaviour is fixed by checking if the oldMsg/scheduled message has the same sumState (warning, fault) as the current SumState reported by the Edge.
@DerStoecki DerStoecki requested a review from da-Kai March 4, 2024 10:07
@DerStoecki DerStoecki self-assigned this Mar 4, 2024
Copy link

github-actions bot commented Mar 4, 2024

Code Coverage

@da-Kai da-Kai requested a review from sfeilmeier March 6, 2024 09:32
@sfeilmeier sfeilmeier merged commit 57358f8 into OpenEMS:develop Mar 10, 2024
2 checks passed
fanass-dev pushed a commit to fanass-dev/openems that referenced this pull request May 6, 2024
…e SumStateSchedule (OpenEMS#2561)

OnSetSumState gets send ~every 5min -> the oldMsg would be constantly updated and therefore would never be send.
This behaviour is fixed by checking if the oldMsg/scheduled message has the same sumState (warning, fault) as the current SumState reported by the Edge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants