Jump to content

Is program logic simply busted?


Recommended Posts

Posted

I've got a very simple program that just looks at a bunch of door sensors. If an door opens while neither my wife or I are home, it sends me a text. Presence is done with IFTTT . IFTTT sets state variables for home and away, and that part seems to be fine. 

 

But....

 

Every time both my wife and I leave the house, we get the text message that a door is open after we leave the geofencing area. The doors are not open. The sensors are fine...

 

If (door 1 or door 2 or door 3....) AND (wife not home AND me not home) then.... send txt.

 

What on earth is going on here?

Posted

Post your program. From another thread you, seem to have some confusion on the ISY logic being applied.

 

Right click on the program and copy to clipboard. Use the <> tools to paste it here.

Posted

Is "not home" based on geofencing?

 

I suspect it is not busted logic, but rather something else. If you are getting a message after leaving the house, then the isy must think one of the door conditions is true. The quest is to figure out why.

 

I also agree.that it is best to post actual program, just in case.

Posted

Also, the 'not home' elements. What are they? State variable? Integer variable? This matters as well, as one works as a trigger, the other does not.

Posted

You must be using a state variable for your geofence.  In this case, a state variable is not necessary and is triggering your program to run every time it changes.  If you only have content in the "then" section, and the program is false, this shouldn't be an issue.  If you have content in both "then" and "else" section, then it will be a problem.

 

If your program triggers via your geofence/state variable, and it runs true, then you either have a situation where a door sensor is improperly reporting or your logic is incorrect. 

 

What device is checking door status?  Insteon or something else?

 

Again, post the program.

Posted

They are state variables...

There is no else clause...

Can't copy and post the program because I am on a Mac, there is no right click, and the console does not appear to have a feature to export or copy the program to the clipboard. 

 

I suspect something in the door status's is glitching.? This thing seems like such a buggy kludge. I've see so much unpredictable and odd behavior with this device that I am losing all trust in the product.

Posted

Can't copy and post the program because I am on a Mac, there is no right click, and the console does not appear to have a feature to export or copy the program to the clipboard. 

 

On macOS, and with and old, one button mouse, you and press the Control + Click to simulate a right mouse button.  With a current Apple Mouse, you can turn on Secondary Click in the Control Panel.  Once you have Secondary Click enabled, you can "right click" on the program and select the context sensitive menu item "Export to Clipboard".  These screenshots were taken using macOS Sierra.

 

Edit: BTW, the Control + Click method works with a trackpad as well as a mouse.

post-7363-0-68043300-1485273382_thumb.png

post-7363-0-85262200-1485273460_thumb.png

Posted

Every mac I have used inludes a right-click. Does this not work on the isy admin panel?!

 

Yes, sonetimes it takes a bit of troubleshooting and getting through a learning curve. If that sort of thing does not interest you, something simpler (and less capable) may be a better fit for you.

Posted

DoorAlert - [iD 000A][Parent 000E]

If
        (
             Control '3B.22.5B.1 - Garage Man Door' is switched On
          Or Control 'Garage Door 1-Opened' is switched On
          Or Control 'Garage Door 2-Opened' is switched On
          Or Control '41.5A.A1.1 - Front Door Senso' is switched On
          Or Control 'Garage Door 3-Opened' is switched On
          Or Control 'Slider Door-Opened' is switched On
        )
    And (
             $Deanna_Location_Home is 0
         And $Bruce_Location_Home is 0
        )
 
Then
        Wait  2 minutes and 30 seconds
        Run Program 'NobodyHomeConfirm' (If)
 
Else
   - No Actions - (To add one, press 'Action')
 

