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.
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.
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.
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.
Comment