Plugin Zooper

Post your questions and help other users.

Moderator: Martin

Post Reply
Kriggi23
Posts: 21
Joined: 21 Jul 2013 08:38

Plugin Zooper

Post by Kriggi23 » 05 Jan 2014 19:03

Hi all.
I just played a bit with the zooper plugin but there is something realy annoying.
You have to remove always the quotes automagicly set by AM.
But for pasing variables to zooper they need to be removed.
Can you please fix this ;-)

TIA
Christian

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Plugin Zooper

Post by Martin » 06 Jan 2014 17:31

Hi,

Did you specify the variable in Zooper using the curly brace syntax (for example {test}) or did you just write text?

Regards,
Martin

Kriggi23
Posts: 21
Joined: 21 Jul 2013 08:38

Re: Plugin Zooper

Post by Kriggi23 » 06 Jan 2014 17:57

Hi Martin,
what i did is made a flow with the action plugin: zooper press configuration and added the zooper variable and the AM variable in pure text (without brackets).
At the screen where the "script" is shown the AM variable is placed in quotes which i have to remove to make the flow working.

Btw. would be nice to be able to choose a AM variable at "zw text" ;-)

Gruß
Christian

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Plugin Zooper

Post by Martin » 06 Jan 2014 18:25

Hi Christian,

Please try to use the curly brace syntax in Zooper. In field ZW Text you have to write something like {test}.

Automagic replaces variables with curly braces like {test} in a string, otherwise it's just a constant string.
putString("...extra.STRING_TEXT", "test"); will only pass the text "test" to Zooper

test = "dynamic value";
putString("...extra.STRING_TEXT", "This is a {test}"); will replace {test} with the value contained in variable test before the string is passed to Zooper (results in "This is a dynamic value")

The dialog shown when you press "Configure" is part of Zooper. Automagic can not offer a variable selection in this screen.

Gruss
Martin

Kriggi23
Posts: 21
Joined: 21 Jul 2013 08:38

Re: Plugin Zooper

Post by Kriggi23 » 06 Jan 2014 19:33

Hehe learned something new :-)
I think your way is much more flexibel so im following you.

Good to know i dont have to delete quotes over and over again!

Next ill have to check what i can do with AM and fhem to my homematic ;-)

Frohes neues Jahr noch
Christian

newturn
Posts: 30
Joined: 20 Apr 2016 08:36

Re: Plugin Zooper

Post by newturn » 15 Jul 2016 23:09

Hi,

how to handle the case if the putstring function which is used starts with ' (one quote)? The vars {my_var} won't be parsed :(

Also how to use the array in a plugins dialog box for the whole {mylist[]} or {mylist()} or only {mylist} and just for one element {mylist3}?

thanks!

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Plugin Zooper

Post by Martin » 16 Jul 2016 08:32

Hi,

You can use double quotes if variables in a string literal should be replaced. Post an example, maybe I don't understand your case properly.

You can access the element of a list with brackets containing the index of the element: {mylist[3]}
Since you are in in a scripting context, you could also skip the entire string literal. Instead of: putString("xyz", "{mylist[3]}"); you could also write: putString("xyz", mylist[3]);
Passing the entire text of a list to a plugin could be achieved with: putString("xyz", "{mylist,listformat,comma}"); This will create a comma separated list in CSV-style including escaping of values when necessary. If escaping is not desired, you could also use putString("xyz", join(mylist, ","));

Regards,
Martin

Post Reply