So I’ve been expanding my cottage automation a bit and I think I’m starting to expose some cracks in my plan to use Snap! as an automation language. The biggest is at tasks that are schedule based. Here is the current logic. The whole thing doesn’t do a great deal because I’m not yet ready to trust major functionality to this code. Specifically irrigation. Shari would be displeased if the flower beds dried out.
The block on the right is my experimental irrigation block. First it checks that I’ve enabled irrigation. Then it checks to see if the rain-sensor is wet. Once the unit is ready, it checks for the various days of the week and then checks times and when they match, sets “would_irrigate” to the appropriate sprinkler valve number.
Looking at the whole block, it’s very ‘bit’ relative to the others and something I can do with Cron in about 3 small lines of text.
I need to find a better way to handle scheduled tasks.