Okay thanks, I'll look into it and do some minimal validation to avoid having to look at the logs too often.
I was thinking about the moisture control plugin and realised that it currently only does half the job i.e. suppressing schedules if the station is too wet.
I was wondering if I could cover the other case as well, "what if the station is too dry?".
For each station I would add an additional two attributes, a too dry threshold and a program. If the current moisture reading for a station is below the too dry threshold then the program would be triggered. I looked at helpers.run_program but that calls stop_stations, not exactly what I want and also a program could cover more than one station so I'm guess using programs is not the way to go.
Instead of a program attribute I would use MM:SS and trigger the station to run once for this. Would this be a sensible way to go and would the node_red.run_once be the correct code to do this? Can I add from node_red import run_once in my plugin?
I was thinking about the moisture control plugin and realised that it currently only does half the job i.e. suppressing schedules if the station is too wet.
I was wondering if I could cover the other case as well, "what if the station is too dry?".
For each station I would add an additional two attributes, a too dry threshold and a program. If the current moisture reading for a station is below the too dry threshold then the program would be triggered. I looked at helpers.run_program but that calls stop_stations, not exactly what I want and also a program could cover more than one station so I'm guess using programs is not the way to go.
Instead of a program attribute I would use MM:SS and trigger the station to run once for this. Would this be a sensible way to go and would the node_red.run_once be the correct code to do this? Can I add from node_red import run_once in my plugin?