Author Topic: MultiString Plugin  (Read 15006 times)

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +476/-10
MultiString Plugin
« on: February 24, 2015, 01:45:02 pm »
MultiString V1.2 has been released in the App Store.

The plugin provides five string variables with custom names that are displayed on the device tile in Vera's user interface. The name and value of each variable may be set from the device's Control tab, using scene and PLEG actions or through luup.variable_set(...) calls. These parameters may also be accessed as PLEG Device Properties and with luup.variable_get(...) calls. Scene trigger events are provided for each variable. The events allow the conditions: goes below; goes above and equals the specified constant.

MultiString uses the same Device-type and ServiceID pioneered by the VariableContainer plugin. This should allow compatibility with existing mobile Apps. If you install MultiString on a system where VariableContainer is already present, there will be side effects. On my UI5 test system, all the devices were converted to the MultiString device interface but otherwise seemed to work correctly. It is possible that there could be issues due to multiple definition of the Service IDs so I do not recommend co-residence.

The plugin is designed to work with either UI5 or UI7. When run on UI7, some files have to be moved when the plugin is first initialized. This happens automatically but an additional Reload Luup and browser page refresh is required before the device UI is displayed correctly.

Instructions are available here.

Version history and planned enhancements.

Edit: 25/02/2015 09:25  V1.0 released in App Store. No icon on UI7.
Edit: 25/02/2015 14:00  V1.1 released in App Store. See Version history.
Edit: 12/03/2015 00:10  V1.2 released in App Store. Fixed for firmware 7.0.5.
« Last Edit: March 11, 2015, 08:10:02 pm by RexBeckett »

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 9427
  • Karma: +716/-130
    • RTS Services Plugins
Re: MultiString Plugin
« Reply #1 on: February 24, 2015, 04:12:41 pm »
The behavior is caused by the DeviceType to JSON mapping.
You have two JSON files for the same DeviceType ... I do not know if the final mapping is deterministic.


Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +476/-10
Re: MultiString Plugin
« Reply #2 on: February 24, 2015, 04:25:41 pm »
Quote
The behavior is caused by the DeviceType to JSON mapping.
You have two JSON files for the same DeviceType

Yes - I knew it would happen. It shouldn't be much of a problem: if users already have the original plugin, they don't need to install MultiString.

Quote
I do not know if the final mapping is deterministic.

It may not be an absolute but it always seems to obey the last device to be initialized - typically the highest device ID.

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +476/-10
MultiString - Version History and Planned Enhancements
« Reply #3 on: February 24, 2015, 04:43:16 pm »
This is a list of the enhancements and fixes planned for future releases. Where a version number is shown, the change is completed and will be in the indicated release.

  • Watch this space.

This is a list of fixes and enhancements incorporated in each released version.

  • There was a tiny error converting some timestamps with milliseconds - 1 ms in 45 years! (V1.2)
  • The UI display was not correct on UI7 version 7.0.5 (V1.2)
  • Allow nil or empty strings to clear names & values. (V1.1)
  • Selectable rounding option for numeric variable values. (V1.1)
  • Convert Epoch timestamp to human-readable form. (V1.1)
  • Icon not displayed on UI7. (V1.1)
  • Initial release. (V1.0)

Edit: 25/02/2015 14:05  V1.1 released.
Edit: 12/03/2015 00:06  V1.2 released.
« Last Edit: March 11, 2015, 08:08:11 pm by RexBeckett »

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +476/-10
MultiString V1.1 Released
« Reply #4 on: February 25, 2015, 09:09:09 am »
MultiString V1.1 is released in the App Store.

Enhancements include options for select-able rounding of numeric values and conversion of timestamps to human-readable form.

See the Instructions link in the first post for details.

Offline mnaz

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +0/-0
Re: MultiString Plugin
« Reply #5 on: February 25, 2015, 10:22:33 am »
Thanks for the plug-in, You sure got that done quickly.

I never had the original VC so I have one question, what is the "Options" variable intended to be used for?

BTW the plugin works well with the ImperiHome Android app.
« Last Edit: February 25, 2015, 10:26:01 am by mnaz »

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +476/-10
Re: MultiString Plugin
« Reply #6 on: February 25, 2015, 10:31:22 am »
Quote
I never had the original VC so I have one question, what is the "Options" variable intended to be used for?

