Web API options for Cortex

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • spellinn
    Automated Home Sr Member
    • Dec 2007
    • 53

    Web API options for Cortex

    I'd like to trigger events from cloud-based integration systems such as itDuzzit.com and ifttt.com but both require something to be listening on a HTTP(s) port. Whilst I can send emails to Cortex it's a bit hit and miss and hardly realtime.

    Is there a proper web API on the Cortex roadmap, or has anyone found a way of bridging the Windows app-messaging API currently provided by Cortex to a true HTTP Web-based API?

    Cheers

    Neil
  • spellinn
    Automated Home Sr Member
    • Dec 2007
    • 53

    #2
    Am I really alone in this requirement? With the Internet of Things, I would of thought this kind of API control of home automation would be high on people's agendas.

    Cheers

    Neil

    Comment

    • Karam
      Automated Home Legend
      • Mar 2005
      • 863

      #3
      What sort of things would you be doing with ifttt or itDuzzit?

      Comment

      • chris_j_hunter
        Automated Home Legend
        • Dec 2007
        • 1713

        #4
        that the Mobile extension to Cortex doesn't do already ?
        Our self-build - going further with HA...

        Comment

        • spellinn
          Automated Home Sr Member
          • Dec 2007
          • 53

          #5
          Some of the ideas floating round my head (some may be feasible, others still not possible)

          - Set up more advanced alerting/recording from my various IP cameras based on occupancy, time of day.
          - Trigger the pre-heating of my car based on occupancy, outside temperature, day of week etc
          - Trigger events at home based on my location (e.g. I arrive at the station and am 10 minutes from home)
          - Send alerts from Cortex via twitter DMs
          - Pull in weather feeds and display predicted highs/lows on my panels
          - Trigger Sonos at certain times of the day when the house is unoccupied for improved occupancy simulation
          - Better integrate my alarm system and Cortex
          - Use a http://bt.tn/ to trigger events within Cortex

          APIs are becoming commonplace, and most are provided by a JSON or REST web interface. It would be nice if Cortex could also be controlled this way (and might even facilitate you producing a proper mobile app..hint hint

          Cheers

          Neil
          Last edited by spellinn; 29 January 2015, 09:45 AM.

          Comment

          • spellinn
            Automated Home Sr Member
            • Dec 2007
            • 53

            #6
            Speaking of a mobile app, your time to market would be much quicker if you create an API and use something like http://www.smartthings.com/ or http://octoblu.com/

            They have very good developer community and documentation:



            The platform seems very extensible, and with the IFTTT integration opens up the possibilities to use any of the thousands of Mobile or Cloud triggers (location, weather, time, stocks..you name it)

            Cheers

            Neil
            Last edited by spellinn; 29 January 2015, 12:50 PM.

            Comment

            • chris_j_hunter
              Automated Home Legend
              • Dec 2007
              • 1713

              #7
              Neil -

              you're clearly more into this than we ...

              we currently use the Mobile extension, occasionally for switching or adjusting things (as when up a ladder & need the lights dimmed up a bit, or needing to activate the House before we arrive home), but more often for checking Histories (as in determining when the delivery man exactly did try to deliver, how long's the heating been on today, has the cold spell turned the corner, yet) ...

              and we find the main issue with it is to do with how we connect to it - by WiFi, when at home - because the address (192.168.etc) is liable to change, from time to time, and because the WiFi hub isn't always on, and the connection doesn't always resume when it comes back on ...

              in other words, would your alternative approach be immune to such issues ?

              BTW, thought your SmartThings link interesting - but how for-real is it ... ?

              eg: automatic lighting, in reality, is rather more than just a relay & a motion sensor - to work well, lots of subtleties & complexities are involved & have to be got right ...

              and the same must be true for location sensing etc, too !

              Chris
              Our self-build - going further with HA...

              Comment

              • spellinn
                Automated Home Sr Member
                • Dec 2007
                • 53

                #8
                Hi Chris

                My main interest isn't to manually control lights and Cortex objects from my mobile phone - as you state, I could use the mobile extension provided by the Cortex web server to do that.

                I'm thinking slightly more longer term, when every device talks to every other device over IP.

                I want the flexibility of using "the current favourite automation platform" based in the cloud to control and integrate my devices (devices being everything in my house, my car, my laptop and mobile). And to do that, they all need to be exposed and controllable by a published API. As you see from my wish list above, it's mostly about automating actions based on data and events that Cortex already knows about - outside temperature, house and room occupancy, camera and alarm events etc.

                The connectivity issues you are seeing can be resolved by using DHCP reservations on your WiFi router so that your Cortex system always gets the same internal IP address. Most modern WiFi routers support this functionality. Public Internet IP address changes can easily be handled using one of the many Dynamic DNS providers. And if your WiFi does not automatically reconnect then it sounds like you need a better one - I don't have that issue.

                At some point (maybe many years from now) the concept of having a Windows application running on a PC 24/7 connected with a serial port will look very old school so I'm obviously keen to future proof my investment for the IoT age which is upon us. I've already experimented with running Cortex in the cloud, remoting the serial port back to a system in my house, but as you still need that jump box it made little sense to leave it that way.

                I need an Idratek module that contains an built-in web server, WiFi+Ethernet connection, and can expose my Cortex objects via and API, send and receive IDRANET commands via IP to any, and even many endpoints - whether that's another PC in my house running Windows+Cortex, or a cloud-based automation platform.

                Cheers


                Neil

                Comment

                • chris_j_hunter
                  Automated Home Legend
                  • Dec 2007
                  • 1713

                  #9
                  Neil -

                  thanks ...

                  not sure about the many years from now, though - ISTM it's all already upon us !

                  we've WiFi & Cat-6 & Cat-5e & CT100 cables all over the house, have IP devices here & there, the HiFi & even the cars have interfaces that are ready to connect, in many ways ...

                  BTW - the other module, we're missing, is a display module, with a display that's short (low character count) but readable from across the room, for showing time and/or temperature or whatever, and short identifiers (eg: when doorbell sounds, can show Gate or Door, or when Alarm sounds, can show Fire, Flood, whatever) ...

                  Chris
                  Our self-build - going further with HA...

                  Comment

                  • spellinn
                    Automated Home Sr Member
                    • Dec 2007
                    • 53

                    #10
                    Yes you're right - it's here now. Hence why I'm bringing this up wrt Idratek and Cortex.

                    Your display module idea - in my mind this would be catered for by using a modern SmartTV that can display Twitter and RSS feeds etc.

                    An API-capable Cortex could output to a service that could provide RSS which would allow you to subscript to a notification feed from any device - large or small format, internal to your house or out on the road.

                    Cheers

                    Neil

                    Comment

                    • chris_j_hunter
                      Automated Home Legend
                      • Dec 2007
                      • 1713

                      #11
                      display module - except we would want many of them - by every window would suit us well, alongside existing PLH / DRB pairs ...

                      current plan is to use DAB radios (we found a presentable low-cost one with a suitably-sized display) - and we would use them just as clocks (key point is they would deal with GMT / BST changes & power-cuts automatically, so they would be fit & forget) ...

                      another thought was to maybe use some old SqueezeBox units - with which Cortex can already communicate - they being defunct, now, the units might be available quite affordably ...

                      still, as you imagine, IoT is potentially going to make these things much easier to achieve, sometime !
                      Last edited by chris_j_hunter; 29 January 2015, 11:37 PM.
                      Our self-build - going further with HA...

                      Comment

                      • chris_j_hunter
                        Automated Home Legend
                        • Dec 2007
                        • 1713

                        #12
                        PS: Cortex can work with xAP. of course, and Kevin a while back was having a go at getting display options working on an O2 Joggler - not sure how far the project got, though (ISTR some problems with Flash, and the amount of time it was taklng) ...

                        for the moment, we have just one (numerical) display being fed by Cortex - too expensive to use in other locations, too, though, and not sure it could show the time (we use it to context-sensitively show temperature & speed & other such) ...

                        still, as you imply, given what you're thinking of, we could maybe use redundant old iPhones and/or iPod-touches to do all this (currently, we use them for watching recordings & keeping an eye on TV News, using EyeTV, and as calculators, using an HP41 emulator app) ...

                        anyway, wonder if xAP gives / could give a route to what you're looking for ... ?

                        the effort needed to integrate all this together, in the IoT world, will be enormous, but many hands will make light work ...
                        Last edited by chris_j_hunter; 25 May 2016, 04:57 PM.
                        Our self-build - going further with HA...

                        Comment

                        • Aristoteles
                          Automated Home Jr Member
                          • Jan 2013
                          • 32

                          #13
                          I agree with spellinn. An Idratek module with a built in web server would be very usefull and i think it would open up a plethora of possibilities.
                          I tested this: https://github.com/simegeorge/CortexWebApi sometime ago and it seemed to work allright. It might not be exactly what you want, but have a look and let me know what you think.
                          /Glenn

                          Comment

                          • spellinn
                            Automated Home Sr Member
                            • Dec 2007
                            • 53

                            #14
                            Originally posted by Aristoteles View Post
                            I agree with spellinn. An Idratek module with a built in web server would be very usefull and i think it would open up a plethora of possibilities.
                            I tested this: https://github.com/simegeorge/CortexWebApi sometime ago and it seemed to work allright. It might not be exactly what you want, but have a look and let me know what you think.
                            /Glenn
                            Looks like it goes some way..although I've no means to compile it, not having Visual Studio, and there's no pre-compiled exe in the download.

                            Cheers

                            Neil

                            Comment

                            • spellinn
                              Automated Home Sr Member
                              • Dec 2007
                              • 53

                              #15
                              I've now compiled this using the Visual Studio Community edition. Will post my results once I've integrated it with Cortex.

                              Cheers

                              Neil

                              Comment

                              Working...
                              X