var int VOL
rule "test"
when
Item MQTT_command received update
then
VOL = (MQTT_command.state as DecimalType).intValue
sendCommand(dimmer_item, VOL)
end
PS: Please use the preformatted tex or blockquotes to paste code, makes it simpler to read.
var int debugInt
rule "dimmer test"
when
Item debugDimmer_1 received update
then
debugInt = (debugDimmer_1.state as DecimalType).intValue
logInfo("debug Dimmer", debugInt.toString)
sendCommand(debugDimmer_2, debugInt)
end
Maybe add some logging to see where it fails.
EDIT:
even this works:
rule "dimmer test"
when
Item debugDimmer_1 received update
then
debugInt = debugDimmer_1.state
// logInfo("debug Dimemr", debugInt.toString)
sendCommand(debugDimmer_2, debugInt)
end
please add this to your rule: logInfo("testrule", MQTT_command.state.toString)
I also tried that but notting.
In my testmails i can see that the value of VOL is changing, but the line with the “sendCommand” is not executed.
only when i send a number to the item it works, when i try to send the variable the line is not executing
edit:
when I change the “MQTT_command” item from a string to a number item it works (but it has to be a string) so i think i have to convert the contens of the VOL variable?