added event-trigger time delay parameter#18
Open
hillsandales wants to merge 1 commit intoemoncms:masterfrom
hillsandales:add_hysteresis_setting
Open
added event-trigger time delay parameter#18hillsandales wants to merge 1 commit intoemoncms:masterfrom hillsandales:add_hysteresis_setting
hillsandales wants to merge 1 commit intoemoncms:masterfrom
hillsandales:add_hysteresis_setting
Conversation
Collaborator
|
Probably best to add the new variable in the update to the end of the call? Am also concerned r.e. the time stamp updating. Does this mean that my last update gets a new 'sent' time even if its just a 'touch' of the row? Quite a useful addition though. Does it cater for devices that still have a base value when not running? E.g. To tell me when my washing machine finishes? I've always dreamt of some sort of power analysis tool, where certain behaviours on total power consumption can be identified. |
Collaborator
|
This can't be merged automatically according to github. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I came across a need to delay an alert for a certain amount of time before actually sending the alert. I thought this might be a handy feature for others and that you may want to add it.
I'm monitoring a dehumidifier's power usage. When it turns off, I was trying to send an alert, indicating the unit was full (power goes down when it's not running of course). However, the unit sometimes cycles on and off depending on the humidity. It may turn off only for a minute and then turn back on for an hour. I came up with the idea to set a delay before the event message is actually sent. So it would only send a message after one hour of the condition being true. Each time the condition is indicated as false, it resets a timestamp that's used to calculate if the time delay period has elapsed.
I tested it with a frequently updating value (uptime) from an arduino node. It seems to work as expected, and seems to behave nicely when using a "Mutetime" parameter too.
The following is the solution I came up with. The downside might be that it updates a time value in the database each time the feed check is processed (seems to be every time a value is sent from the node that has an event entry attached to it), but I couldn't figure out how to get around this easily. If there's another solution that's more elegant, by all means, use that one! I tried to leave as much code alone as I could manage. If there's another way to make it cleaner, that's great!