Results 1 to 8 of 8

Thread: API Questions

  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
    42

    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
    42

    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.

  7. #7
    Automated Home Jr Member
    Join Date
    Jan 2006
    Location
    Trowbridge, England
    Posts
    42

    Post IdraAPI

    I'm writing an application to use the API to do various things. If you want to have a look - look here - http://www.zen96094.zen.co.uk/Anate/index.html.

    It's work in progress, I'm just doing the Twitter bit atm.

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

    Default

    Interesting......especially your Sonos plugin.....

    I've just created a Squeezebox one that will allow your music to follow you round the house on a similar principle.

Posting Permissions

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