From: Lieven H. <li...@li...> - 2013-07-26 19:51:16
|
Hey Eloy, Op 26-jul.-2013, om 21:41 heeft Eloy Paris <pe...@ch...> het volgende geschreven: > [..] > Okay, one last question on this -- is it possible for something (like MisterHouse) to generate an xPL message that will then be processed by xpl-jeenodes (with modifications, of course), which will cause gateway.pde (with modifications too) to send a command to the remote, wireless sensors? I also have the need to write to the sensors, not just to read what they send to the central node, which is why I ask. > The xpl-perl framework for sure allows you to do that. It already provides the necessary hooks and filters to filter out exactly the messages you require and to pass them on to callback functions to process them. The code to filter and link to a callback is present in xpl-jeenodes but it is commented out (lines 82 and next) because I didn't have the need to write to the sensor nodes (yet :-) You will need to decide what type of message you want to send (control.basic, sensor.basic?) and you will need to implement the handling of the incoming xPL messages. For a working example, please refer to https://github.com/hollie/xpl-perl/blob/master/lib/xPL/Dock/Plugwise.pm lines 101 and 111 plus the matching callbacks. For the plugwise devices I have implemented bidirectional communication. Basically you get into the callback with the info you received from xPL, and then you transform that into the string you send into the wireless gateway. The gateway in turn sends it to the wireless nodes. If you need further assistance for this just let me know. Kind regards, Lieven. |