Results 1 to 8 of 8

Thread: API Questions

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Automated Home Guru Geps's Avatar
    Join Date
    Nov 2010
    Posts
    136

    Default 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,

  2. #2
    Automated Home Jr Member
    Join Date
    Jan 2006
    Location
    Trowbridge, England
    Posts
    40

    Default

    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.

  3. #3
    Automated Home Guru Geps's Avatar
    Join Date
    Nov 2010
    Posts
    136

    Default

    Ah ha - looks like I was running an older version without those bits.

    All working now.

    Thanks.

  4. #4
    Automated Home Guru Geps's Avatar
    Join Date
    Nov 2010
    Posts
    136

    Default

    Is there anyway to load up with the XML format selected?

    Cheers,

  5. #5
    Automated Home Jr Member
    Join Date
    Jan 2006
    Location
    Trowbridge, England
    Posts
    40

    Default

    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.

  6. #6
    Automated Home Guru Geps's Avatar
    Join Date
    Nov 2010
    Posts
    136

    Default

    Excellent, thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •