Page 1 of 1

How to manage a long string in Lua as persistence object?

Posted: Saturday 21 October 2017 16:57
by bigpea
Hi all,
I need to store a long string in a script Lua.
This string is very long because contains an array of objects.
I tryied to store this data in a user variable but the max lenght of this is 200 chars, and this is a lenght of only one object for me.

Exist a way to manage a very long string in Lua?

Furthermore I need to save this data in a script and to sue this information in another one.

Thanks.

Re: How to manage a long string in Lua as persistence object?

Posted: Monday 23 October 2017 9:21
by dannybloe
Just use dzVents own persistent storage mechanism instead of using uservariables. See the docs for this.

Re: How to manage a long string in Lua as persistence object?

Posted: Monday 23 October 2017 11:14
by bigpea
I have some problem with domoticz.data because if I set a value in this persistence object, it is available in the script in which I set it but not in other script.

Re: How to manage a long string in Lua as persistence object?

Posted: Monday 23 October 2017 11:52
by dannybloe
That's a choice. Read the documentation about global persistent data. It is in the same chapter.

Re: How to manage a long string in Lua as persistence object?

Posted: Monday 23 October 2017 12:04
by bigpea
ok, thanks.