Author Topic: MultiString Plugin  (Read 26277 times)

Offline JohnRob

  • Full Member
  • ***
  • Posts: 245
  • Karma: +12/-4
MultiString Plugin - Syntax
« Reply #90 on: January 18, 2017, 08:34:18 pm »
With RichardTSchafer's comment and some investigation I have LUA code that will read and write to a Multistring Variable.

Interesting, I found the Variable name used in the code is not the same as shown in the device / control section of Multistring.
Specifically the device shows  variables as V1. V2...V5.   However the code must use Variable1, Variable2...Variable5.

The below code needs only to have the device ID (dID) of MultiString to work.

Read Variable5  (V5)
Code: [Select]
local tmpValue, timeStamp = luup.variable_get("urn:upnp-org:serviceId:VContainer1","Variable5", dID)
luup.log("V5 Read Contents xxxxx")
luup.log(tmpValue)
luup.log(timeStamp)


Set Variable5  (V5)
Code: [Select]
local returnArguments = luup.call_action("urn:upnp-org:serviceId:VContainer1", "SetVariable5", {["newVariable5"] = "set"}, dID)
luup.log("V5 Set Contents yyyyy")
luup.log(error) -- not verified
luup.log(error_msg) -- not verified
--returns: error (number), error_msg (string), job (number), arguments (table)

The xxxxx and yyyyy in the log is simply to make it easy to search for.


I hope this helps some folks.


Offline Tommi

  • Sr. Newbie
  • *
  • Posts: 35
  • Karma: +0/-0
Re: MultiString Plugin
« Reply #91 on: January 19, 2017, 05:26:32 am »

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6203
  • Karma: +276/-70
  • "Less is more"
