aLf Posted March 9, 2017 Posted March 9, 2017 I'm ready to move on to using Variables. I've read various posts on the subject and of course the WIKI. I'm still quite confused as to where I should start. Does anyone/has anyone written a good mini-course on the subject? Thanks.
oberkc Posted March 9, 2017 Posted March 9, 2017 Are you asking how to create a variable, or where/why/how one would use a variable? I would expect that the starting point would be to create the variable.
stusviews Posted March 9, 2017 Posted March 9, 2017 A variable is a marker that something has occurred, did not occur or has changed. For example, I use variables to turn off the HVAC if a window or door is left open . IMO, the starting point is the need for a variable. What do you want to accomplish?
oberkc Posted March 10, 2017 Posted March 10, 2017 IMO, the starting point is the need for a variable. Wholly agree!
apostolakisl Posted March 10, 2017 Posted March 10, 2017 Example, When my phone logs into my home wifi, tasker uses a REST command to set a variable on ISY that indicates I'm home (1). When I leave, it sets it to 0. I have dozens of variables all related to my day/date programs. Version 5 of the firmware makes them obsolete. I also have a bunch of variables for my CAI webcontrol. But again, version 5 makes them obsolete because of the ability to create custom nodes and thanks to IOGuys nodeserver interface that keeps the nodes in sync with the CAI
larryllix Posted March 10, 2017 Posted March 10, 2017 Just access the STATE variable tab in admin console. Type in a name for a variable and hit save. Write a test program to save a value into the variable. Check the variable page again to see your value stored there. Write another test program with an IF line using your variable testing if the variable is equal to 5. In the then section write lines to turn a light on or off as an indicator. Manually change the value of the variable, hitting enter each time and watching the indicator you wrote. You're using variables. Play, play, play. Sent from a tiny keyboard. Response may be brief.
sanders2222 Posted March 10, 2017 Posted March 10, 2017 I too use dozens of variables that include day/date. I have a variable that tracks daylight and evening times (0 = daytime, 1 = sunset, 2 = prime time, 3 = late night and 4 = midnight). The number change can trigger programs that turn on/off devices, change HVAC settings or monitor statuses. I have one variable that mirrors my security arm state (0 = I'm home, 1 = away or out on the town and 2 = On Vacation). These variables control folders that contain sets of programs. If I'm away my HVAC settings are different and if its after dark, it's nice to come home to a lighted driveway. But I don't want to light the drive every night if I'm on vacation. The Vacation folder programs also have a number of random wait actions I don't need or want when I'm home. Another variable counts the times the door into our garage opens/closes each day. This allows my system to revert to vacation programs if no one is home for a day.
Paulk8 Posted March 10, 2017 Posted March 10, 2017 Example, When my phone logs into my home wifi, tasker uses a REST command to set a variable on ISY that indicates I'm home (1). When I leave, it sets it to 0. Is there any step by step instructions on how to this? Thanks
apostolakisl Posted March 10, 2017 Posted March 10, 2017 Is there any step by step instructions on how to this? Thanks There is a tasker tutorial in the forum which covers how to have tasker set variables (or whatever) on ISY. You could also use IFTTT with its geolocation recipe or its wifi connected recipe. This would be easier to setup. IFTTT did not exist when I first started using Tasker to do the job. No reason to change now. Tasker works great, just more complicated to setup. But also a lot more customizable, if you care to do that. IFTTT is pretty easy. You have to point port 443 to your ISY and install a security certificate, or you can get the ISY portal. Then you put in the rest command. For example, this is the command for setting a variable in ISY that I have in IFTTT https://admin:mypassword@myurl//rest/vars/set/2/27/1 of course you susbsitute your password and your url. I have port 443 forwarded to my ISY and a self signed certificate. It would be done slightly different with the ISY portal, but since I don't have it, I can't say for sure what you do. If you use tasker, you enter the same thing, but there are other steps.
oberkc Posted March 11, 2017 Posted March 11, 2017 Is there any step by step instructions on how to this? User manual and wiki. You have already read the wiki. The user manual is available at the wiki. Beyond that, none that I am aware of. I go back to stusviews observation. The first question I ask is "why" do you want to use variables. Is this, simply, an intellectual challenge, a solution looking for a problem, or is there some task for which you believe variables are the only solution? Other than some pretty extreme stuff, it is my opinion that darn-near everything can be done without variables. Yes, they may make things cleaner and easier to follow at times, but you can do A LOT without them.
aLf Posted March 12, 2017 Author Posted March 12, 2017 Sorry, been out the last two days. I'm first off looking to understand and use them. 1st spot ill work with is with cameras, and my Schlage door locks. I like the idea that if I walk up to the house the iphone could sense it's me and unlock a door. From there, I will just play with it. I had seen some ideas with the Schlage locks a long time ago. Guess I can start there. The cameras are a whole big project that I'm sure will have many uses. For now though, I just want to experiment and educate myself.
stusviews Posted March 12, 2017 Posted March 12, 2017 Variables are usually used to automate a task. If you're going to initiate the task using a smartphone, then there is no need for a variable. Cameras themselves do not interface with the ISY, You'll need the network module and a list of commands from the manufacturer of the camera. That's an ideal, but complex, task for variables. You may want to start simpler.
aLf Posted March 15, 2017 Author Posted March 15, 2017 I've already got the Axis cameras working great with ISY, just wanted to explore Variables to see if there are internal functions in the camera that will work better.
oberkc Posted March 15, 2017 Posted March 15, 2017 I do not see how variables will have any impact or relevance to the interaction between the ISY and Axis camera. Variables are mostly used in programs, either as a condition or action. I assume you interract with your camera through the network module and network commands/resources, no?
aLf Posted March 22, 2017 Author Posted March 22, 2017 Got a way to control motion from Axis. I was hoping to use a variable to note the posting or lack off to the cam from the web. Then use that variable to turn a KPL light on/off.
Recommended Posts