I am totally new to openhab, i have been able to install my zwave network and make it work, my netatmo station. Now i would like to understand how to make http request to get json values then parse it and display result in dummy, and i would like to do it every 5minutes.
I have seen example but i don’t understant where i have to put that code ! nobody explain where is the “code editor”…
Thanks … I have already installer visual studio code connected to openhabian. But if someone could show me a small tuto with some details i would really appreciate.
I believe @5iver have pointer you to the tutorial as you requested
For the http look for the http binding
For json look for the JSONPATH transformation service
Both are documented in the add-ons section of the docs
We are not here to write code for you. The question you ask has been answered many a times before.
All you need is in the docs and in the answers in the forum.
Come up with your own code and if doesn’t work, we’ll help you make it work and tell you where you are wrong and why (most of the time)
This would go in a .rules file in the rules directory, but you’re missing the actual rule-when-then-end body to catch when the item changes.
var String data = Sensor_Data.state.toString
var String d0 = transform("JSONPATH", "$.sensors[0].data0", data)
var String d1 = transform("JSONPATH", "$.sensors[0].data1", data)
Try
rule "Name for your rule"
when
Item Sensor_Data changed
then
var String data = Sensor_Data.state.toString
var String d0 = transform("JSONPATH", "$.sensors[0].data0", data)
var String d1 = transform("JSONPATH", "$.sensors[0].data1", data)
// Do other stuff
end