Results 1 to 2 of 2

Thread: Using Openweather api to get weather info into the Loxone mini Miniserver

  1. #1
    Moderator toscal's Avatar
    Join Date
    Oct 2005
    Location
    Near Alicante Spain
    Posts
    2,020

    Default Using Openweather api to get weather info into the Loxone mini Miniserver

    As we are in lockdown I have been doing some playing with my miniserver.
    My apartment has a Miniserver Go.
    I have been experimenting with getting weather information into the system. I know Loxone have their own weather service and there is a Loxberry plugin. But I wanted a solution that didn't require extra bits of kit or a paid subscription.
    So I decided to use openweathermap.org and sign up for a free account.
    Once you have signed up you are given an API key which you need when creating API's you can have more than one key if you want.

    So you enter this into your web browser
    http://api.openweathermap.org/data/2...ndon,uk&APPID=YOUR_API_KEY&units=metric

    This gives you something like this
    {"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"base":"stations","main":{"temp":18.68,"feels_lik e":16.05,"temp_min":17.22,"temp_max":20,"pressure" :1006,"humidity":45},"visibility":10000,"wind":{"s peed":2.6,"deg":210},"clouds":{"all":80},"dt":1588 001847,"sys":{"type":1,"id":1414,"country":"GB","s unrise":1587962349,"sunset":1588015007},"timezone" :3600,"id":2643743,"name":"London","cod":200}

    The annoying thing is that the time is in Linux UTC format, if you add &mode=xml to the end of the API you get normal time and date for sunrise etc, but I can't get it to work in Loxone at the moment.

    To get for example today's temperature
    1. You set up a virtual HTTP input in Loxone config. In the URL field put http://api.openweathermap.org/data/2...ndon,uk&APPID=YOUR_API_KEY&units=metric
    2. Then for each bit of weather info you then need to define a virtual HTTP input command
    3. In the command recognition field just enter "temp":\v
    4. Then for the units field you enter <v.1>C

    For wind direction its a little more complex
    1. Under the same virtual HTTP input then follow step 2 above
    2. In the command recognition field enter "wind"\s21\v . This finds the characters "wind" then jumps 21 characters forward to get wind direction. I tried using the command "deg"\v but it didn't work.
    4. In the units enter <v>

    And now the tricky bit
    To get Wind direction as Southerly etc you need to use a Status block and have the Wind direction as an input.
    Then set up a few rules to get the compass directions.
    AI1 >= 0 AI1 < 35 then in Status Text just enter Northerly
    And so on
    Here is what I have so far
    loxone weather.jpg

    The Temperature Warning uses another Status block and will show a graphical warning if it gets too cold or too hot.
    Last edited by toscal; 27th April 2020 at 07:18 PM.
    IF YOU CAN'T FIX IT WITH A HAMMER, YOU'VE GOT AN ELECTRICAL PROBLEM.
    www.casatech.eu Renovation Spain Blog

  2. #2
    Moderator toscal's Avatar
    Join Date
    Oct 2005
    Location
    Near Alicante Spain
    Posts
    2,020

    Default

    Just a quick update. I have now added UV Index, max, min temps and a forecast page. Basically I have a room called weather for current weather and another room called Forecast for tomorrow's weather.Weather V2.1.jpgforecast V1.2.jpg
    IF YOU CAN'T FIX IT WITH A HAMMER, YOU'VE GOT AN ELECTRICAL PROBLEM.
    www.casatech.eu Renovation Spain Blog

Posting Permissions

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