How are you getting this data into OH? executeCommandLine? Exec binding? REST API?
That can change the answer.
Unfortunately the data is in a really weird format. Is that an exact copy and paste from the output or did you type it in. According to the readme on the script’s site it should look like:
[<AlfenProperty(name=OD_manufacturerDeviceName, value=NG910, id=1008_0, cat=generic)>,
<AlfenProperty(name=OD_manufacturerHardwareVersion, value=G0, id=1009_0, cat=generic)>,
<AlfenProperty(name=OD_manufacturerSoftwareVersion, value=4.8.0-3168, id=100A_0, cat=generic)>,
which is much more reasonable and regular. Even then it doesn’t conform to any standard text encoding I’m familiar with so you’ll have to use string manipulation to extract the values. Regualr expressions are usually used for something like this but you should be able to use String split calls in a Rules DSL rule to extract the data.
val rawString = ??? // how ever you get the string into OH
val entries = rawString.split(">,") // should separate each entry
val parts = entry.split(", ")
val name = parts.get(0).split("=").get(1)
val value = parts.get(1).split("=").get(1)
val id = parts.get(2).split("=").get(1)
val cat = parts.get(3).split("=").get(1)
postUpdate(name, value) // posts the value to an Item matching the name in the entry
I just typed in the above. It likely has typos.