Trying to make a simple change to a premade community DTH named SmartWeather Station Tile 2.0 (thank you @takissd). Whoever knows Groovy, please help. I am not a programmer and it is driving me batty trying to make this simple change.
To summarize, this DTH currently gives a very loose estimate of lux based on the weather conditions. Sunny = 10000 lux, cloudy = 1000 lux etc. I want to change it so that Lux populates instead as a function of Solar Radiation which is a defined Attribute in the data set.
Specifically I want the formula to be Lux = solarradiation / .015.
Currently Solar Radiation is defined in the following way within the DTH:
In the metadata section:
attribute “solarradiation”, “string”
I am trying to create a lux value in the following way:
def lux = (solarradiation)/0.015
I know the ‘def lux =’ part is right because when i put ‘def lux =1’ i get the value of 1 returned.
I know this is super simple. Help Please!