Every time both by wife and I leave, the presence (state variables get set to zero a few minutes after we leave the house (the radius is large).. When the last of us leave, I get the alert in the then clause...every time. Checking status on the devices shows the doors are all closed. Strange.

 

Posted

My beef with this isn't the complexity per se, it's the crappy hodge podge of a design that requires the user to navigate a complex and largely undocumented mine field of unique behaviors that are contrary to well established practice everywhere else  in industry. Sure, I can figure out a new programming language and environment, but for pete's sake WHY?! flush the programming UI and the screwy home-grown variable system and import a standard programming engine like TCL or Python. It's super easy to integrate, the code is open source, and it's far more capable and easy to use. I need this to work in a predictable way that I can depend on, and the more screwy  weird stuff it does, the less I trust it. Indigo, may be a better option for that reason alone. I do like the Echo support and the inbound IFTTT on the ISY, maybe I can use those, and move the programmability functions to the Mac. 

Posted
I need this to work in a predictable way that I can depend on, and the more screwy  weird stuff it does, the less I trust it.

 

In my experience, ISY-994 is more predictable than MacOS or Linux.  It's just different than free-form scripting.   I trust it much more than I trust any Apple product.

 

ISY is not a general purpose computer, it's more akin to industrial control systems:  a tightly constrained state machine with limited resources.

 

 I do like the Echo support and the inbound IFTTT on the ISY, maybe I can use those, and move the programmability functions to the Mac.

 

If you have a separate computer that is always on, many people have integrated ISY with Python and other languages using the well-documented RESTful API, with V5 and nodeserver this will be even easier.  

 

I like that I can have core home automation functions run reliably in the ISY994 without thinking about a Unix-like OS that might run out of RAM, join a botnet, or get stuck downloading the latest update or otherwise do something unpredictable.

Posted

The Insteon hidden door sensors seem to act funny sometimes. The program conditions involving them sometimes change to "is %100" or even "is responding" from "is status on". Weird. I don't know if this has anything to do with this problem.

 

Also, the regular door sensors are kind of weird too. The ISY creates both "open" and "close" nodes, but only the "open" nodes get a state value. Why is that?

Posted

My beef with this isn't the complexity per se, it's the crappy hodge podge of a design that requires the user to navigate a complex and largely undocumented mine field of unique behaviors that are contrary to well established practice everywhere else  in industry. Sure, I can figure out a new programming language and environment, but for pete's sake WHY?! flush the programming UI and the screwy home-grown variable system and import a standard programming engine like TCL or Python. It's super easy to integrate, the code is open source, and it's far more capable and easy to use. I need this to work in a predictable way that I can depend on, and the more screwy  weird stuff it does, the less I trust it. Indigo, may be a better option for that reason alone. I do like the Echo support and the inbound IFTTT on the ISY, maybe I can use those, and move the programmability functions to the Mac. 

Only you can decide if you want to continue with the ISY.  You are probably not the first to complain that the programming approach anddesign is not consistent with other systems.  For me, it has been perfectly intuitive, but I had the benefit of having nothing to unlearn.

 

Looking at your pasted program, I see nothing there that would cause your troubles.  However, I cannot help but wonder about the program referenced called "NobodyHomeConfirm".  Is this program disabled?  Since I have not seen it, I can only wonder, but is it possible that this program is triggering on its own, and issuing your text messages?

Posted

General purpose popular procedural languages like Python or TCL (really?! It is a stretch to call it "general-purpose..." OR popular) are not good matches for event/state-driven systems like ISY.

 

Maybe Erlang would be suitable. But how many of us know Erlang?

 

Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. Some of its uses are in telecoms, banking, e-commerce, computer telephony and instant messaging. Erlang's runtime system has built-in support for concurrency, distribution and fault tolerance.

 

 

https://www.erlang.org/

 

As far as ISY programs go, you need to stop thinking of them as procedural programs. As painful as this may seem, it is best to make them as short as possible. Break them up, make each program do one simple thing. When THIS state occurs, do THAT. And make THAT simple. ISY "programs" are reactive to changes in state. You have to turn your thinking inside-out from traditional procedural programming.

 

That said, yes, ISY programs are awkward and tedious. 5.x brings considerable improvement, though.

Posted

Looking further, I become more convinced that it is NOT this particular program that is behaving in ways that you don't expect.  My best guess remains that you need to disable program "NobodyHomeConfirm".  

 

I have a program much like this one, but use a keypad button as indicator of being away, rather than a geofence condition.  The program works very well.

Posted

Only you can decide if you want to continue with the ISY.  You are probably not the first to complain that the programming approach anddesign is not consistent with other systems.  For me, it has been perfectly intuitive, but I had the benefit of having nothing to unlearn.

 

Looking at your pasted program, I see nothing there that would cause your troubles.  However, I cannot help but wonder about the program referenced called "NobodyHomeConfirm".  Is this program disabled?  Since I have not seen it, I can only wonder, but is it possible that this program is triggering on its own, and issuing your text messages?

 

Bingo! winner!

Posted

Also, the regular door sensors are kind of weird too. The ISY creates both "open" and "close" nodes, but only the "open" nodes get a state value. Why is that?

 

In the past the open-close (Trigger Linc) had a black jumper pin. This jumper when enabled allowed a person to use the dual mode. This feature is now only available via software as the jumper has now been removed. The ISY Series Controller does not support this software option to enable and use this dual mode.

 

If you believe this feature has value consider lending your voice to have it properly supported: http://forum.universal-devices.com/forum/6-product-requests/

Posted

 

 

DoorAlert - [iD 000A][Parent 000E]

If

(

Control '3B.22.5B.1 - Garage Man Door' is switched On

Or Control 'Garage Door 1-Opened' is switched On

Or Control 'Garage Door 2-Opened' is switched On

Or Control '41.5A.A1.1 - Front Door Senso' is switched On

Or Control 'Garage Door 3-Opened' is switched On

Or Control 'Slider Door-Opened' is switched On

)

And (

$Deanna_Location_Home is 0

And $Bruce_Location_Home is 0

)

 

Then

Wait 2 minutes and 30 seconds

Run Program 'NobodyHomeConfirm' (If)

 

Else

- No Actions - (To add one, press 'Action')

 

Every time both by wife and I leave, the presence (state variables get set to zero a few minutes after we leave the house (the radius is large).. When the last of us leave, I get the alert in the then clause...every time. Checking status on the devices shows the doors are all closed. Strange.

The root issue a the wait. The integer variable fixes it as well. This is why...

 

Door opened triggers the program. Wait starts.

Either phone leave the area. Variable changes to 0. Because it's State, this aborts the wait and reevaluated the If. Now, the door is not true, so Else is run. No action.

 

This is an event driven thing - not flow driven. You have to think in terms of triggering events.

Posted

 

 

....behaviors that are contrary to well established practice everywhere else in industry. Sure, I can figure out a new programming language and environment, but for pete's sake WHY?!

It's because the ISY is event driven. Regular scripts are flow based. Yes, it takes learning a new way.

 

There are advantages and disadvantages to both when applied to home automation, with a significant advantage to a true event driven method. I'll take the current system any day....

Posted
I fixed it with a non-state variable.

 

I assume you are talking about a variable that is the condition of the "nobodyhomeconfirm" program, yes?  If that program is in the form

 

if

variable=something

then

send text message

else

nothing

 

then, yes, converting that variable to an integer type would ensure the program is not triggered by itself.  That was the end goal.

Posted

It's because the ISY is event driven. Regular scripts are flow based. Yes, it takes learning a new way.

 

There are advantages and disadvantages to both when applied to home automation, with a significant advantage to a true event driven method. I'll take the current system any day....

What he said.  ISY is event driven because ha is, by its nature, event driven.  Things like state variables allow for including variables as events while the integer variables allow you to use variables in a non-event context.  The wait and repeat commands need to be used very carefully by a newbie.  Understand that "then" and "else" clauses are atomic, meaning "inseparable", except when containing a repeat or wait line.  repeat and wait lines separate the clause into 2 or more atomic elements.  Once an atomic element is started, it will complete all commands, however a wait or repeat will allow the "then/else" clause to be aborted in the event that the "if" clause contains a line that triggers (like a state variable changing).  

Posted

What he said.  ISY is event driven because ha is, by its nature, event driven.  Things like state variables allow for including variables as events while the integer variables allow you to use variables in a non-event context.  The wait and repeat commands need to be used very carefully by a newbie.  Understand that "then" and "else" clauses are atomic, meaning "inseparable", except when containing a repeat or wait line.  repeat and wait lines separate the clause into 2 or more atomic elements.  Once an atomic element is started, it will complete all commands, however a wait or repeat will allow the "then/else" clause to be aborted in the event that the "if" clause contains a line that triggers (like a state variable changing).  

 

I can honestly say every time you and oberkc reply about variable topics. In one hand I feel smarter because I learned something new. While on the other hand I quickly notice how dumb I feel because these concepts just never take hold in my little brain.

 

As always, thank you and to oberkc for making me smarter and dumber at the same time . . .

 

LOL . . . 

Posted

My beef with this isn't the complexity per se, it's the crappy hodge podge of a design that requires the user to navigate a complex and largely undocumented mine field of unique behaviors that are contrary to well established practice everywhere else  in industry. Sure, I can figure out a new programming language and environment, but for pete's sake WHY?! flush the programming UI and the screwy home-grown variable system and import a standard programming engine like TCL or Python. It's super easy to integrate, the code is open source, and it's far more capable and easy to use. I need this to work in a predictable way that I can depend on, and the more screwy  weird stuff it does, the less I trust it. Indigo, may be a better option for that reason alone. I do like the Echo support and the inbound IFTTT on the ISY, maybe I can use those, and move the programmability functions to the Mac.

 

Python is not event drive and would be a programming nightmare to accomplish even the simpleset of tasks.

 

ISY is an event driven engine that handles things as they happen without constantly looping code. The event engine does all the work for you and all the event based programming languages all work like this excpet ISY has more options.

I fyou have any expereience with VB you should have a feel for this style but if you have only delay wit inline code it may confuse you until a feel is had for event driven code.

 

You need to post the programs that are involved so people can read them. The code you posted only runs another program and gives no indications of any notifications code.

Posted

I can honestly say every time you and oberkc reply about variable topics. In one hand I feel smarter because I learned something new. While on the other hand I quickly notice how dumb I feel because these concepts just never take hold in my little brain.

 

As always, thank you and to oberkc for making me smarter and dumber at the same time . . .

 

LOL . . .

 

I mostly feel dumb when I read posts from everyone.

Archived

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

  • Recently Browsing

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

  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.4k
×
×
  • Create New...