Variable altered

Posted on
Mon Feb 23, 2015 11:21 am
pocster offline
User avatar
Posts: 276
Joined: Nov 15, 2014

Variable altered

Hey!

I thought this would be simple ; perhaps it's me? :oops:

I have a variable that once changed activates some speech - works great!
The problem is if I wish to trigger the same speech again it won't as the variable string hasn't changed.

So in the control page I have an icon that once clicked changes the variable and hence the trigger occurs. I've tried clearing the variable afterwards (i.e. nulling the string) but this seems to cause problems. I'm assuming Sonos is still speaking and of course the trigger keeps activating (i.e. it's changing ).

Is there a neat/more elegant solution? (I've got a suspicion it's gonna be something obvious!)

Cheers

Posted on
Mon Feb 23, 2015 11:25 am
pocster offline
User avatar
Posts: 276
Joined: Nov 15, 2014

Re: Variable altered

Actually a thought.

In the python script.
If I could read the announcement length; I could disable the trigger. Pause that amount of time. Clear the variable. Re-enable the trigger.

Hmmmmmm; seems a bit erky! :evil:

Posted on
Mon Feb 23, 2015 12:40 pm
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Variable altered

The way I have got round this is to change the variable (after you have invoked the speech) to a known value e.g. 'ACTIONED'.
Then put a condition on the same trigger to only action the trigger if the variable does not contain value 'ACTIONED'.

Posted on
Mon Feb 23, 2015 12:43 pm
pocster offline
User avatar
Posts: 276
Joined: Nov 15, 2014

Re: Variable altered

Ahhhhhhhhhhhh ! Now that sounds like a plan :/) thanks !

Posted on
Mon Feb 23, 2015 1:38 pm
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Variable altered

..or simply blank it and have a condition that the trigger not fire if the variable is blank.

Carl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 10 guests