I want to add an indicator to my garden dashboard that shows when I need to do a full water flush/cleaning. I think that it would be cool to have a count down graph or something like that.
I looked through the triggers and conditional statements and not sure of the easiest way to build one of these? Set a trigger duration for 3600 sec/hr x 24hr/day x 10 days in between flushes and then throw and toggle an output? Or a combination of this and a conditional statement?
Has anyone done something like this?
This can be accomplished with only a Dashboard Widget or a combination of a Dashboard Widget and Function. Within these options, there are a few different ways to do this. I’ll go through what immediately comes to mind, from easiest to most complex:
Widgets and Functions can act in unison, where the widget can get status updates from Functions. The Function can count down and also perform additional acts like email notification, etc. at the end of the countdown, and the widget can query the Function for a response string that it displays on the dashboard. See Mycodo/mycodo/widgets/widget_function_status.py and Mycodo/mycodo/function/examples/custom_function_simple_loop_with_status.py for how the Widget and Function can interact.
If these are in the example directory, you will need to import the module on the Configure → Custom Widget and Custom Function pages. I’ve been thinking about having all example modules included automatically as an imported module so users can add and play with them in Mycodo without going through the import process, and have them clearly labeled “Example Module” or similar when they’re in the Widget or Function dropdown menu for adding a widget/function.