I did something similar with the json data from the Australian weather data:
You could do the same and make your own.
I didn’t make a binding I just used an item and made a widget that got the information from the json file.
I use it every day.
Here is the widget code:
uid: BOM-widget-with-temps
tags: []
props:
parameters: []
parameterGroups: []
timestamp: Mar 26, 2021, 11:17:01 AM
component: oh-list
config:
style:
min-width: 250px
--f7-list-item-after-font-size: 12px
--f7-list-item-after-font-weight: bold
--f7-list-item-after-text-color: var(--f7-text-color)
slots:
default:
- component: oh-repeater
config:
sourceType: range
rangeStart: 0
rangeStop: 6
for: index
fragment: true
slots:
default:
- component: oh-list-item
config:
title: =dayjs(JSON.parse(items.BOMdata.state).data[loop.index_idx].date).format('dddd
MMM D')
footer: =JSON.parse(items.BOMdata.state).data[loop.index_idx].extended_text
after: =(JSON.parse(items.BOMdata.state).data[loop.index_idx].temp_min == null)
? " Min --- " + " Max " +
JSON.parse(items.BOMdata.state).data[loop.index_idx].temp_max
:"Min " +
JSON.parse(items.BOMdata.state).data[loop.index_idx].temp_min +
" Max " +
JSON.parse(items.BOMdata.state).data[loop.index_idx].temp_max
icon: ="oh:"+JSON.parse(items.BOMdata.state).data[loop.index_idx].icon_descriptor
- component: f7-segmented
slots:
default:
- component: oh-button
config:
text: Refresh BOM data
outline: true
actionRule: 1a2e6bfd0c
action: rule
Here is the rule I run every 2 hours I put the Norwegian URL in there and it does get json :
//because icon names with dashes in them are reserved I replace the dash with underscore
function input(i) {
return i.replace(/-/g,'_');
}
var DATA = actions.HTTP.sendHttpGetRequest("https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=60.10&lon=9.58", 2000);
//var DATA = actions.HTTP.sendHttpGetRequest("https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=60.10&lon=9.58", 2000).replace(/icon_descriptor...\w+/g,input);
//items.getItem("BOMdata").postUpdate(DATA);
console.log("data refreshed " + DATA)
I am running OH 4.2.0 an use ECMAScript 262
I am sure you could modify it get what you want.
I see there is a github for the icons as well, so it will be easier for you to get the icons displayed?
Anyway, just a suggestion.