I have the same issue yesterday, when I tried to add my 4 button Sonoff remote and use it in a rule…
The problem is, Openhab receives the command 41E00A. But it is neither an ON/OFF or OPEN/CLOSE command which is why you see the complaint.
In order to get it to work, I had to map each button to the RF bridge. Ie button A mapped to Key 1, button to Key 2 etc…
I then use the RF_Received_Key for triggering my rule to postupdate to a proxy item. But you should be able to let it do anything else.
My setup:
.things file
Thing topic sonoffbm "RF Bridge" @ "second Room" {
Channels:
Type string : reachable "Reachable" [ stateTopic="tele/sonoffbm/LWT" ]
Type string : recieveddata "Received Data" [ stateTopic="tele/sonoffbm/RESULT", transformationPattern="JSONPATH:$.RfReceived.Data"]
Type string : recievedsync "Received Sync" [ stateTopic="tele/sonoffbm/RESULT", transformationPattern="JSONPATH:$.RfReceived.Sync"]
Type string : recievedlow "Received Low" [ stateTopic="tele/sonoffbm/RESULT", transformationPattern="JSONPATH:$.RfReceived.Low"]
Type string : recievedhigh "Received High" [ stateTopic="tele/sonoffbm/RESULT", transformationPattern="JSONPATH:$.RfReceived.High"]
Type string : recievedrfkey "Received RfKey" [ stateTopic="tele/sonoffbm/RESULT", transformationPattern="JSONPATH:$.RfReceived.RfKey"]
Type switch : button1 "Button 1" [ stateTopic="stat/sonoffbm/RESULT", commandTopic="cmnd/sonoffbm/RFKEY1", transformationPattern="JSONPATH:$.RfKey1" ]
Type switch : button2 "Button 2" [ stateTopic="stat/sonoffbm/RESULT", commandTopic="cmnd/sonoffbm/RFKEY2", transformationPattern="JSONPATH:$.RfKey2" ]
Type switch : button3 "Button 3" [ stateTopic="stat/sonoffbm/RESULT", commandTopic="cmnd/sonoffbm/RFKEY3", transformationPattern="JSONPATH:$.RfKey3" ]
Type switch : button4 "Button 4" [ stateTopic="stat/sonoffbm/RESULT", commandTopic="cmnd/sonoffbm/RFKEY4", transformationPattern="JSONPATH:$.RfKey4" ]
Type number : rssi "WiFi Signal Strength" [ stateTopic="tele/sonoffbm/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
}
.items file
//-> Sonoff RF
Group GF_Sonoff_RF "RF Bridge" <sonoff_rf> (Sonoff_RF)
String GF_Sonoff_RF_Reachable "Reachable: [%s]" <contactable> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffbm:reachable" }
String GF_Sonoff_RF_Received_Data "Received Data: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffbm:recieveddata" }
String GF_Sonoff_RF_Received_Sync "Received Sync: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffbm:recievedsync" }
String GF_Sonoff_RF_Received_Low "Received Low: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffbm:recievedlow" }
String GF_Sonoff_RF_Received_High "Received High: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffbm:recievedhigh" }
String GF_Sonoff_RF_Received_RfKey "Received RfKey: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffbm:recievedrfkey" }
Switch GF_Sonoff_RF_Button_1 "Button 1: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffbm:button1", autoupdate="false"}
Switch GF_Sonoff_RF_Button_2 "Button 2: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffbm:button2", autoupdate="false"}
Switch GF_Sonoff_RF_Button_3 "Button 3: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffbm:button3", autoupdate="false"}
Switch GF_Sonoff_RF_Button_4 "Button 4: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffbm:button4", autoupdate="false"}
Number GF_Sonoff_RF_RSSI "WiFi Signal Strength [%d %%]" <wifi> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffbm:rssi" }
And the rule:
rule "Sonoff Remote"
when
Item GF_Sonoff_RF_Received_RfKey changed
then
if(GF_Sonoff_RF_Received_RfKey.state.toString == "1") {
logInfo("info", "Sonoff Remote Button A")
Sonoff_RF_RemoteA.postUpdate(ON)
}
else
if(GF_Sonoff_RF_Received_RfKey.state.toString == "2") {
logInfo("info", "Sonoff Remote Button B")
Sonoff_RF_RemoteB.postUpdate(ON)
}
else
if(GF_Sonoff_RF_Received_RfKey.state.toString == "3") {
logInfo("info", "Sonoff Remote Button C")
Sonoff_RF_RemoteC.postUpdate(ON)
}
else
if(GF_Sonoff_RF_Received_RfKey.state.toString == "4") {
logInfo("info", "Sonoff Remote Button D")
Sonoff_RF_RemoteD.postUpdate(ON)
}
end
At least I hope it gets you futher.