I am wondering if I can display data on OH3 overview page a weather forecast. I have done by using lots of items but I thought the data that is displayed is the same format so can I make it dynamic and cut down the number of items used?
Use something like: =(items.BOM_Day1_ForecastDateAndTime.displayState) but make it dynamic
What I want to do is get the weather data in json format and there is a site in Australia that can do that. I put all the data into one item called BomMV_Data using the http binding.
That works and I can see the data.
I can also parse the data in JavaScript so I know I can do that as well.
What I donāt know and canāt find any information is whether I can use the same sort of logic to display on the overview page.
I have tried lots of different things using the developer side bar widget tester but canāt crack the code I need.
This didnāt work either:
=transform(āJSONPATHā,"$.data[0].extended_text",(items.BomMV_Data.state))
Thanks for that. What I was hoping for was a single liner where I could just pull out data for one item if needed.
Similar to this: =(items.BOM_Day1_ForecastDateAndTime.displayState) but obviously make it variable. Like this: =transform(āJSONPATHā,"$.data[0].extended_text",(items.BomMV_Data.state)) but I canāt seem to be able to simply do that without creating lots of items.
Hi.
I have looked at your example but I canāt get it to do what I want which is loop through the json data in the one item I have and change the index number to the next set of data. The json file is weather data and the json format is data[0].whatever What I would like to be able to do is grab any of the data and list it.
Like this:
data[0].short_text
data[1].short_text
data[2].short_text
In other words be able to substitute an index number in between the [] like [indx]
I am new to this stuff and just need an example.
I thought I was getting to know this works when I finally got the data to display earlier but I really would like to do dynamic variable stuff.
Should I be doing this on the overview page or is this a widget type of exercise?
Any help or clues greatly appreciated.
Thanks