-
18th February 2012, 08:52 PM
#1
Automated Home Guru
API Questions
Hi,
I'm playing around with the API at the moment.
Could someone just clarify where the API Messaging window, within Cortex is please?
The Help File says: Visit the Main menu | Tools | Cortex API.
But I can't see it under tools.....?
Also, how do you change between the two versions? I'm using the plain text version at the moment and wanted to try the XML formatted one.
Cheers,
-
18th February 2012, 10:06 PM
#2
Automated Home Jr Member
It's the bottommost entry on the Tools menu.
Just clicking on it opens the API messaging window. The two API versions are active at the same time. How you structure the query determines whether you get a version 1 reply or a version 2 one.
-
19th February 2012, 12:38 AM
#3
Automated Home Guru
Ah ha - looks like I was running an older version without those bits.
All working now.
Thanks.
-
19th February 2012, 11:21 PM
#4
Automated Home Guru
Is there anyway to load up with the XML format selected?
Cheers,
-
20th February 2012, 03:01 PM
#5
Automated Home Jr Member
Not sure what you mean. If you mean can the standard messages from modules be received as XML messages the answer is no, I believe. Certain ports on modules transmit a message whenever their status changes, so a constant stream of API version 1 messages are output, e.g.
Ground Floor Humidity.Dewpoint Output=0.556517544907261
or
Desk Lighting Switch.Output logic state=100.
These same values could be obtained via XML (the Version 2 API), but only by sending an XML query first, e.g.
<CortexAPI>
<QueryPortValue>
<FriendlyName>Ground Floor Humidity</FriendlyName>
<PortDescription>Dewpoint Output</PortDescription>
</QueryPortValue>
</CortexAPI>
would give the reply:
<CortexAPI>
<PortEvent>
<FriendlyName>Ground Floor Humidity</FriendlyName>
<IDNumber>151</IDNumber>
<PortDescription>Dewpoint Output</PortDescription>
<Type>ValueOut</Type>
<Value>0.556517544907261</Value>
</PortEvent>
</CortexAPI>
but you can't switch Cortex into sending the standard notification messages as XML in the first place AFAIK.
-
20th February 2012, 07:50 PM
#6
Automated Home Guru
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules