Widget template - Button increase / decrease value

Hello,

I am struggling to create two very simplistic buttons that are going to increase or decrease the value of my hearting thermostat.

The reason that I believe is causing the issue is the item “zwave_device_98a9193a_node8_thermostat_setpoint_heating” that is not a number only it is a number and degree Celsius after. - so 22 *C will be the output.

If I use this code:
ng-click=“sendCmd(‘zwave_device_98a9193a_node8_thermostat_setpoint_heating’, ‘24’)”

It will work perfectly and the value will be set at 24.

But if i try this one:

ng-click=“sendCmd(‘zwave_device_98a9193a_node8_thermostat_setpoint_heating’, ‘itemValue(‘zwave_device_98a9193a_node8_thermostat_setpoint_heating’) * 1 + 0.5’)”

it will not work because i bealive that the code will send this to the controller: (let’s assume that the actual value is 22)

22*C + 0.5 … and therefore it cannot sum up to 22.5 …

How can i fix this ??

Basicly i need to read the value - just the integer not the entire format …
Many thanks

no one ? :slight_smile:

Why not just send INCREASE or DECREASE as a command?

can you please help me with the syntax ? thank you

ng-click=“sendCmd(‘zwave_device_98a9193a_node8_thermostat_setpoint_heating’, ‘INCREASE’)”
?

Your syntax looks ok to me, do you have any issues ?

I tried it but it does nothing …

<button type=“label” class=“btn” style="background: transparent; color: DarkOrange " ng-click=“sendCmd(‘zwave_device_98a9193a_node8_thermostat_setpoint_heating’, ‘INCREASE’)”>
UP

anyone else ?

It might be that the device does not accept INCREASE/DECREASE command.

In your fist post, you are calculating the new value within the sendCmd() function, this will not work.
Try getting the actual value and do recalculation before sendCmd() and submit the correct value,