I am struggling with this problem:
I created an http cache url with http binding that returns a string that contains several values separated with line breaks:
What I need is assign the single values to distinct items.
My goal was to read only once (using http cache) from the unit and then populate the items with a transformation. But then I stopped as I haven’t been able to extract the single values from the string.
Can you point me to a way to extract the values from the cached http string into the items?
An option would be to put the value in a String item (with the http binding), without any transformation. Then create a rule that is triggered when this item changes. In this rule you can split up the values over multiple items.
Resuming: @idserda, you are suggesting to send one periodic request to the server and then elaborate in a rule the single items.
While @rlkoshak, you are suggesting to send 16 periodic requests to the server, one for every item.
Which is better?
That isn’t what I’m suggesting at all. You said that you are using the HTTP cache configuration (i.e. added the URL to poll to http.cfg). This will poll the URL once per polling period and cache the results. Then when you use that config in your Items, the Items will poll the cache and apply the transform and populate the Item. You can have 100 Items but the actual web service only gets polled once.
I would go with @rlkoshak’s solution, and use caching as he mentioned. That way you have the complete configuration in one place (your item files), which is more convenient than having to maintain both the items and the rule.