The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
[Published] OpenWeatherMap app v0.0.8
OpenWeatherMap for Homey
This app allows you to poll the OpenWeatherMap API for localised weather data and use this in your Homey home automation flows. Several instances (locations) can run simultaneously.
Current weather
The 'current weather' data comes from the OWM current weather data, refer to http://openweathermap.org/current. It includes visibility, sunrise and sunset data which are not included in the forecast tables. Note that the max. and min. temperatures in the current data indicate the possible range in which the actual temperature is expected, it can be seen as a measure for the standard deviation of the current temperature.
Forecast up to 5 days
The five day forecast data (refer to http://openweathermap.org/forecast5) includes forecasts in 3-hour intervals up to 5 days in the future. During pairing you can choose the 3-hour interval you want to have weather data from. Interval 0 gives you data from the currently running 3-hour interval (between one hour ago/two hours ahead) which should be close to the current weather. Interval 8 gives data 24 hours ahead, etc. In this dataset the maximum and minimum temperatures are the expected maximum and minimum temperature, as you would expect.
Long term weather
The long term weather forecast gives data for up to 15 days in the future, in daily intervals (refer to http://openweathermap.org/forecast16). Included in the data is the daily, morning, evening and night temperature.
The OpenWeatherMap polling is inspired by the 'openweather-apis', refer to https://github.com/CICCIOSGAMINO/openweather-apis.
Please use the forum for questions and comments related to the app: https://forum.athom.com/discussion/4225/.
Screenshots
The mobile interface looks as follows:
The pairing view:
Settings can be changed after pairing.
Flow cards
For nearly all parameters trigger and condition cards are included, see screenshot for most flowcards available for the current weather:
Requirements
To use the app, you need to get a (free) OpenWeatherMap API key at http://openweathermap.org.
Comments
Could you possibly also make some conditions for it? I made a OpenWeatherMapp myself a long time ago (sdk1, and very poorly written). Maybe you can steal some of the conditions as I have flows like this currently.
https://github.com/jasperbollen/org.jb.openweathermap
I was inspired by Athom's 'T-shirt' challenge, if you publish an SDK2 app before the 1st of december, Athom has a T-shirt for you. So this is the initial version, I do intend to add more features. I'll look at your code, thanks! And of course if you want to make PR's, by all means I am no pro, just a hobbyist getting to terms with SDK2 ;-)
i will test it as soon as it is available in the store!
The next version will have a verification of the API key during pairing, support for multiple locations, and some more settings for optional English weather descriptions and imperial units, and maybe some flow conditions...
The free API allows five 3-hour forecasts per day, I guess I'll look at that as well at some point...
...
I have noticed that OpenWeatherMap hardly ever reports rain in the current data for my location, the forecast seems closer to reality. There is not that much difference in the actual versus the forecast data when it comes to the temperature and the other parameters.
In general I am interested to hear about the use cases/flows that you have for weather data. Let me know, and I will look at including it in a next update where I plan to add flow options.
Update: the app (up to v0.0.6) crashes as soon as it can't resolve the OpenWeatherMap URL, for instance when the internet is unreachable. I have fixed it, the fix will be included in the next update.
Your OpenWeatherMap API key 16ea2a0e42d7c5980cfbcc7dcaee509a is temporary blockeddue to the continual sufficient exceeding of the calls per minute limit by performing 8862 requests within a minute but the limit for the Free account is 60 rpm.
To unblock your API key and restore the normal operation with the weather API we ask you to surpress the loading from your API keys or upgrade your subscription. Contact usinfo@openweathermap.org for any help with choosing the proper type of the subscription.
OpenWeatherMap team
info@openweathermap.org
er maar af geknikkert
Could you please keep it in English, thanks :-)
@anne
However, the parameter is set to a fixed value in the app which is much higher, unless you run 20.000 instances, which I don’t think Homey is capable of...
I haven’t heard about/from others running into this, but I will have a look.
I got the same e-mail today after the auto update of the new beta!
No need to be so negative, you don’t seem to understand that app development is driven by positive responses/constructive criticism and nothing else.
@CyberSponk most users use the app ‘sun events’ for the sunrise/sundown times, I don’t think it belongs in the weather app?
@jkarlen I am glad someone likes the app ;-) I have a similar experience with the ‘current’ OpenWeatherMap data, it rarely reports rain for my location.
I have been running the current data in parallel with data from the forecast table (interval 0, I think it corresponds to the forecast for between 1 hour ago to two hours ahead of the current time), this seems to be somewhat more accurate, but still not really useable.
Note that for both the current and forecast tables rain is reported in mm/hour.
Anyway, fortunately the weather description is generally accurate (both current and forecast), I will add flowcards based on that (as @JasperB figured out long ago ;-))
There are some other parameters I might add later, e.g. ‘visibility’ which is only in the ‘current’ weather data. And there’s the 16-day forecast I haven’t looked into at all yet which could be added.
I wonder how many people are interested in a forecast beyond the 5 days that are currently possible?
In the meantime it turns out that the standard http library I am using has a small memory leak which may affect some users, I’ll probably move to a different library first and see if this helps with the other bugs as well.
I have submitted an up update for the OpenWeatherMap (http://openweathermap.org/) app, hopefully it will appear in the app store shortly. As new capabilities have been added, you will need to remove your OWM sensor and create (pair) new ones.
The app now includes data from the current weather table, the 5-day forecast (3-hour intervals) and the 16-day forecast (daily intervals). To make a clear distinction between the different sets of data I have created a 'device' for each. During pairing you can choose whether you want current of forecast data, and for the forecast data you can either choose the number of 3-hour intervals or the number of days in the future. The 16-day forecast includes morning, evening and night temperatures.
For each device I have defined a _lot_ of triggers and conditions. I think the condition card that triggers on the general weather category ('cloudy/rainy/clear/drizzle/misty/thunderstorm/snow/extreme') is particularly useful.
I have optimized the polling frequency based on the update times of the data sets, and I have used a different mechanism that is less likely to cause problems.
@Cybersponk I have included the sunrise/sunset times (only available in the 'current' data set)
Let me know what you think.
Update: the updated app is available in the store.
I installed app this morning (about 8). It seems it have problem to get data from OpenWeatherMap - message "...pending first data"
API test in my browser is OK.
I rebooted Homey but still the same.
App version: v0.0.8
Homey Firmware Version: 1.5.6-rc.8
Do you know what can be the problem?
What does the date and time stamp In the current wheather represent?
I noticed the presented time is lagging more than 1 hour regarding the actual time.
Thx, Rob
You get the error because the city or zip code is not in a format that is understood by the OWM API.
OetAelse, according to the API documentation for the current weather (https://www.openweathermap.org/current) it indicates the time of the last update of the data. For the forecast data I believe it indicates the time and date for the forecast.
Can anybody help me?
Thanks
Couldn't find it in the AND column card 'The weather is'. Found it on the OWM website (https://openweathermap.org/weather-conditions) although frost isn't a condition they support, fleet is, which would also an option.
Maybe I'm just blind of maybe it isn't in the package right now. In that case I would love to see it in a future release. TiA
I just noticed I was using the 5 day forcast in which the cards are different from the current weather. After playing around with the cards I found out that with some logic min. temperature and rain all pieces fall in place.
Although this leaves me with one question; will a flow always notify me when weather changes? So when it is raining more than lets say 10mm/hour and it changes to 20mm/hour will the flow triggered again?
I my logic it will... but I would like to hear it from experienced users of the OWM app.
With city/countrycode or zipcode it is a bit trickier. I haven't built in a test for the correct format. The problem is that the format depends on the country, and there may be cases where you do get a match, but it's not the one you think... For instance Cambridge, US instead of Cambridge, UK ;-)
You can try the following URL to test the 16 day forecast. Just insert your API key:
https://api.openweathermap.org/data/2.5/forecast/daily?q=amsterdam,nl&units=metric&lang=en&mode=json&APPID=<insert your API key here>&cnt=16
Same for the 5 day forecast:
https://api.openweathermap.org/data/2.5/forecast?q=amsterdam,nl&units=metric&lang=en&APPID=<insert your API key here>&cnt=16
And you can test different locations. For cities use 'q=<city,countrycode'>. Zip codes are trickier and differ from country to country. For the Netherlands something like 'zip=1024,nl' works. In the next release I am going to 'hide' the City and Zip code settings, it seems it confuses users, most will want to use Homey's location anyway.
@Vleege it is certainly possible. What do you have in mind?
I didn't include all the different weather descriptions/conditions as you would get a drop-down with ~50 different options, I didn't see the point in matching nine (!) different 'drizzle' conditions... In most cases all you want to know whether it rains or freezes or there's an extreme weather event I guess?
The data is not that accurate to begin with, so the very specific weather descriptions are a bit like matching the temperature with a couple of decimals ('if temp = 2,34 degrees') or something like that, it doesn't really make sense I think.
So I side-stepped this by only matching the category (thunderstorm, drizzle, rain, snow, extreme, etc.). But perhaps a shorter list of specific conditions could be useful.
I think the logic build in Homey combining with the tags you made available will do exactly what I want to achieve.
It will come down how I manage to get just one notification at certain weather conditions when they change but this will be possible I think with some of the apps available.
I have 2 scenarios in mind:
1.) When it is going to freeze I would like to get a notification to unplug the submersible pump (dompelpomp) so it won't pump water through the hose, which could freeze. Later on the notification will be replaced by a switch so I won't have to look after anymore.
2.) When it is extremely rainy (I guess >20mm/hour) I would like to get a notification to close the drain in the koekoek (say that again in English <span></span>)
But before all this "magic" will function just like I would like it to be I guess I will have to experiment with your app (for which I'm very happy you build (at last he says it)) and get familiar with it behavior.
About your question: Yes, the app will trigger a flow as soon as a parameter has changed. In your example if the rain forecast changes from 10 mm to 20 mm the flow will be triggered.
Now, I tested the same key with your link for the 5 days forecast. My browser shows me all the data. But when I use the key in the app, it finds the location but
5 days forecast
I just don't know what I do wrong. Do I need different API keys? Do I need a special one for the 5 days forecast?
Kind regards...