Jump to content

Recommendations needed for programming methodology


Recommended Posts

Posted

I used a  Circuit Cellar HCS2 system for over 20 years, until it began misbehaving with X10 control. Besides not having  modern connectivity it was quickly becoming a pain to repair and manage. So a few months ago I bought an ISY994/i and, for the most part, upgraded my controls to Insteon devices.

I've been reading the forums before starting to program and am having a little trouble conceptualizing how things should work. I'd read that the ISY is unlike a computer, but more like a process controller. I get that; the HCS2 was much the same. However, a user would write a "program" using the XPRESS language, then compile it into an executable that was then loaded onto the HCS2. In this manner I had a master program that had several versions: one for 'everyday' functions like controlling porch lights and an inside light. When I needed to go away fro a few days I had a 'vacation' program that had the everyday functions but also controlled lights in a random fashion for a lived-in look. When I arrived back home I'd re-load the everyday program and go about my life. I was also used to controlling my lights one-to-one with wireless and table top remotes. Want a light on? Address it directly.The ISY / Insteon paradigm seems totally different.

 

And so I'm asking for advice. I understand that I can write a 'program' utilizing 'scenes' (which could be simply all the lights in a single room). I could write a program that incorporates the everyday actions with the away actions. But if I wanted to trigger the away part of the program, how would that be done? I've been to the hospital a lot lately, and may need to quickly shift modes, then reverse them when I return.

Any input on this would be greatly appreciated, and thanks in advance.

Posted

There is no right or wrong way to program the isy to control your gear. The best way to program is based on what suits you best. There are those on here who use programs mainly while others such as myself use mostly scenes and allow the programs to control the scenes Ive created. The best way to figure out what suits you best is to experiment with a few things and see what comes about. 

Everything you did with x10 you can do with insteon (and much more). It all comes down to how you design your system. Before starting, plan out what you are trying to accomplish and what matters most to you. That is what will determine the path for you to take. If you want to control stuff with remotes and rely less on automation (and the isy) then scenes will be your best bet overall. If you just want the ISY to do everything for you and work towards true automation, then programs will become much more important. 

I use a high combination of both. I set my scenes first. This way I know everything that I want to do will work outside of the ISY. My 2nd reason is uniformity. I like everything being in sync which you do not get with programs. 

Its hard to answer exactly on how to do something that has different variables to them. The best method is determined by exactly what you want to happen, the devices you have and expertise as some of the best methods are more complex. 

The way I set my away program utilizes both scenes and programs. When I hit my away button, it starts a program that turns off each room 1 at a time. I could do it a different way (such as a separate scene) but since I already have those set up, I simply use those. Once it gets dark enough in the house (where we want more light) our lights will automatically turn on (depending on different conditions) When we are not home, they turn on at a lower level for the dog in certain areas. If we hit our away button after sunset, the lights that are supposed to come on in our absence will automatically turn on at that time while everything else turns off.

There are other programs, systems, and devices in place that allow me to accomplish what I am doing. This is why I said the best method is determined by other variables. An open question like yours can elicit 20 different responses and styles because of what other people have or do which can make things even more confusing for someone not yet versed in how to set up their system. 

 

 

  • Like 1
Posted
20 hours ago, TheHarbinger said:

However, a user would write a "program" using the XPRESS language, then compile it into an executable that was then loaded onto the HCS2. In this manner I had a master program that had several versions: one for 'everyday' functions like controlling porch lights and an inside light. When I needed to go away fro a few days I had a 'vacation' program that had the everyday functions but also controlled lights in a random fashion for a lived-in look. When I arrived back home I'd re-load the everyday program and go about my life.

With the ISY you won't have to reload different programs when you return.   To get you started I'd suggest you create a "state variable" called "Away" or "Vacation".  Assume that variable will always be 0 for OFF or 1 for ON.   Now as you create programs you can include IF $Away = 1 THEN....  or even more complex IF $Away = 1 AND ON TUE Time is 8:05AM THEN....  and likewise conversely you can IF $Away = 0 ...... THEN...

