xAP for Xlobby plugin
First of all, I want to apologize for my English…
A new plugin for Xlobby is now available. XAP-Xlobby connects Xlobby with xAP world.
1) What is xAP?
You can get explanations at this address.
http://www.xapautomation.org/modules.ph ... pid=whatis
2) An example with Xlobby?
Of course, imagine: an application that look at your pop account, detect a new mail. It sends a xAP message to everybody on xAP world. Xlobby wakes on reception and shows an overlay that indicates the name, the object and the sender. It also sends a message to a speech xAP application that tells you a new message are arriving.
Nice, isn’t it?
3) Others examples?
In fact, everything is possible. You only have to find a xAP application that makes what you want and interfaces it with xAP-Xlobby. A large amount of applications already exists:
http://wiki.xapautomation.org/tiki-inde ... a3bab1d815
4) Installation
First, you have to install all your xAP applications.
Be sure you have installed the latest Xlobby version
http://www.xlobby.com/xlobby2.zip then download the plug and decompress it in your Xlobby directory
http://www.france.xlobby.com/forum/ptri ... plugin.zip.
It will create
- 6 files in your Xlobby directory (6 DLL)
- 1 folder in plugins directory named xAP-Xlobby with 2 files: AP-Xlobby.dll and xAP.ini
- 1 folder in xAP-Xlobby directory named Schema with 2 files: ACTIONS.XML and EVENTS.XML.
5) How to make Xlobby interact with other applications?
You don’t have to enter in Xlobby configuration for this plugin. All is done in the 2 files ACTIONS.XML and EVENTS.XML under schema directory.
To sending messages, xAP-Xlobby plugin will attempt to find description in ACTIONS.XML file.
To receiving messages, it will attempt to find description and associate Xlobby order in EVENTS.XML file.
When you modify those two files, you will increase the xAP ability from this plugin.
3) How to send new kinds of messages?
First, you have to find the description for the messages you wanted to add. Some of them are available at
http://wiki.xapautomation.org/tiki-inde ... =XapSchema
Then, you will find an example for speech application.
Class=tts.speaktts.speak{Say=(text to speak) --- mandatoryVolume=(0-100) --- optionalVoice=(TTS Voice to use) --- optionalDevice=(Soundcard to use) --- optionalPriority=(Yes/No To stop current playback and play this text) --- optionalfilename=(If the is present then instead of playing the sound through the sound card it will be recorded into a wav file specified here) --- optional}
Now, go to ACTIONS.XML file. Each order (kind of messages) are describe in an <EVENT> block.
For example:
<event><name>My First Try</name><class>My Class</class><adress>Destination address</adress><Desc>this is an example</Desc><body>name_of_body{element 1=first paramelement 2=second param}</body></event>
Be careful, only bold text can be changed.
· Name, you can put what you want; this text will be the Xlobby name for this order.
· Class must be fill with the same value you will find in the description of the message.
· Adress must be the destination address, constructor.Device.Computer, like KCSoft.MailMonitor.MyComputer or Ptrinchi.Xlobby.* or mi4.HomeSeer.* for example
· Desc, not use yet
· Name_of_block must be fill with the same value you will find in the description of the message, it’s necessary to identify the messages to listen to.
· Element 1 is the first param with its value separated by a = character.
· Element 2 …
For example with speech messages:
<event><name>Speak</name><class>tts.speak</class><adress>mi4.speech.*</adress><Desc>usefull to make Xlobby speaking </Desc><body>tts.speak{Say=Hello everybody Volume=80 }</body></event>
If you save it and launch Xlobby, under command in the event manager, if you select xAP-Plugin, you will see a new command… Speak. You can create an event and add it to a button.
To see outgoing messages, it’s necessary to check “show outgoing messages” in the configuration screen of the plugin
4) Add parameters in outgoing messages
You can add Xlobby parameter in outgoing messages. To do this, just put *Xlobby* at the place you want in the ACTIONS.XML file.
For example:
<event><name>Speak</name><class>tts.speak</class><adress>mi4.speech.*</adress><Desc>usefull to make Xlobby speaking </Desc><body>tts.speak{Say=*Xlobby* Volume=80 }</body></event>
In the actual version, you can’t add more than one parameter.
5) How to describe more messages in only one description
You can describe a lot of messages in only one <event> block.
For example, you have found a xAP application player. 5 messages can be send to it for 5 actions (Play, Stop, Pause, Prev, Next)
The event block in ACTIONS.XML file could be:
<event><name>Player XX</name><class>Class.player</class><adress>XXX.YYY.*</adress><Desc>launch a player</Desc><body>Player.Command{Command=[Play,Stop,Pause,Prev,Next]File=*Xlobby* }</body></event>
6) How to indicate which messages Xlobby have to listen to?
The process is the same we use for outgoing messages but the changes must be in the EVENTS.XML file.
You must find the descriptions of the messages sent by the xAp application you want.
Go to EVENTS.XML file, you will find <message> block for each message to listen:
<message><name>New Mail</name><class>mail.incoming.new</class><address>*.*.*.*</address><body>block=Name_of_blockstate=You have [msg] new mail(s) from [from]text=Subject: [subject]</body><xlobby>goto:goto new mail</xlobby></message>
Be careful, only bold text can be changed.
· Name, you can put what you want; this text will be the Xlobby name for this order.
· Class must be filled it with the same value you will find in the description of the message.
· Adress must be the emitter address, constructor.Device.Computer, like KCSoft.MailMonitor.MyComputer or Ptrinchi.Xlobby.* or mi4.HomeSeer.* for example
· Name_of_block must be filled it with the same value you will find in the description of the message, necessary to identify the messages to listen to.
Then, you can fill the right part of the following two lines with what you want to display in the Xlobby variables named plugin>xap-xlobby>state>xxxxx and plugin>xap-xlobby>text>xxxxx.
XXXXX is the name of the xAP device. You can find it in the original message sent by the application. At the source line, you will read something like XXX.YYY.ZZZ:AAA.BBB or XXX.YYY.ZZZ
In the first case, the devise is AAA.BBB, in the second it’s ZZZ
You can add information from the xAP messages like [subject] or [from] in our example. Each xAP information must be a param line in the original message sent by the application like subject=YYYYY or from=peter@free.com
7) How to indicate to Xlobby the event to execute?
Only fill the <xlobby> tag with an action like Group:eventName. Only events from your skin are available (those under SKIN in the event manager).
Conclusion
I hope you understand everything and enjoy with it.