Re: MultiString Plugin
« Reply #92 on: January 19, 2017, 05:40:51 am »
any hint how to use it from http call?
trying
http://IP:port/data_request?id=variableset&DeviceNum=XXX&serviceId=urn:schemas-upnp-org:device:VContainer1&Variable2=66
and
http://IP:port/data_request?id=action&output_format=xml&DeviceNum=XXX&serviceId=urn:schemas-upnp-org:device:VContainer1&action=SetVariable2&newVariable2=66
first return OK and no change on variables (nil variable added)
second "ERROR: No implementation"

  • DON'T use variable_set.
  • you have the serviceID wrong on the second call (you're trying to use a device schema.)  Try "urn:upnp-org:serviceId:VContainer1"

The details are kind-of critical.

3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline Tommi

  • Sr. Newbie
  • *
  • Posts: 35
  • Karma: +0/-0
Re: MultiString Plugin
« Reply #93 on: January 19, 2017, 06:40:06 am »
any hint how to use it from http call?
trying
http://IP:port/data_request?id=variableset&DeviceNum=XXX&serviceId=urn:schemas-upnp-org:device:VContainer1&Variable2=66
and
http://IP:port/data_request?id=action&output_format=xml&DeviceNum=XXX&serviceId=urn:schemas-upnp-org:device:VContainer1&action=SetVariable2&newVariable2=66
first return OK and no change on variables (nil variable added)
second "ERROR: No implementation"

  • DON'T use variable_set.
  • you have the serviceID wrong on the second call (you're trying to use a device schema.)  Try "urn:upnp-org:serviceId:VContainer1"

The details are kind-of critical.

Perfect, thanks :)

Offline Chrisfraser05

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +16/-31
Re: MultiString Plugin
« Reply #94 on: March 11, 2017, 01:25:27 pm »
I just wanted to say thanks to Rex for the plugin and to everyone for this thread.

I first started using the plugin a good while back but only for putting text into tasker.

With the help of this thread I've created a watchdog timer for Vera and Domoticz so the other one emails me if either one hangs up or otherwise goes off the network.


Cheers guys

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 444
  • Karma: +8/-1
Re: MultiString Plugin
« Reply #95 on: July 28, 2017, 09:33:05 am »
Hi,

it seems that with the last firmware upgrade (1.7.2931 on VeraEdge) the command to set Name or Value via UI7 Control page of the device is not working.

Anybody with the same problem ?

tnks

donato

Offline pit

  • Sr. Newbie
  • *
  • Posts: 44
  • Karma: +3/-0
Re: MultiString Plugin
« Reply #96 on: March 06, 2018, 05:10:57 am »
I use Multistring intensively with many instances (veraEdge, 1.7.3500) as parameter pool. Great app!
It's possible to add several instances of Multistring as scene trigger. But afterwards looking at the scene trigger selection list is a little bit confusing. The description of the Multistring instance is'nt displayed but only "V1_level_equals" etc.

Is there a way to bring any identification of theMultistring  instance into the scene trigger selection list?

Offline tunnus

  • Jr. Member
  • **
  • Posts: 57
  • Karma: +0/-0
Re: MultiString Plugin
« Reply #97 on: March 20, 2018, 04:38:40 pm »
is there a way to modify this so i can have a few more variables?  i'd love to be able to group my variables per function on a single multistring, but some of my functions have 6 variables that i want to be able to modify from the GUI.

I would like to know this also. Has anyone succeeded in using more than 5 variables with a single instance?

Offline kartcon

  • Full Member
  • ***
  • Posts: 158
  • Karma: +7/-0
Re: MultiString Plugin
« Reply #98 on: March 20, 2018, 07:30:26 pm »
@tunnus,
It would be far easier to simply create another instance of MultiString, but.... if you must have only one instance, you can get creative and combine variables then split them again when evaluating. See additional info here: http://lua-users.org/wiki/SplitJoin/. I personally would not use this approach, but if you must...

Now, I actually do concatenate variables in MultiString for display purposes only. I have a very complex script that does some variable delay, variable start/stop lighting controls. While I was working on the script, I used MultiString to display about a dozen variables in the five available slots. This is now trimmed down to just 9. See screenshot below. I also posted on this technique earlier here: http://forum.micasaverde.com/index.php/topic,55016.msg341834.html#msg341834

Offline rstrouse

  • Hero Member
  • *****
  • Posts: 836
  • Karma: +30/-9
Re: MultiString Plugin
« Reply #99 on: March 20, 2018, 07:49:20 pm »
You know VirtualPanel will allow you to add as many variables as you like to a panel as well as format them and/or create controls to set them.

http://forum.micasaverde.com/index.php/topic,31128.msg281520.html#msg281520
1xVera3 1.7.619, 4xLinear WT00Z, 3xLinear WS15Z, 1xLeviton VRCZ4, 10xCooper RF9540, 1xLeviton VRFI10, 1xLeviton VP00R, 2xLinear GD00Z-4, 1xGE/Jasco 45612, 1xGE/Jasco 45610,  4xGE/Jasco 45605, 2xYale YRD220-ZW-619, 1xCaddx NX584, Autelis Intellitouch Pool Control, OpenSprinkler

Offline kartcon

  • Full Member
  • ***
  • Posts: 158
  • Karma: +7/-0
Re: MultiString Plugin
« Reply #100 on: March 20, 2018, 09:26:47 pm »
@rstrouse

I've used your plugin and I can say I did love it, but for me it was very memory intensive. Unfortunately I had to remove it simply because what I was using it for was mostly cosmetic. It does a great job of making unified control panels for groups of controls and the tools it offers do allow for lots of flexibility, but once I began having controller issues Vera customer service pegged it as a memory hog and suggested removing it.

I do believe that using it in moderation would be ok, but in my system moderation is a difficult thing for me to embrace. I am always looking for ways to improve the usability for my non-techie wife and visual control panels WERE the ticket for her. I had nearly a dozen panels, all with multiple controls, indicators, custom icons and an enormous amount of code simply to add visual cues for my wife. It was impressive while it was running, but I had to let it go. Since then, she has come to terms with the Vera interface but still reminds me of how much easier the Panels were.

By no means is this a negative review, actually quite the opposite. It really is a cool plug in. My only suggestion is to use it in moderation. Resist the temptation to allow it to balloon out of control. (I couldn't).

Offline rstrouse

  • Hero Member
  • *****
  • Posts: 836
  • Karma: +30/-9
Re: MultiString Plugin
« Reply #101 on: March 20, 2018, 11:17:15 pm »
That's a pretty intense panel 50+ data points on a single panel instance.  Still, I've seen some pretty elaborate panel setups without issue.

1xVera3 1.7.619, 4xLinear WT00Z, 3xLinear WS15Z, 1xLeviton VRCZ4, 10xCooper RF9540, 1xLeviton VRFI10, 1xLeviton VP00R, 2xLinear GD00Z-4, 1xGE/Jasco 45612, 1xGE/Jasco 45610,  4xGE/Jasco 45605, 2xYale YRD220-ZW-619, 1xCaddx NX584, Autelis Intellitouch Pool Control, OpenSprinkler

Offline crackers8199

  • Jr. Member
  • **
  • Posts: 75
  • Karma: +0/-0
Re: MultiString Plugin
« Reply #102 on: June 06, 2018, 09:48:24 pm »
i'm trying to get multistring to set a variable name each time a pin code is entered on my front door lock.  the instructions seem to indicate that you can set the variables in a scene, but i don't have multistring showing up in the list of action devices.  am i doing something wrong?

Offline Tarkus

  • Sr. Newbie
  • *
  • Posts: 20
  • Karma: +6/-0
Re: MultiString Plugin
« Reply #103 on: June 20, 2018, 06:59:44 am »
I would like to replace a device id with a unique name, e.g. device id 125 to Bedroom light. Is this possible with this app? I would also need it to work with a http request. Any instruction on how to set up would be appreciated.

Thanks