How does AWAY get updated?  One way is manually, just set the variable to 1 or 0.  Another way is you could have a button on a 6 or 8 button keypad set to turn away mode on or off.  In my original setup I used a modified version of that, the button would turn away mode ON anytime someone pressed it, but to actually get away mode to turn off you had to know the secret: Turn on 2 specific lights the would be off in away mode, and then open AND close the laundry room door then you had 10 seconds to press the Away button to turn it off.  I've since updated the whole Away mode logic to be automatic, using the ISY portal, and the App Locative to create a geofence.  Now if BOTH my phone and my wifes phone are not home Away is automatically set, or if ONE OF us arrives home it's cancelled.   In the process of making that update I also decided to make the variable Away have two more values, instead of just 0=Off and 1= On my programs now all recogize 4 values for Away: -1=Away mode off, geofence disabled;  0=Away mode OFF, geofence can enable; 1=Away mode ON, geofence can disable, 2=Away Mode ON, Geofence can't disable.  Previously I also had a second variable called Vacation which had more automated lighting controls, I've now consolidated that to be included with Away = 2.  And that button on the 8-button controller that previously controlled Away mode.... it's now just an indicator light for Away, it no longer controls the state of away mode.

 

21 hours ago, TheHarbinger said:

Want a light on? Address it directly.The ISY / Insteon paradigm seems totally different.

You can still do exactly that. 

  • Like 1
Posted (edited)
14 minutes ago, MrBill said:

With the ISY you won't have to reload different programs when you return.   To get you started I'd suggest you create a "state variable" called "Away" or "Vacation".  Assume that variable will always be 0 for OFF or 1 for ON.   Now as you create programs you can include IF $Away = 1 THEN....  or even more complex IF $Away = 1 AND ON TUE Time is 8:05AM THEN....  and likewise conversely you can IF $Away = 0 ...... THEN...

How does AWAY get updated?  One way is manually, just set the variable to 1 or 0.  Another way is you could have a button on a 6 or 8 button keypad set to turn away mode on or off.  In my original setup I used a modified version of that, the button would turn away mode ON anytime someone pressed it, but to actually get away mode to turn off you had to know the secret: Turn on 2 specific lights the would be off in away mode, and then open AND close the laundry room door then you had 10 seconds to press the Away button to turn it off.  I've since updated the whole Away mode logic to be automatic, using the ISY portal, and the App Locative to create a geofence.  Now if BOTH my phone and my wifes phone are not home Away is automatically set, or if ONE OF us arrives home it's cancelled.   In the process of making that update I also decided to make the variable Away have two more values, instead of just 0=Off and 1= On my programs now all recogize 4 values for Away: -1=Away mode off, geofence disabled;  0=Away mode OFF, geofence can enable; 1=Away mode ON, geofence can disable, 2=Away Mode ON, Geofence can't disable.  Previously I also had a second variable called Vacation which had more automated lighting controls, I've now consolidated that to be included with Away = 2.  And that button on the 8-button controller that previously controlled Away mode.... it's now just an indicator light for Away, it no longer controls the state of away mode.

 

You can still do exactly that. 

I have found "away" and "vacation" to be different functions, completely. For Away I don't shut down my HRV ventilation or set my heating or humidifier back. They take many days to recover. Away runs off of 12 MSes and a few other components like SwitchLincs etc that can only be operated by humans inside the house. The Home / Away countdown timer stops during sleep hours and continuous in the morning. Each MS resets the timer to a different number of minutes remaining. Setting the ISY based security system from a KPL as a combo keypad, cancels the timer.

I run my Vacation variable off my ecobee thermostats as the stats have detailed timers and preset-ability for future dates. Vacation runs more security home lighting faking etc.. and sets HVAC parameters back to save energy money.

I gave up on automatic Vacation mode as I would get home the next day or two and the HVAC would be set back and we we sleep in a cold house for the night. Infloor slab heating is like that and can take days to get back to normal. YMMV.

Edited by larryllix
  • Like 1
Posted
7 minutes ago, MrBill said:

With the ISY you won't have to reload different programs when you return

I use the Holidays Google nodeserver. When I am going on a trip I add a whole day event in a specific Google calendar and  several of my programs  have a condition in IF that makes the THEN dependent on the Trip (or not). In fact, I also have a program that randomly turns lights On and Off while I am on a trip.

  • Like 3
Posted
2 minutes ago, larryllix said:

