OpenSprinkler Forums OpenSprinkler Unified Firmware Amazon Echo Alexa Skill for Open Sprinkler Reply To: Amazon Echo Alexa Skill for Open Sprinkler

#46754

Ray
Keymaster

First, about OS program preview code. Here is where the preview is calculated:
https://github.com/OpenSprinkler/OpenSprinkler-App/blob/master/www/js/main.js#L6451
through it’s quite long, what’s most relevant to your need is the checkMatch function. There are a few different versions of it, assuming you have firmware 2.1.6 or above, you should look at the checkMatch216 function:
https://github.com/OpenSprinkler/OpenSprinkler-App/blob/master/www/js/main.js#L7026
this function calculates whether a given time matches any of the start times (including additional start times) of a given program. Since all you need to know is whether there will be any program that runs on a given day, what really matters to you is the checkDayMatch function:
https://github.com/OpenSprinkler/OpenSprinkler-App/blob/master/www/js/main.js#L7041
I know there are still a bunch of details you have to figure out, but hopefully this gets you closer.

About OG: I suppose a useful thing to add to the firmware is a variable (or it could be the same door_status variable) that indicates whether an action has been triggered but the door status hasn’t changed. For example, when opening the door, if the action has been triggered but the door status hasn’t changed to open, the variable will report ‘opening’ or something like that. Would this fit your need?