Problem with setpoint and rule

Hello.
I’m ussing ESP with IR and Tasmota to control my old radio by sending IR codes.
It works OK (I can power it on/off from MainUI) but I can send only VOL+ from mainUI (I add slider with list widget oh-setpoint)
It doesn’t metter that i pres _ or + it always send VOL+ :frowning:
(I don’t need to remember last volume it isn’t important because usually I’m using remote control)

rule "Wieza VOL"
when 
    Item Wieza_vol changed
    then 
        var Number V = Wieza_vol.state as DecimalType
        var Number Vold 
        if (V > Vold)
            {
            IRESPIRWiezaSamsungDorotka_WiezaSamsungIRCMD.sendCommand(transform("MAP","ir_wieza.map","VOLUP"))
            logInfo("RULE","<-- Wieża VOLUP")
            Vold = V
           } 
        if (Vold > V)
        {
            IRESPIRWiezaSamsungDorotka_WiezaSamsungIRCMD.sendCommand(transform("MAP","ir_wieza.map","VOLDOWN"))
            Vold = V
            logInfo("RULE","<-- Wieża VOL DOWN")
    }
end


What commands does that send to your Item?
Look in your events.log to see.

Consider having your rule respond to commands, not Item state.

The variable Vold is set to null every time the rule runs. There’s not much point in comparing that to anything.

Thanks!
As ussualy I’ve made a mistake …

rule "Wieza VOL"
when 
    Item Wieza_vol received update
    then 
        var Number V = Wieza_vol.state as DecimalType
        if (V > 50)
            {
            IRESPIRWiezaSamsungDorotka_WiezaSamsungIRCMD.sendCommand(transform("MAP","ir_wieza.map","VOLUP"))
            logInfo("RULE","<-- Wieża VOLUP")
            postUpdate(Wieza_vol, 50)
        } 
        
        if (V < 50)
            {
            IRESPIRWiezaSamsungDorotka_WiezaSamsungIRCMD.sendCommand(transform("MAP","ir_wieza.map","VOLDOWN"))
            logInfo("RULE","<-- Wieża VOL DOWN")
            postUpdate(Wieza_vol, 50)
        }

end

Maybe it is stupid but it works good so it isn’t stupid :slight_smile:

You look to be in danger of an endless loop there.

Could you help me with that? Ihave no idea what i should to do.