I have found "away" and "vacation" to be different functions, completely. For Away I don't shut down my HRV ventilation or set my heating or humidifier back. They take many days to recover. Away runs off of 12 MSes and a few other components like SwitchLincs etc that can only be operated by humans inside the house. The Home / Away countdown timer stops during sleep hours and continuous in the morning. Each MS resets the timer to a different number of minutes remaining.

I run my Vacation variable off my ecobee thermostats as the stats have detailed timers and preset-ability for future dates. Vacation runs more security home lighting faking etc.. and sets HVAC parameters back to save energy money.

I gave up on automatic Vacation mode as I would get home the next day or two and the HVAC would be set back and we we sleep in a cold house for the night. Infloor slab heating is like that and can take days to get back to normal. YMMV.

My Vacation mode isn't automatic, it's just now rolled into the same variable used for away, the only way Away can become =2 is if it's set or reset manually.  When set to 2 basically the Fake Lived In look lighting programs are activated and geo-location control of the Away variable is disabled (not that either phone would come home but it eliminates a potential point of failure.  My HVAC is simpler than yours, I still use a Nest because it gives me a $100 annual rebate from the power company, the nest isn't even controlled via ISY anymore because nest doesn't want to share.  (I've been going to fake hook up the nest so the power company can think they are controlling it and switch to Ecobee but I've never gotten around to that project.)

  • Haha 1
Posted

@TheHarbinger As you can see from the above responses, those are very experienced experts on ISY and have been creating programming for a long time and therefore are great resources.

Sometimes in the beginning though it can be very confusing as to how to go about getting the system "structure" that will work for you long term. For most, it takes starting simple to experience different methods and then settle on the ones that will work for you. A great starting place is to glance through the ISY Cookbook, located about ½ down this page. https://wiki.universal-devices.com/index.php?title=Main_Page

Some key concepts that are mentioned in the above responses:

-Scenes: These include devices which can have different preset ON values etc. For example: when I turn on Kitchen Dinner scene, light 1 turns off, light 2 turns to 60%, light three to 100% etc. When I turn the scene off, they all go off. Its a very easy and powerful way to control quickly and locally 

-Programs: Allow for an infinite number of IF / THEN / ELSE combinations. For example, I could initiate the above Kitchen Dinner scene, through turning on button A of a 6 button Insteon switch. Or I could do it though Alexa via voice command. Or it could come on at sunset and go off 3 hours later, etc etc. One program can call any other number of programs, or disable, them or enable them, etc  THIS IS THE REAL POWER OF THE ISY. Its infinite. 

-Variables: By using variables, you can put overriding conditions on any program, initiate programs, or even a folder containing many programs. ie: the AWAY examples above demonstrate this. By setting a variable AWAY to 1, then all your programs that you want to run while you are away will execute. You can put delay timers in etc so if its initatied var button B on a keypad, then you may delay it 30 minutes until you leave the house.

The biggest learnings most have when beginning is with nomenclature. Consistency will pay huge dividends down the road as your system expands and gets more complicated. Some of basic tips most use include: All lights in the same room start with the same room name: Kitchen cans, Kitchen island, Kitchen sink.. etc. This way they are all grouped together alphabetically. Programs should use a similar structure in naming so that all related programs for a given task are easily identified and grouped. For example a program called Lights off is poor name.. which lights? better would be Kitchen lights off, Kitchen lights on,  Kitchen lights dim at evening etc. All kitchen activities start with the word Kitchen. As your programing skill with ISY expands, you will want to have some programs that are Disabled. These programs do not test the IF statement unless called by another program. Sometimes during reboots or programing etc it gets confusing which programs should be disabled. I have adopted a naming process where I add LD to the end of any program to reference and remind me to Leave Disabled. Variables become a key part of any system as well. There are State and Integer variable types. Some put a S before each state variable name and and I before each integer name. Since I have 5x more state variables than integers, I simply just add the I to integer and assume if there is no I then its a state. 

Anyway, the ISY is an amazingly solid platform with lots of levels of complexity to discover. Feel free to DM me if you ever have a simple concept you would like an outline for etc. 

Cheers, welcome and good luck!

  • Like 2
  • Thanks 1
Posted

@TheHarbinger

