can anyone point me to an example of how to create a sitemap item with an ‘up/down’ button that triggers one of two MQTT commands (one for up, another for down). It does not need to store a value. It just needs to trigger one or the other command,
I thought setpoint would work, but it always increments/decrements a value, according to events.log.
Unfortunately the only way to do it in Basic or Classic UIs is to use the setpoint on a proxy Number Item and a rule that triggers on updates to that item aand sends the Up and Down as desired.
It won’t look like a toggle but you can also put your MQTT item on the sitemap as a Switch with a MAPPINGS with an Up and Down which will give you two buttons.
var Number M = Meter_adjust_total.state as DecimalType
var Number MA = MeterM_adjust.state as DecimalType
var Number NM = M + MA/10.0
var Number MM = MeterM.state as DecimalType
var Number HH = MeterHW.state as DecimalType
if(MA==0){NM=0}
if (MA==99999){NM=MM}
if (MA==99998){NM=HH}
Meter_adjust_total.sendCommand(NM)
end
rule “Set value to send sub (-)”
when
Item Meter_minus changed
then
var Number M = Meter_adjust_total.state as DecimalType
var Number MA = MeterM_adjust.state as DecimalType
var Number NM = M - MA/10.0
var Number MM = MeterM.state as DecimalType
if(MA==0){NM=0}
if (MA==99999){NM=MM}
Meter_adjust_total.sendCommand(NM)
end