Partly
I know there has to be a match. And there is a match with the RfKey (without 1) when the RF Bridde receive the EEEEEE message.
It also returns the “None” allright.
But I fail to understand, why JSONPATH returns a warning… It seems like it (JSONPATH) continues to the four buttonchannels, and somehow mix up the RfKey with the RfKey1 (or any simular number).
I have 4 keys learned in the Bridge from my Key fob. They´re learned on RfKey1 - Rfkey4.
So JSONPATH should dicover the match fine then…
The JSONPATH warning is gone, when I remove the four Switch (buttons) channels from my thing file.
There is… I made a small typo… But Rfkey1 is still the same. And after correcting the typo, I still got the JSONPATH warning
This is how it looks right now, (though I have disabled the button channels).
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="tele/sonoffbm/RESULT", commandTopic="cmnd/sonoffbm/RFKEY1", transformationPattern="JSONPATH:$.RfKey1" ]
// Type switch : button2 "Button 2" [ stateTopic="tele/sonoffbm/RESULT", commandTopic="cmnd/sonoffbm/RFKEY2", transformationPattern="JSONPATH:$.RfKey2" ]
// Type switch : button3 "Button 3" [ stateTopic="tele/sonoffbm/RESULT", commandTopic="cmnd/sonoffbm/RFKEY3", transformationPattern="JSONPATH:$.RfKey3" ]
// Type switch : button4 "Button 4" [ stateTopic="tele/sonoffbm/RESULT", commandTopic="cmnd/sonoffbm/RFKEY4", transformationPattern="JSONPATH:$.RfKey4" ]
Type number : rssi "WiFi Signal Strength" [ stateTopic="tele/sonoffbm/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
}
It also dont explain howcome JSONPATH gives a warning when the Brigde sends the EEEEEEE message. (RfKey)
Yep. The binding gets a bunch of data (it happens to be JSON). The binding works through every channel for that topic Thing looking for things to do. (EDIT - where the stateTopic matches of course)
In your case, each channel has its own JSONPATH to run. So, every different JSONPATH for every channel is run on the incoming data.
If the JSONPATH looks for “banana” and it is not present in the data packet, it will fail.
Thats what I thought as well… But how come I get the JSON warning when receiving the “RfKey” then? It is there, its defined in the String channel (above the buttons).
Notic the “RfKey” (without any number).
This channel is defined like this:
Type string : recievedrfkey "Received RfKey" [ stateTopic="tele/sonoffbm/RESULT", transformationPattern="JSONPATH:$.RfReceived.RfKey"]
This should not return a JSON warning, but it does… Otherweise I simply dont get it.
But I believe Fibu found the reason… Ofcouse the buttons would need to be stats, otherweise the bindings thinks it´s receiving the same RfKey again. (at least this is my guess).
EDIT - Fibu-freak seems to be right… Changing the buttons channels to stat solved the problem… Sorry I totally missed that stupid cut&paste error…