I would put a slightly different spin on things.  The first question you should answer is how you envision the human interraction between you and your system that “away” mode has begun or ended.  (the programming question can really only be addressed one you establish this interraction method.). Assuming you are interracting via Insteon devices (certainly there are other options) you must decide which...switch?... Keypad?...   motion sensor?  Door sensor?   ISY admin panel?  Combination?  Other?

Spend some time deciding how YOU want to initiate this mode.  After that we can talk about programs, program triggers, variables, node servers, etc...

  • Like 1
Posted

THANK YOU everyone for your excellent input and advice! This helps me to frame my thinking on how to proceed. For now I'll need to decide how to initiate and cancel the away/vacation mode (probably via an Insteon hard switch). Eventually I'd like to announce to Alexa that I'm leaving on vacation and have the proper mode set. That may be a bit down the road but it certainly sounds doable.

Posted
8 minutes ago, TheHarbinger said:

Eventually I'd like to announce to Alexa that I'm leaving on vacation and have the proper mode set. That may be a bit down the road but it certainly sounds doable.

I used to use a lot fancy things with existing switches to initiate different things, but generally I was the only one that could do anything. 

Then Alexa became usable. We now interact as follows: Direct switches 0 (except occasionally for that light, but never to initiate things), keypads 10%, Mobilinc 20%, Alexa 70%, with my wife at 100% for Alexa.

Alexa revolutionized the ISY for my family of which allowed me to expand ISY use greatly. 

Everything from simple lighting changes (scenes) for the main level: Alexa, turn on kitchen mood, or kitchen dinner, or kitchen supper, or kitchen evening, or kitchen nightlight, or directly any of ~20 switches in this main room.

or more complex routines like "Goodnight" which initiates a bedtime lighting routine changing over 30 minutes and then monitors for any light to be turned on and left on for more than 20 minutes to locking the doors, arming the security, and then setting off morning routines either based on an alarm time, or a set time, or "goodmonring" etc, that based on temps, turn on a fireplace, certain lights, unarms the system, prepares for a dog sensor for the dog to go out (to then remind us he is still out or notify us if he comes back into the garage), etc.

Power of Alexa directly interfacing with ISY, along with (the harder to remember) custom routines has really been the key to making ISY an ongoing loved part of our house vs an isolated hobby of mine that generally annoyed others. lol

  • Like 1
Posted
On 10/9/2020 at 11:11 AM, dbwarner5 said:

-Variables: By using variables, you can put overriding conditions on any program, initiate programs, or even a folder containing many programs. ie: the AWAY examples above demonstrate this. By setting a variable AWAY to 1, then all your programs that you want to run while you are away will execute. You can put delay timers in etc so if its initatied var button B on a keypad, then you may delay it 30 minutes until you leave the house.

As I mentioned above, I use the Holidays Google nodeserver with its Today node in the IF of several of my programs; IF  calendar XYZ is True THEN  etc. Other programs have IF calendar XYZ is False  THEN etc.    An example would be that in  a morning routine program the THEN only runs when in the IF the calendar XYZ Today node is False.

My question is whether using the variable, as in your example,  would be a better  method.

Posted
27 minutes ago, asbril said:

As I mentioned above, I use the Holidays Google nodeserver with its Today node in the IF of several of my programs; IF  calendar XYZ is True THEN  etc. Other programs have IF calendar XYZ is False  THEN etc.    An example would be that in  a morning routine program the THEN only runs when in the IF the calendar XYZ Today node is False.

My question is whether using the variable, as in your example,  would be a better  method.

I dont think it would add anything based on what you have shared. There are times for example where you may want a group of programs to run, but where the IF statement is complex, and then certain of these other programs may have their own additional IF criteria. In this case, this program may turn false if an element of the original group turns false, but that may not be what you wanted. The point being is that the complexity of IFs can be greatly simplified sometimes using conditional variables with just one program controlling the variable, or folders with conditional variables, But if you only have three and they are pretty simply, no need to add another layer through a variable.

I also will use variables to signify a certain condition. I then have that variable drive a simple program that is true or false,  that I then use in Mobilinc. phone app. on the dashboard to quickly tell if something is open or shut (garage door). etc. 

 

  • Thanks 1
Guest
This topic is now closed to further replies.

×
×
  • Create New...