[SOLVED] HABPanel Template and Units of Measurement (UoM)

Tags: #<Tag:0x00007efec83c9380> #<Tag:0x00007efec83c92b8> #<Tag:0x00007efec83c91c8>

I have been using this snippet as part of a setpoint widget, but it doesn’t work when the Item is Number:Temperature

<button class="btn" ng-click="sendCmd('MorningTemperature', +itemState('MorningTemperature')+0.1)"><span class="glyphicon glyphicon-plus" style="color: red"></span></button>

Does anyone know the correct syntax?

Anyone?

Perhaps I worded the question badly.

In a template, I know how to get the number part of a Number:Temperature item with

{{’%.1f’ | sprintf:itemState(‘MorningTemperature’).split(’ ')[0]}}

but I now want to take that value, add 0.1 to it, and set the item

My html/angular skills are sadly lacking. Can anyone help, or hint to where to look.

Maybe this?

 ng-click="sendCmd('MorningTemperature', +itemState('MorningTemperature').split(' ')[0]+0.1)"
1 Like

Well, that’s embarrassing. It works perfectly.
I think that is what I tried first of all, but must have mistyped something.
Thanks Yannick.

1 Like