2023-07-21 22:24:54.597 [WARN ] [penhab.core.library.items.NumberItem] - Failed to update item 'Total_Radiation_COR' because '0' could not be converted to the item unit 'W/m²'
and multiplies it by the cloudiness factor (that has no unit) :
Number Synop_Attenuation "Coefficient Atténuation" <sun_clouds> (gSynopanalyzer1) ["Measurement"] {channel="synopanalyzer:synopanalyzer:1:attenuation-factor"}
During the day, it works fine but at night Total_Radiation = 0 W/m² and the warning is emitted.
Taking a look at AbstractMathTransformationService, I found the origin of the problem :
At night I observe this warning :
2023-07-21 22:24:54.597 [WARN ] [penhab.core.library.items.NumberItem] - Failed to update item 'Total_Radiation_COR' because '0' could not be converted to the item unit 'W/m²'
The item definition is :
It takes current solar radiation :
and multiplies it by the cloudiness factor (that has no unit) :
During the day, it works fine but at night Total_Radiation = 0 W/m² and the warning is emitted. Taking a look at
AbstractMathTransformationService
, I found the origin of the problem :So, if the result is 0, the code drops the unit, leading to the warning.
I think this could be changed to :
return performCalculation(source, value).toString();
@J-N-K : what do you think ?