Weather API in Cortex

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Alexc
    Automated Home Sr Member
    • Apr 2013
    • 82

    Weather API in Cortex

    Does anyone have a procedure for adding weather information to display within a Cortex message board?

    I have registered with the Met Office datapoint and have an API key. Using the API client object, I have entered the URL, as an example - http://datapoint.metoffice.gov.uk/public/data/val/wxfcs/all/json/3840?res=3hourly&key=<api key> (3840 as I haven't worked out my area yet!)

    The API client shows that data is being received, but now I don't know what to do! Ideally, I'd like the local weather forecast shown as text, eg

    Today:
    Persistent and heavy rain will linger across the north of the country throughout the day, feeling cold with some snow over higher ground. To the south it will be drier and very mild but cloudy and breezy.

    Thanks.
  • Karam
    Automated Home Legend
    • Mar 2005
    • 863

    #2
    Yes you can achieve that. You need to create a decode structure for the weather data, i.e so that Cortex knows which particular item/s you want to then do something with. See an example of this in the attached image. Once you get the decode structure working you will find a connection box for it in the Client's connection list and in this you connect to the relevant notice board's New Message In connection. You'd also need to do something like set up the scheduler to trigger the 'Send' connection for that item in the Client object. For that kind of weather report probably once every hour is sufficient though I know it only typically gets updated twice a day at the met office end.
    Attached Files
    Last edited by Karam; 28 December 2015, 12:06 AM.

    Comment

    • Alexc
      Automated Home Sr Member
      • Apr 2013
      • 82

      #3
      Thanks Karam. Fantastic! (apart from the weather)!



      image-430870062.jpg

      Comment

      • Karam
        Automated Home Legend
        • Mar 2005
        • 863

        #4
        That's great to see. Also, as I was mentioning to someone else, this need not be limited to display within the home.

        Comment

        Working...
        X