binaryman Posted July 27, 2016 Posted July 27, 2016 (edited) I'm not sure why, but this program isn't running.. I have variables that change based on day of month, year, etc. that all cycle perfectly.. however this program which I want to run on the first of the month doesn't run... any ideas? Edited July 27, 2016 by binaryman
ghaynes27 Posted July 27, 2016 Posted July 27, 2016 Well the obvious question is the variable being set to 1 correctly when its the first day of the month. Whats the program that sets this variable? What is the value of the variable now?
LeeG Posted July 27, 2016 Posted July 27, 2016 Is $iDay.xxxx an Integer or State variable? Integer variables do not trigger a Program.
binaryman Posted July 27, 2016 Author Posted July 27, 2016 yeah, it gets set correctly for sure.. It is an integer variable... I've added a state variable called $DayOfMonth, and added to the end of the program that changes the date: $DayOfMonth = $iDay.Of.Month And changed the program to act on $DayOfMonth. Should this do it?
LeeG Posted July 27, 2016 Posted July 27, 2016 A State variable change in value will trigger a Program.
larryllix Posted July 28, 2016 Posted July 28, 2016 (edited) These synchro programs can be difficult to keep running despite power blinks and user interaction causing them to stall. This is how I do it. Note I use scratchpad variables to do my calculations so programs don't uselessly trigger from the final state variable. Set MM.DD - [ID 00B8][Parent 0006] If Time is 12:00:01AM Or Time is 3:00:01AM Or Time is 6:00:01AM Then $sISY.DayOfWeek Init To [Current Day of Week] $sISY.DayOfWeek = [Current Day of Week] $sISY.DayOfMonth Init To [Current Day of Month] $sISY.DayOfMonth = [Current Day of Month] $ISY_Date.scratchpad = [Current Day of Month] $ISY_Date.scratchpad /= 100 $ISY_Date.scratchpad += [Current Month (Jan=1, Feb=2, etc.)] $sISY.MM.DD Init To $ISY_Date.scratchpad $sISY.MM.DD = $ISY_Date.scratchpad Else - No Actions - (To add one, press 'Action') I use the resultant $sISY.MM.DD variable for Christmas lighting and other annual events program triggering. Edited July 28, 2016 by larryllix
ghaynes27 Posted July 28, 2016 Posted July 28, 2016 (edited) Set MM.DD - [ID 00B8][Parent 0006] If Time is 12:00:01AM Or Time is 3:00:01AM Or Time is 6:00:01AM Then $sISY.DayOfWeek Init To [Current Day of Week] $sISY.DayOfWeek = [Current Day of Week] $sISY.DayOfMonth Init To [Current Day of Month] $sISY.DayOfMonth = [Current Day of Month] $ISY_Date.scratchpad = [Current Day of Month] $ISY_Date.scratchpad /= 100 $ISY_Date.scratchpad += [Current Month (Jan=1, Feb=2, etc.)] $sISY.MM.DD Init To $ISY_Date.scratchpad $sISY.MM.DD = $ISY_Date.scratchpad Else - No Actions - (To add one, press 'Action') Are these variables that are set in another program? [Current Day of Week] [Current Day of Month] EDIT: Nevermind just realized this is a v5 feature. Edited July 28, 2016 by ghaynes27
larryllix Posted July 28, 2016 Posted July 28, 2016 Those variables are only available to special people.
kohai Posted February 11, 2017 Posted February 11, 2017 Those variables are only available to special people. Larrylix, what's the latest and greatest documentation in ver 5 to do these dates? My wife would like the Christmas lights to stop coming on. Rather than just disable the programs I'd like to future proof the code so that it can handle month/day regardless of year like you are doing above. I'm wondering if further v5 betas have further simplified this from your code above.
larryllix Posted February 11, 2017 Posted February 11, 2017 (edited) V5 variable features haven't changed any since decimals were added. AFAIK. I have asked for small additions like an Integer function to tear off fractions. An exponent function would be nice for windchill calculations now but I haven't asked yet. Sent from a tiny keyboard. Response may be brief. On a bad forum browser right now but my Xmas programs are all in a folder that is enabled from Dec 1 to Jan 11 each year. I need to add a detailed yearly notification describing the X10 and Insteon addresses of each light string so I know which ones are reserved for what task. Edited February 11, 2017 by larryllix
Recommended Posts