Scripting and Scheduling with HTTP Binding

Hello everyone, My platform is RPi4 and OH 3.2 (issues with OH 3.3 & Deconz Addon).
Objective is utilization of HTTP Binding to read once a day energy prices for upcoming day, say at 4pm. I succeeded in reading external site that provides the information with price per hour by means of HTTP Binding thing channels. From there I do have several questions on correct approach for any further. Is there any other method to pickup hourly prices out of aggregated JSON response?
How a thing of HTTP Binding type can be instructed regarding schedule i.e., once a day but after 3 pm the respective day? How can channels of HTTP Binding thing be utilized at scripting to instruct power consumption accordingly?
regards
Adis

Other than what? You’ve not told us what your approach is so we have nothing to compare it to. Assuming the response is indeed JSON it will depend on the nature of that JSON. If it’s relatively fixed in size and structure you can create a separate JSONPATH transform on a separate Channel for each piece of data you want from the JSON. If not, you’ll need to write a rule to parse out and extract the data you want.

Almost all of the time answers to these sorts of questions are in the add-on docs.

In this case, no. You can set an interval but you cannot schedule it at a specific time in the Thing. It doesn’t appear to support the use case where you send ON to a Switch Item (for example) to trigger the HTTP call so to meet this you’ll probably need to use the sendHttpGetRequest Action from a rule instead of the HTTP binding.

Channels are linked to Items. Items are used in rules and in the UI(s).

thank you so much

For this you need to have a rule: either run the http request directly in the rule or disable / enable your http thing by rule, so that it will only run during a specific time

1 Like