gg102 Senior Member
Joined: January 29 2013 Location: United States
Online Status: Offline Posts: 245
|
Posted: February 24 2024 at 13:38 | IP Logged
|
|
|
Dave,
As you know, I'm using Shelly devices. They have changed their responses to be more extensive and detailed.
Of course, the simple data I need is near the end of their list. To handle this, I need to do a lot of
complex substring functions to get the data I want. The better solution would be to use a
ph_split( ph_flattenjson(.......),.....) function.
The problem with the ph_split() function is that it ONLY returns to the [Local] Variables 1-10. Well, I'm
getting back 20-30 fields. Of course, I need something like field 25. Way out of range.
For Example:
Can you make something like a ph_split1() function that includes at the end, a parameter to put the
responses into something like:
1=locals(default). 2=temps, 3=globals?
In this example, I would use option 3 to put the data into globals 1-100. Quite sufficient room for all the
fields. This way, I can acquire the all the fields and read the one I want.
Syntax
ph_split1( data, sep, local-offset, destination )
Argument Description
data String. The data you would like split.
sep String. The separater character or string.
local-offset Integer. The starting index of the local variables to have the split strings copied into.
destination Integer. 1=[locals]-default, 2=[temps], 3=globals
Thanks
w.
|