2014-07-06 21:58:52 +02:00
|
|
|
node-red-node-xmpp
|
|
|
|
==================
|
|
|
|
|
|
|
|
A <a href="http://nodered.org" target="_new">Node-RED</a> node to talk to an XMPP server.
|
|
|
|
|
|
|
|
Install
|
|
|
|
-------
|
|
|
|
|
2016-03-02 14:26:53 +01:00
|
|
|
Run the following command in your Node-RED user directory - typically `~/.node-red`
|
2014-07-06 21:58:52 +02:00
|
|
|
|
|
|
|
npm install node-red-node-xmpp
|
|
|
|
|
|
|
|
|
|
|
|
Usage
|
|
|
|
-----
|
|
|
|
|
|
|
|
Provides two nodes - one to send messages, and one to receive.
|
|
|
|
|
2016-03-02 14:26:53 +01:00
|
|
|
### Receive
|
2014-07-06 21:58:52 +02:00
|
|
|
|
|
|
|
Connects to an XMPP server to receive messages.</p>
|
|
|
|
|
2016-03-02 14:26:53 +01:00
|
|
|
The **Buddy** field is the id of the buddy or room you want to receive messages from.
|
2014-07-06 21:58:52 +02:00
|
|
|
|
2016-03-02 14:26:53 +01:00
|
|
|
Incoming messages will appear as `msg.payload` on the first output, while `msg.topic` will contain who it is from.
|
2014-07-06 21:58:52 +02:00
|
|
|
|
2016-03-02 14:26:53 +01:00
|
|
|
The second output will show the presence and status of a user in `msg.payload`.
|
|
|
|
Again `msg.topic` will hold the user.
|
2014-07-06 21:58:52 +02:00
|
|
|
|
2016-03-02 14:26:53 +01:00
|
|
|
### Send
|
2014-07-06 21:58:52 +02:00
|
|
|
|
|
|
|
Connects to an XMPP server to send messages.
|
|
|
|
|
2016-03-02 14:26:53 +01:00
|
|
|
The **To** field is optional. If not set the `msg.topic` property of the message is used to set that value.
|
2014-07-06 21:58:52 +02:00
|
|
|
|
2016-03-02 14:26:53 +01:00
|
|
|
If you are joining a chat room then the **To** field must be filled in with the room name.
|
2014-07-06 21:58:52 +02:00
|
|
|
|
2016-03-02 14:26:53 +01:00
|
|
|
You may also send a msg with `msg.presence` to set your presence to one of
|
2014-07-06 21:58:52 +02:00
|
|
|
|
|
|
|
1. chat
|
|
|
|
2. away
|
|
|
|
3. dnd
|
|
|
|
4. xa
|
|
|
|
|
2016-03-02 14:26:53 +01:00
|
|
|
If you do this then the `msg.payload` is used to set your status message.
|