Jump to content

Odd behavior with state variables and Amazon Echo using ISY portal


ahwman

Recommended Posts

I have several ISY state variables which are set via Amazon Echo using the connected home module in the ISY portal. I have also set up programs which monitor the variable’s value and take action accordingly. Intermittently, a program will be executed MANY times instead of just a single execution. Is variable triggering from the Echo via the ISY portal unreliable, or am I missing something simple? This happens approximately 10% of the time. Would I be better off using integer variables?

 

Any ideas?

Chuck

Link to comment

This is one of many very simple programs I use to control my TiVo using an Amazon Echo. I used to use programs instead of variables which worked reliably. I then decided to switch over to variables to clean things up and use the variables to serve double duty between Amazon Echo and Siri. That said, I can’t understand why the program below would ever be executed more than once unless the variable is toggled multiple times...

 

 

 

Commercial Skip - [iD 0029][Parent 006D]

 

If

$hb.Commercial_Skip.Switch.On is 1

 

Then

Resource '(MED) TiVo - Commercial Skip'

Wait 1 second

$hb.Commercial_Skip.Switch.On = 0

 

Else

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

Link to comment

How are you running the program using your voice? Normally On and Off run THEN and ELSE, respectively. It IF section is not tested unless you invoke Izzy. What changes the variable to 1. Are you using a state or integer variable?

Link to comment

How are you running the program using your voice? Normally On and Off run THEN and ELSE, respectively. It IF section is not tested unless you invoke Izzy. What changes the variable to 1. Are you using a state or integer variable?

Basically, when I invoke a command, i,e. “Alexa, turn on comercial skip”, the ISY portal modifies a state variable in this case “hb.Commercial_Skip.Switch.On” is set to 1. This then makes the polling program true and simply executes a network resource to initiate the appropriate TCP command to my TiVo. Afterwhich, it sets the variable to 0, making it false, until the command is invoked again. Quite simple, yet I’m having sporadic instances where this and similar programs are being executed MANY times in a row. The only way this could happen is if the state variable is quickly changing and I can’t understand what would cause this condition...

Link to comment

When you change the variable to 1 (the ISY portal modifies a state variable in this case “hb.Commercial_Skip.Switch.On” is set to 1), the IF evaluates to true and runs the program during the Wait statement. If you don't want the program to run automatically whenever the variable is set to 1, the use an Integer variable instead. Another choice is to use two programs.

Link to comment

When you change the variable to 1 (the ISY portal modifies a state variable in this case “hb.Commercial_Skip.Switch.On” is set to 1), the IF evaluates to true and runs the program during the Wait statement. If you don't want the program to run automatically whenever the variable is set to 1, the use an Integer variable instead. Another choice is to use two programs.

I considered using integer variables instead, however it appears that the ISY portal only supports state variables

Link to comment

The portal does not run a program at all unless you evoke Izzy. The portal runs If when you state On and Else when you state Off. A state variable will run the program automatically when it evaluates as true, independently of the portal. An integer variable will not.

Link to comment

The portal does not run a program at all unless you evoke Izzy. The portal runs If when you state On and Else when you state Off. A state variable will run the program automatically when it evaluates as true, independently of the portal. An integer variable will not.

Yes, I have a pretty good understanding of what you’ve outlined, however what’s throwing me off is why sometimes my programs are running multiple times after only invoking the command once through the Echo. If the variable changes from a 0 to a 1, then the program should only trigger once until it resets back to 0 and is invoked again. It’s almost as though the variable is sometimes being changed multiple times from the portal. I suspect if I could trigger integer variables from the portal that this might correct these rogue instances, however that doesn’t appear to be an option...

Link to comment

You are using a variable in the IF section of you program. Unless you invoke Izzy (voice), the portal does not even know that the IF section exists. How are you running the program? In other words, what changes the variable/runs the program?

Link to comment

You are using a variable in the IF section of you program. Unless you invoke Izzy (voice), the portal does not even know that the IF section exists. How are you running the program? In other words, what changes the variable/runs the program?

Let me clarify. When I invoke a specific voice command, the portal sets a variable to “1” which corresponds to that command. I then have a program which is constantly monitoring the value of said variable. Once it detects that this variable has changed from “0” to “1” it then calls the appropriate network resource and finally sets the variable back to “0”. This system works perfectly accept for the rogue events where it executes multiple times is a given instance..,

Link to comment

If "Resource '(MED) TiVo - Commercial Skip'" changes the variable to 1, then after the wait statement the program will re-run. That's just the way state variable work.

Link to comment

If "Resource '(MED) TiVo - Commercial Skip'" changes the variable to 1, then after the wait statement the program will re-run. That's just the way state variable work.

You’re losing me here. The variable is only being altered via the ISY portal, not the resource. Voice command goes through ISY portal, which then responds by altering the associated variable. Then the “If” statement becomes true and then executes the network resource and finally resets the variable back to “0”. Let me be clear in saying that this system has and does work, I’m only trying to understand why in certain circumstances the program is running multiple times in a given instance. If this were a problem with my program, then the result would be consistently showing up which it is not.

Link to comment

Archived

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


×
×
  • Create New...