VC didn't have an Options variable. That is something I have taken to adding to all my plugins. It gives users the ability to adjust the functionality to suit their needs. It is all explained in the Instructions.

Quote
BTW the plugin works well with the ImperiHome Android app.

Thanks for that feedback.

Offline mnaz

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +0/-0
Re: MultiString Plugin
« Reply #7 on: February 25, 2015, 10:45:39 am »
Ok I just told myself to RTFM. :)

Now my question on "Options". Would it be nice to retain the original value before being adjusted like rounding in particular. There seems to be a case for both the presentation and original value for calculations.

Maybe since this plug-in is based on strings it implies that it is the presentation of the value and there could be another place to retain variables that the type might be non-strings.

Anyway I like the simplicity of the plugin and am happy to have it available.

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +476/-10
Re: MultiString Plugin
« Reply #8 on: February 25, 2015, 11:55:53 am »
Quote
Now my question on "Options". Would it be nice to retain the original value before being adjusted like rounding in particular. There seems to be a case for both the presentation and original value for calculations.

I did consider that. Rounding is most useful when the device is being used to display values computed in PLEG logic or other plugins. In this case, the source of the number can retain the full precision. Where MultiString is used as a repository for precise values, don't use rounding. If the application requires both a rounded and the non-rounded numbers, they could be stored in separate variables. I haven't ruled it out for a possible future enhancement.

Quote
Maybe since this plug-in is based on strings it implies that it is the presentation of the value and there could be another place to retain variables that the type might be non-strings.


This is what most of us do. We store values in global variables, additional device variables or PLEG Conditions. This is fine as long as you don't need to see them on the UI or with a mobile App. As you suggest, MultiString is more concerned with the presentation of the data in a simple form.

Thanks for your comments. So far I have only implemented features that I have wanted myself or seen other members desire. I shall consider all suggestions with a moderately-open mind.  ;)

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5497
  • Karma: +148/-321
Re: MultiString Plugin
« Reply #9 on: February 25, 2015, 12:43:47 pm »
REX,

Variable container was supported in a few apps. Is this plugin also going to work or is it totally different?

I'm trying to get my ROOMBA status (Thinking Cleaner Plugin) to work in ImperiHome. PLEG can already see the status (charging, Docked, Trickle charging, cleaning.....) I want to try and pass that threw and display it in ImperiHome on a tile.

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +476/-10
Re: MultiString Plugin
« Reply #10 on: February 25, 2015, 02:04:14 pm »
REX,

Variable container was supported in a few apps. Is this plugin also going to work or is it totally different?

I'm trying to get my ROOMBA status (Thinking Cleaner Plugin) to work in ImperiHome. PLEG can already see the status (charging, Docked, Trickle charging, cleaning.....) I want to try and pass that threw and display it in ImperiHome on a tile.

The reason that I used the device-type, Service ID, variables and actions previously used by VariableContainer was to, as far as I can, maintain compatibility for mobile Apps.

@mnaz reports above that it works with ImperiHome. It also works for me using AutHomation.
 

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5497
  • Karma: +148/-321
Re: MultiString Plugin
« Reply #11 on: February 25, 2015, 02:28:13 pm »
I can confirm that it does work in Imperihome.

What I don't understand yet is how to copy the current status of one device and have that update in MultiString. Do I need to really make an action for each possible status?

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +476/-10
Re: MultiString Plugin
« Reply #12 on: February 25, 2015, 04:35:05 pm »
Quote
What I don't understand yet is how to copy the current status of one device and have that update in MultiString. Do I need to really make an action for each possible status?

That's more of a PLEG question than MultiString. I would bind a Device Property to your source (Roomba Status) and use that in a Condition (with Repeat on). The Action for the Condition would set a MultiString variable to the value of the Device Property using the {(name-of-property)} syntax.

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5497
  • Karma: +148/-321
Re: MultiString Plugin
« Reply #13 on: February 25, 2015, 05:36:39 pm »
Thanks I got it to work.

Offline CudaNet

  • Hero Member
  • *****
  • Posts: 1336
  • Karma: +36/-10
  • Chimichanga !
Re: MultiString Plugin
« Reply #14 on: February 25, 2015, 06:54:02 pm »
Much appreciated, hard to accept that I'd lose my VC (I use them a lot) if I ever decided to move beyond UI5...
openLuup, AltUI, Zway and HomeWave, enough said...