I would like to create a Setpoint device to control an IR Terrace Heater. I chose a Setpoint Device so Homebridge (Homekit) and Google Home can recognise it as a heating device thus making control possible as in telling Siri/Google; "It is cold on the Terrace".

The Terrace Heater has a total of 6 heating settings and has the controls set out below. I've already captured the IR-codes in JSON. Tasmota has been installed on a Wemos D1 Mini Pro and i've already tested sending out the codes, so that part is all done. The heater has the following controls (and the accompanying IR-codes):
- On: IrSend {"Protocol":"NEC","Bits":32,"Data":"0x18E7807F","DataLSB":"0x18E701FE","Repeat":0}
- Off: IrSend {"Protocol":"NEC","Bits":32,"Data":"0x18E700FF","DataLSB":"0x18E700FF","Repeat":0}
- Up: IrSend {"Protocol":"NEC","Bits":32,"Data":"0x18E740BF","DataLSB":"0x18E702FD","Repeat":0}
- Down: IrSend {"Protocol":"NEC","Bits":32,"Data":"0x18E7C03F","DataLSB":"0x18E703FC","Repeat":0}
- Max: IrSend {"Protocol":"NEC","Bits":32,"Data":"0x18E730CF","DataLSB":"0x18E70CF3","Repeat":0}
Now for the code part i want to let the Dummy Setpoint behave as follows:
- If setting the Setpoint value higher than the previous setting it was on = Execute IR-code "Up" via MQTT message to Tasmota
- If setting the Setpoint value lower than the previous setting it was on = Execute IR-code "Down" via MQTT message to Tasmota
- If turning the Setpoint off (i believe Google Home and Homekit can both do this) = Execute IR-code "Off" via MQTT message to Tasmota
- If turning the Setpoint on (i believe Google Home and Homekit can both do this) = Execute IR-code "On" via MQTT message to Tasmota
"Max" will barely, if ever be used so i have no particular need for that code to function with the Setpoint device. I also don't know how to make that setting work with the Setpoint device because i believe the above settings will use up all the functions of the Setpoint Device.
I tried to find out how i can compare a new value with the "current" value with DZvents, but i've only found explanations regarding time.
Could someone help me with a DZvents script to get the above working? Thanks!!