rule "Item EG_WO_Rolladen_Links"
when Item EG_WO_Rolladen_Links_Proxy received command
then if (receivedCommand == UP) {
EG_WO_Rolladen_Links_Set.sendCommand(99)
}
if (receivedCommand == STOP) {
EG_WO_Rolladen_Links_Stop.sendCommand(ON)
}
if (receivedCommand == DOWN) {
EG_WO_Rolladen_Links_Set.sendCommand(0)
}
end
//rule "Item EG_WO_Rolladen_Links"
when Item EG_WO_Rolladen_Links_Level changed
then EG_WO_Rolladen_Links_Proxy.postUpdate(EG_WO_Rolladen_Links_Level.state)
end
You mean you want to test if receivedCommand is numeric?
I think if (receivedCommand instanceof DecimalType)
would do. Although if you’ve picked out the other possible commands already, you only need an ‘else’.
How do I read the actual value in the rollershutter type?
EG_WO_Rolladen_Links_Proxy.???
when Item EG_WO_Rolladen_Links_Proxy received command
then if (receivedCommand == UP) {
EG_WO_Rolladen_Links_Set.sendCommand(99)
}
if (receivedCommand == STOP) {
EG_WO_Rolladen_Links_Stop.sendCommand(ON)
}
if (receivedCommand == DOWN) {
EG_WO_Rolladen_Links_Set.sendCommand(0)
}
if (receivedCommand instanceof DecimalType) {
EG_WO_Rolladen_Links_Set.sendCommand(EG_WO_Rolladen_Links_Proxy.???)
rule "Item EG_WO_Rolladen_Links"
when Item EG_WO_Rolladen_Links_Proxy received command
then
if (receivedCommand == UP || receivedCommand == STOP || receivedCommand == DOWN) {
if (receivedCommand == UP) {
EG_WO_Rolladen_Links_Set.sendCommand(99)
}
if (receivedCommand == STOP) {
EG_WO_Rolladen_Links_Stop.sendCommand(ON)
}
if (receivedCommand == DOWN) {
EG_WO_Rolladen_Links_Set.sendCommand(0)
}
}
else { //bei allen anderen Werten Wert direkt in Actuator schreiben
EG_WO_Rolladen_Links_Set.sendCommand(35) //?How do I write here the value of my proxy??
//EG_WO_Rolladen_Links_Set.sendCommand(EG_WO_Rolladen_Links_Proxy.value)
}
end
es I just want to write the new setpoint /received from the sitemap-button) to the real rollershutter.
Objective check ; here you don’t care about the state of your proxy at all. Not interested.
You want the numeric value of the command that was just sent by your UI. It’s right there in a variable, ready to go, even tested to be numeric already. It’s called receivedCommand.
when Item EG_WO_Rolladen_Links_Proxy received command
then
if (receivedCommand == UP || receivedCommand == STOP || receivedCommand == DOWN) {
if (receivedCommand == UP) {
EG_WO_Rolladen_Links_Set.sendCommand(99)
}
if (receivedCommand == STOP) {
EG_WO_Rolladen_Links_Stop.sendCommand(ON)
}
if (receivedCommand == DOWN) {
EG_WO_Rolladen_Links_Set.sendCommand(0)
}
}
else { //bei allen anderen Werten Wert direkt in Actuator schreiben
EG_WO_Rolladen_Links_Set.sendCommand(receivedCommand)
}
end
@knaxman just some extra info for statements in future rules, if needed:
The if statement specifies a block of code to be executed if a condition is true:
if ( condition ) { // block of code to be executed if the condition is true }
The else statement specifies a block of code to be executed if the condition is false:
if ( condition ) { // block of code to be executed if the condition is true } else { // block of code to be executed if the condition is false }
The else if statement specifies a new condition if the first condition is false:
if ( condition1 ) { // block of code to be executed if condition1 is true } else if ( condition2 ) { // block of code to be executed if the condition1 is false and condition2 is true
} else { // block of code to be executed if the condition1 is false and condition2 is false }