rule "RollershutterState "
when
Item Tapparella_SalaUpDownStop changed
then
switch(Tapparella_SalaUpDownStop.state ) {
case UP: {
// bla bla
}
case STOP: {
// bla bla
}
case DOWN: {
// bla bla
}
}
end
Thanks for the reply.
I should manage the type string channel and modify the rules.
rule "RollershutterState "
when
Item Tapparella_SalaUpDownStop changed
then
switch(Tapparella_SalaUpDownStop.state ) {
case "UP": {
// bla bla
}
case "STOP": {
// bla bla
}
case "DOWN": {
// bla bla
}
}
end
Quite right?
This question is related to this discussion by Massimo, here
A Rollershutter Item has a state of type Number [0 to 100]
A Rollershutter Item can get commands (UP,DOWN,STOP, a number [0 to 100])
You won’t need any imports to the rules file:
rule "Rollershutter "
when
Item Tapparella_SalaUpDownStop received command // we want to react on a command, not a state!
then
switch(receivedCommand) {
case UP: {
// bla bla
}
case STOP: {
// bla bla
}
case DOWN: {
// bla bla
}
default : {
// in case a number was received as a command
}
}
end
Okay. Like you said, within your binding you cannot update a channel with state STOP. Because it isn’t a valid openHAB state. That is not an error or omission.
You’ll have to do something else, a Number or String perhaps.