Here's some ideas for the macros that would really open things up.
I like how you're able to disable individual sensors or whole groups that might trigger equipment and add delays between the steps but it's limited as you can only control "equipment" devices and delays don't always work as pumps age and runs times vary.
Also when you assign a macro to a sensor it runs continually which is annoying. For example you can't setup a backup sensor for an ATO, as both are always running you get a quick on/off pulse between readings, I tried every which way but couldn't do it and understand why.
What I propose is bringing all the control features to the macro page. Instead of going to the temperature, ph or ATO tab to setup equipment/macro control do it all on the macro page. Having these controls on the individual modules also puts a limit on what you can do as you can only assign one action per sensor.
Based on the current layout think of it like this.
- Click the + sign to create a new macro
- You get the 'name' field and a drop down to select any sensor parameter that's in the system, one of the options is 'no sensor', these could run manually like now or via timers.
- Lets say I select temperature sensor 3 or anything else, it will give two fields.
- greater than or less than option
- trigger value
- Then proceed to setup steps like it is now with the addition of trigger dosing pumps and email. You can have an option on doser page for max doses per day so a macro can't accidentally over dose the tank.
End result would be if temp3 > 75.1 turn on outlet 1, In the background when it's triggered a variable is changed so it can't run again, the variable is reset once temp goes below 75.1 +/- hysteresis and will trigger again if/when it goes above 75.1 again.
Like that you can use temp3 over and over, maybe setup another macro if temp3 > 75.5 turn on outlet 2 and send alert. You could also use the macro just to send an alert the parameter went out of range.
Another example with float switches or sensors, one macro the user could say if float1 = HIGH turn on pump1 and another macro would say if float2 = LOW turn off pump1. Those two sensors would control that pump. This can't really be achieved right now unless those two sensors are switched at the exact same time otherwise they will fight for control of the I/O pin and cause a pulse.
Like this it would be up to the user to decide what happens to outlet 1 if temp3 triggers it, maybe temp3 is used to undo that action or another parameter is used instead. In this case it's up to the user to follow up on that outlet. This macro will turn it off so you need a timer or another macro to turn it back on. For example to control a heater you setup two macros.
I understand reef-pi reads Amps from HS300 so this would also be a selectable parameter for the macro, if outlet 1 Amps > 1.2 turn off outlet 1 and send email.
I hope this all makes sense.