@Anduril You have to create UidTag for required variables, For example. If you want to show outside temperature, humidity and precipitation. Create UidTag for all these variables as follows,
outside-temperature >> for outside temperature
humidity >> for Humidity
precipitation >> to show precipitation
Note: Creat UidTag for the above value.
Script:
var myImports = new JavaImporter(java.io, java.lang, java.util, java.text);
with(myImports) {
var temperature= mcApi.uidTag().getByUid("outside-temperature").getResource();
var humidity= mcApi.uidTag().getByUid("humidity").getResource();
var precipitation= mcApi.uidTag().getByUid("precipitation").getResource();
}
Now create an HTML template to show these values,
<div>Outside temperature: ${temperature.value}°C</div>
<div>Humidity: ${humidity.value}%</div>
<div>${precipitation.value}mm precipitation during the last 24h</div>
Use this script and template on dashboard custom widget.