giesen Posted October 8, 2016 Posted October 8, 2016 Is it possible to get an additional value added for month as an integer? I have a program that used the interger month value in ISYLink that does a comparison to another variable that is set elsewhere, which I can't do with the String-based value. I can work around it by creating a bunch of programs to set a month variable based on the String-based value, but would be much cleaner and easier if I could just pull it from NodeLink. Thanks!
larryllix Posted October 8, 2016 Posted October 8, 2016 Is it possible to get an additional value added for month as an integer? I have a program that used the interger month value in ISYLink that does a comparison to another variable that is set elsewhere, which I can't do with the String-based value. I can work around it by creating a bunch of programs to set a month variable based on the String-based value, but would be much cleaner and easier if I could just pull it from NodeLink. Thanks! If you are running v5.x the month is another system variable on a pulldown programming menu.
giesen Posted October 8, 2016 Author Posted October 8, 2016 If you are running v5.x the month is another system variable on a pulldown programming menu. I can set the value of a variable to the month using the system pulldown, but I don't appear to be able to compare the value of a variable to the system month (there is no pulldown for system when doing a comparison). ie. there's no system pulldown for Condition, only for Action. I worked around it with the following program: Set Date.Current_Month If 'ISY Additional Data' Month is January Or 'ISY Additional Data' Month is February Or 'ISY Additional Data' Month is March Or 'ISY Additional Data' Month is April Or 'ISY Additional Data' Month is May Or 'ISY Additional Data' Month is June Or 'ISY Additional Data' Month is July Or 'ISY Additional Data' Month is August Or 'ISY Additional Data' Month is September Or 'ISY Additional Data' Month is October Or 'ISY Additional Data' Month is November Or 'ISY Additional Data' Month is December Then $Date.Current_Month = [Current Month (Jan=1, Feb=2, etc.)] Else - No Actions - (To add one, press 'Action') And then do my comparisons against $Date.Current_Month. It's a little hokey, but it seems to work.
giesen Posted October 8, 2016 Author Posted October 8, 2016 My other concern is that if the time on the NodeLink server is ahead of ISY by even a second, then the NodeLink server's Month variable will trigger the program, but the ISY will still set $Date.Current_Month to the old month. And because it's only triggered once a month, it would always be 1 month behind. I guess I could put a wait in there, but that's even more hackish.
giesen Posted October 8, 2016 Author Posted October 8, 2016 This replacement program will probably solve my last concern more cleanly (although still not ideal): Set Date.Current_Month If Time is 12:00:00AM Then $Date.Current_Month = [Current Month (Jan=1, Feb=2, etc.)] Else - No Actions - (To add one, press 'Action') Basically every day at midnight (ISY time) it will set $Date.Current_Month to the current month (ISY time)
larryllix Posted October 8, 2016 Posted October 8, 2016 Here is the gadget I use to set MM.DD. I try to kick it a few times per day just in case it stalls for some reason. 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') Then I use it as a year wildcard for programs like this that have to work every year without editing. Xmas Lights.road trees - [ID 000A][Parent 00C0] If ( $sISY.MM.DD >= 11.15 And $sISY.MM.DD <= 1.09 And ( On Sun, Mon, Tue, Wed, Thu From Sunset + 15 minutes To 10:20:00PM (same day) Or On Sat, Fri From Sunset + 15 minutes To 12:20:00AM (next day) ) ) Or ( $sISY.MM.DD >= 12.23 And $sISY.MM.DD <= 12.26 And From Sunset + 15 minutes To Sunrise + 15 minutes (next day) ) Then Set 'Foyer / Xmas Lights.road trees' On Wait 2 seconds Set 'Foyer / Xmas Lights.road trees' On Else Set 'Foyer / Xmas Lights.road trees' Off Wait 2 seconds Set 'Foyer / Xmas Lights.road trees' Off I believe UDI will be making some system variables into objective nouns, in later versions.
builderb Posted October 11, 2016 Posted October 11, 2016 I wrote a script on my Pi that sets all those variables on my ISY.
larryllix Posted October 11, 2016 Posted October 11, 2016 NodeLink already does that quite well on a RPi. I was trying to eliminate one link in the food chain though but the RPi is going to be partnered with ISY for some time yet.
builderb Posted October 11, 2016 Posted October 11, 2016 NodeLink already does that quite well on a RPi. I was trying to eliminate one link in the food chain though but the RPi is going to be partnered with ISY for some time yet. I know, but I've been having trouble with nodes vanishing, so I'm holding off until that issue gets resolved. My script is my bandaid until then. Plus it sounds like NodeLink is going on hiatus.
giesen Posted November 5, 2016 Author Posted November 5, 2016 Apparently you can set an integer variable to the value of ISY Additional Data - Month, just not do a comparison. So here's what I did and it seems to work: Set Date.Current_Month - [ID 0063] If 'ISY Additional Data' Month is January Then $Date.Current_Month = 'ISY Additional Data' Month Else $Date.Current_Month = 'ISY Additional Data' Month Then I can do my integer comparisons against $Date.Current_Month (a state variable I created). Obviously would be better to be able to do the comparisons directly to the value from the node server rather than having to have the extra step, but this seems to work quite well and is not as cumbersome as some of the other solutions.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.