[Message Prev][Message
Next][Thread Prev][Thread Next][Message
Index][Thread Index]
Re: xap/xpl bridging
>
> In my comprehension of the product (Floorplan) , you can only trigger
> a script when a device value is changed or updated. Then I don't see
> where to put my trigger...
>
Yes, a script is triggered by either an update or a change to a device.
So if it's just a single device or jsut a couple then that is the
easiest way to go.
However you can catch all messages of a type and run a script on them.
In Config/Devices/Raw add a new device.
Give it an alias. Set Source to > class to xapbsc.event section to >
and
item to state .
Now that device will update on any incoming xapbsc device.
Now make a script:
sub main()
SourceAddress=xap.GetFromRaw(RawMessage,"message.header,source")
xAPState=xap.GetFromRaw(RawMessage,"output.state.1,state")
xTarget="xpl.hal.1234"
xSection="hello"
xBody="MyStateIs=" & xAPState & chr(10)
xbody=xbody & "xAPSource=" & Sourceaddress & chr(10)
x=xap.sendxpl(xTarget,xSection,xBody)
end sub
Now go back to the device and have this script run on update.
I think that should work, although you'll have to make the xpl message
into something more useful!
> I tried to activate the Xap "XPL Bridge Support" but I don't
know what
> kind of messages he translates and how it works. In XPL Monitor, I
> just see Floorplan hearbeats but no message issued.
>
The bridge is really for bringing xPL devices in to the xAP world. There
are limitations on what can go the other way like no uid, smaller item
names and a single body. I am trying to add to the translators support
for various schemas so that xap can be bridged to xpl but for now think
of the bridge as xPL>xAP
James
xAP_Automation Main Index |
xAP_Automation Thread Index |
xAP_Automation Home |
Archives Home
|