×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Documentation for Weather SImulator / OpenWeatherMap properties

  • Posts: 102
  • Thank you received: 13
Dear all,

I am using Indi for a little while now in order to develop a fully automated observatory system (not relying on ekos though). And was recently pleased to discover the OpenWeatherMap driver, as well as the simulator.
Unfortunately, as I was looking for basic documentation for common properties, I realized that there was none on this page: indilib.org/develop/developer-manual/101...dard-properties.html

hence I was not really able to understand all the values there:


Status code is sometimes 0, 800, 802, what are acceptable value I could use to check if the service is working correctly ? Are those actual http codes ?
Also, my main goal would be to detect when OpenWeatherMap is not responding, or my network is down, is the Weather number the right place to look ?
I checked, and its value is sometimes 0 or 1, what is the actual meaning of this property ?

Thank you very much in advance for your help
Last edit: 4 years 3 months ago by dolguldur.
4 years 3 months ago #46857
Attachments:

Please Log in or Create an account to join the conversation.

Right, the weather properties need to be added there (any volunteers?). Basically, the "Weather" could be either a binary "Clear"/"Cloudy" variable or a range "Clear/Hazy/Foggy/Cloudy/Thunderstorm"...etc. It's a general description of the sky conditions.

It would be great if someone can step in to document the properties properly in the documentation, let me know if you can contribute the updates.
4 years 3 months ago #46859

Please Log in or Create an account to join the conversation.

  • Posts: 102
  • Thank you received: 13
Ok thank you a lot for your answer ! That is a first step, I know that this is an arbitrary value, and that I can decide otherwise based on individual values for other parameters (like cloud cover, rain, etc...).
I will check the source code in order to try to understand how one check if the driver is indeed connected to the service or not.

EDIT, actually, the values can go above 1, see www.indilib.org/api/openweathermap_8cpp_source.html:
if (!strcmp(observationIterator->key, "id"))
                     {
                         int id;
                         if (observationIterator->value.isDouble())
                             id = observationIterator->value.toNumber();
                         else
                             id = atoi(observationIterator->value.toString());
 
                         setParameterValue("WEATHER_CODE", id);
 
                         if (id >= 200 && id < 300)
                         {
                             // Thunderstorm
                             setParameterValue("WEATHER_FORECAST", 2);
                         }
                         else if (id >= 300 && id < 400)
                         {
                             // Drizzle
                             setParameterValue("WEATHER_FORECAST", 2);
                         }
                         else if (id >= 500 && id < 700)
                         {
                             // Rain and snow
                             setParameterValue("WEATHER_FORECAST", 2);
                         }
                         else if (id >= 700 && id < 800)
                         {
                             // Mist and so on
                             setParameterValue("WEATHER_FORECAST", 1);
                         }
                         else if (id == 800)
                         {
                             // Clear!
                             setParameterValue("WEATHER_FORECAST", 0);
                         }
                         else if (id >= 801 && id <= 803)
                         {
                             // Some clouds
                             setParameterValue("WEATHER_FORECAST", 1);
                         }
                         else if (id >= 804 && id < 900)
                         {
                             // Overcast
                             setParameterValue("WEATHER_FORECAST", 2);
                         }
Last edit: 4 years 3 months ago by dolguldur.
4 years 3 months ago #46861

Please Log in or Create an account to join the conversation.

  • Posts: 102
  • Thank you received: 13
@Jaseem , from the same source code, I see, that in case of connection problem, a "return IPS_ALERT;" is issued within the updateWeather() method.
From a client perspective, that is actively polling from time to time on the OpenWeatherMap driver, requesting for specific (cloud/rain) values, how do I check if such an alert was issued ? Because currently, even in the case of an alert, the rain/cloud/... values stays the same as before the problem.


Thank you a lot for your help.

EDIT: can you show where is the code for the document page ? so that I can see if I can contribute to this documentation page ?
EDIT2: ok I think I got it, in cas the IPS_ALERT is issued, then the number vector corresponding status goes to alert: setNumberVector device="OpenWeatherMap" name="WEATHER_PARAMETERS" state="Alert"
Last edit: 4 years 3 months ago by dolguldur.
4 years 3 months ago #46862

Please Log in or Create an account to join the conversation.

  • Posts: 472
  • Thank you received: 165
The status code is raw code received from the OWM API, they are documented at openweathermap.org/weather-conditions
The following user(s) said Thank You: dolguldur
4 years 3 months ago #46868

Please Log in or Create an account to join the conversation.

Time to create page: 0.406 seconds