you can then access the item without units by using {{plain_WU_ForecastToday_MaximumTemperatur}} in your widget
If anyone know a better way to do this, please don’t be shy and tell us. Took me some serious time to find this, but i’m also a beginner to HABPanel widget creation
the downside to use ng-init is that the values will only be updated when the page is reloaded
if you want to see the dynamic changes of the values without reloading the page, you need to add a dummy item and rule with js
example js:
(function(i) {
i = i.replace(' ℃', '');
i = i.replace(' °C', '');
i = i.replace(' %', '');
i = i.replace(' kPa', '');
return parseFloat(i);
}
)(input)
the rule would look like:
rule "habpanel max temperature without unit"
when
Item WU_ForecastToday_MaximumTemperature received update
then
var habpanel_WU_ForecastToday_MaximumTemperature = transform("JS", "replace.js", WU_ForecastToday_MaximumTemperature.state.toString)
vdWU_ForecastToday_MaximumTemperature.postUpdate(habpanel_WU_ForecastToday_MaximumTemperature)
end
still hoping to find a way to hide the units directly in HABpanel with something like a pipe command