Jump to content

Unexpected behavior or programming error?


dbwarner5

Recommended Posts

Have a simple program to turn on outside and multiple inside xmas light decorations. Often if I go to bed before the program turns them off, I will have ask Alexa to turn them off, which works fine. But then at midnight, they come back on. I have checked using find/replace in programs for any other links to these devices and there are none. I have two other programs, that are related, but one only runs at startup to re-initialize the variable, the second changes the variable w/o any If or calls for it. 

Any ideas? 

Xmas lights Program - [ID 00D3][Parent 0013]

If
        $Xmas_Lights is 1
    And (
             From    Sunset  -  1 hour 
             To      12:05:00AM (next day)
          Or From     6:30:00AM
             To      Sunrise +  1 hour  (same day)
        )
    And (
             'ISY Time Data' Month is December
          Or 'ISY Time Data' Month is January
          Or 'ISY Time Data' Month is February
          Or (
                  'ISY Time Data' Month is March
              And 'ISY Time Data' Date < 10
             )
        )
 
Then
        Set 'Xmas Lights' On
        Set 'Kasa Controller / Plug 1' On
        Set 'Kasa Controller / Plug 2' On
        Set 'Kasa Controller / Plug 3' On
        Set 'Z-1 On-Off Power Switch' On
 
Else
        Set 'Xmas Lights' Off
        Set 'Kasa Controller / Plug 1' Off
        Set 'Kasa Controller / Plug 2' Off
        Set 'Kasa Controller / Plug 3' Off
        Set 'Z-1 On-Off Power Switch' Off
 

 

Link to comment

UPDATE:  Never mind.. walked away after this post and it dawned on me what is happening.

When the Node server updates the day (And 'ISY Time Data' Date < 10) in the above program, at midnight, it re-evalutes the if and therefore it becomes true for 5 minutes...until 12:05 am.. will simply change that to 11:55pm or create an Integer value for it. 

LOL...

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...