Jump to content

Problem using to from time.


Recommended Posts

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
 

Link to comment

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?

 

 

 

Link to comment
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.

Link to comment

@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
Link to comment

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')
 

 

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...