cyrilcc / org.openhab.binding.rflink

RFLink binding for OpenHAB 2.0
23 stars 35 forks source link

Admin tools #44

Open cartemere opened 5 years ago

cartemere commented 5 years ago

As discussed in the issue cyrilcc#39 : https://github.com/cyrilcc/org.openhab.binding.rflink/issues/39 (see here : https://github.com/cyrilcc/org.openhab.binding.rflink/issues/39#issuecomment-457688437 ) The plugin actually lacks of a kind of "raw message", allowing the user to send a specific handmade command straight to the bridge without any link to an existing item (RTS, Energy, Wind, Switch, whatever...)

This would be very interesting to :

cartemere commented 5 years ago

Regarding the "specifications" :

I just added a RawData channel on the bridge, taking a StringType as input.

capture d ecran 2019-02-18 a 22 37 20

NOTE : to see it within PaperUI, you will need to delete the existing bridge instance and recreate it.

This channel enables the user to send any String command to the bridge. Beware : the message must be compliant with the RfLink specifications available here : http://www.rflink.nl/blog2/protref

capture d ecran 2019-02-18 a 22 37 37

It works also from PaperUI without any requirement.

capture d ecran 2019-02-18 a 22 37 58

The logs shows the event has been processed by the plugin, sent to the bridge, and the result was received as expected :

2019-02-18 22:38:05.982 [DEBUG] [.r.handler.RfLinkBridgeHandler:193 ] - sendMessage: Raw data = 10;PING;, Seq number = 0, Device name = null, Device ID = null 2019-02-18 22:38:05.982 [DEBUG] [.r.handler.RfLinkBridgeHandler:79 ] - Transmitting message 'Raw data = 10;PING;, Seq number = 0, Device name = null, Device ID = null' 2019-02-18 22:38:05.988 [DEBUG] [.o.b.r.c.RfLinkSerialConnector:163 ] - Send data (after 0ms, len=9): 31303B50494E473B0A 2019-02-18 22:38:05.989 [DEBUG] [.s.c.t.i.p.ProfileCallbackImpl:101 ] - Delegating update '10;PING;' for item 'rflink_bridge_RfLinkUSB_rawdata' to handler for channel 'rflink:bridge:RfLinkUSB:rawdata' 2019-02-18 22:38:05.989 [DEBUG] [.s.c.i.c.InvocationHandlerSync:55 ] - Already in a safe-call context, executing 'ThingHandler.handleUpdate()' directly on 'org.openhab.binding.rflink.handler.RfLinkBridgeHandler@52d43a43'. 2019-02-18 22:38:06.023 [DEBUG] [.o.b.r.c.RfLinkSerialConnector:222 ] - <<< 20;01;PONG; 2019-02-18 22:38:06.023 [DEBUG] [.r.handler.RfLinkBridgeHandler:221 ] - Message not supported, data: 20;01;PONG; 2019-02-18 22:38:06.024 [INFO ] [ome.event.ThingStatusInfoEvent:53 ] - 'rflink:bridge:RfLinkUSB' updated: ONLINE

it is available in the last build on my fork. I also updated the README.md to reflect these changes.