Jump to content

Problem using to from time.


Recommended Posts

Posted

In the example below the routine does not always evaluate TRUE when switchB is on and switchA opens. This usually happens at 8:00 AM. If I eliminate the time constraint them it works flawlessly.  I even created two routine on with and one without the time and I can monitor them and see that the one with the time does not work.

Ideas ?

If switchA 1 is switched open
And (
        switchB is on
   or switchC is on
       )
And From 3:00:00 AM
        To     1:00:00 PM (same day)
Then
     ...
Else
 

Posted

If switch C is on it doesn't matter what happens to switch B   ???

 

You only mentioned the program not being true based on Switch A and Switch B during time constraints.

Does it change things if you From To time is the first statement?

 

 

 

Posted
1 hour ago, ronbo said:

If I eliminate the time constraint them it works flawlessly.

What happens if you move the time constraint up into the ( ) of the first and statement? Long shot, but first adjustment I might suggest since you say it works fine without the time constraint. Also, is your "switchB" and "switchC" using a "status" or "switched" qualifier?

1st edit:

And (
        switchB is on		<- Is this using "Status"?
   or switchC is on		<- Is this using "Status"?
And From 3:00:00 AM
        To     1:00:00 PM (same day)
       )

 

I just made a test program and it worked either way. Post your actual program. You might be using switched where status would be correct. 

Test and-time - 

If
        'Lamp' Status is not Off
    And (
             'Office' Status is On
          Or 'Bed1Lamp' Status is not Off
        )
    And From     6:30:00PM
        To       7:30:00PM (same day)
 
Then
        Set 'Office Fan' On
 
Else
   - No Actions - (To add one, press 'Action')

Mine triggers true if I turn "Lamp" on - I was testing with admin console and Alexa so used "status" rather than "switched" (meaning physically activated). 

If you're "switching on" "switchA 1" with an app, voice command, or another program then you have to use the status. Only if you are manually operating "switchA 1" will it work for "switched open". 

Since you might be testing outside of your time constraint you should adjust the end time to a time later than your current time so you can run the IF to get it to test currently and not wait until tomorrow.

Posted (edited)

@Geddy I think you hit the head on the nail there.
There is no such ISY syntax as

And (
        switchB is on
   or switchC is on
       )

It seems like the OP is using multiple "Switched on " logic statements, dependent on each other, which can never be both true at the same time.

Again ACTUAL PROGRAM NEEDED

Edited by larryllix
  • Like 1
Posted
37 minutes ago, ronbo said:

How do you copy the program to paste it?

Right click on the program and select copy to clipboard. Then paste the program here.

  • Like 1
Posted

AlarmSet - [ID 0049][Parent 0009]

If
        'Alarm / INTERIOR / LIVING ROOM MOTION' is switched Open
    And (
             'Alarm / DMP' System Alarm State is Armed Stay
          Or 'Alarm / DMP' System Alarm State is Armed Sleep
        )
    And From     3:00:00AM
        To       2:00:00PM (same day)
 
Then
        $sSpeakAlarmArmed  = 1
        Wait  3 seconds
        $sSpeakAlarmArmed  = 0
 
Else
   - No Actions - (To add one, press 'Action')
 

 

Posted

I usually put my time constraints first and then use (AND) for the rest of the statement. 

Theoretically it shouldn't make a difference, but it makes it much easier to read, but maybe it does make a difference that I am not aware of. Example:

From     3:00:00AM
        To       2:00:00PM (same day)

and (Alarm / INTERIOR / LIVING ROOM MOTION' is switched Open
    And (
             'Alarm / DMP' System Alarm State is Armed Stay
          Or 'Alarm / DMP' System Alarm State is Armed Sleep
        )

)

See if that triggers as expected.

Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37.1k
    • Total Posts
      371.5k
×
×
  • Create New...