Plugin: Multi Provider Weather Station

Thanks for your reply. I reinstalled MWS with no adverse impact on Reactor. However MSW is not operating. The parent device reports: Waiting for Luup reload & No data. There are only 2 log entries. The first is “Device:Multi Weather Station (#77) in incorrect authentication information”. The second log entry is “Device responding again”. I placed my OpenWeather key in the Provider Key field of Settings and selected Current Temperature and Wind as Display Lines 1& 2. Any idea what I am doing wrong or what I should try next? I am running a Vera Plus.

Make sure you configured your credentials and hit Save Settings. Your hub should then reload LUUP to connect. Else send me a PM with all the log entries for the device.

Thanks again and sorry if I am being a pest. Uninstalled, rebooted Vera and reinstalled MSW. No impact on Reactor. I did not configure any fields other than Weather Provider and Provider Key. This time the parent shows Waiting LUUP Reload. CTL F5 fails to clear the Waiting LUUP Reload. The MSW parent logs have just two entries. The first is “Device:Multi Weather Station (#87) in incorrect authentication information. alert: #45867791842”. Approximately 3 minutes later is the second log entry “Device:Multi Weather Station (#87) in is responding again. alert: #45867825492”. I then moved the parent from “No Room” to “SP Weather Room” This cleared the “Waiting LUUP Reload”. Now it just says “No data” and "No data. Then I changed Display Line 1 and Display Line 2 in Settings to Temperature and Wind respectively. MWS still reports No data and No Data. There are no additional MWS log entries. When you say “credentials”, does that mean more that just putting my API Key in the Provider Key field the case of OpenWeather? If so, what other fields do I need to configure? Is there some documentation that I have missed? Which logs are you referencing MSW or Vera? It’s been years since I accessed Vera logs.

I am a pure novice when it comes to Vera logs, but I rebooted to get a new log starting point and did a search on MWS’s device number. I found the following two errors in in the logs in proximity to MWS log entries: “luup_require can’t find cjson” and “luup_require can’t find zlib”. Can these missing modules be the problem? If so, how do I correct it?

Hi,
Those modules are optional, not available on Vera, but are there on openLuup and make things more efficient.
After some initial research I think OpenWeather will not work on Vera any more. The firmware is very old and lacks any modern security options that most web sites require today. Not sure if a workaround is possible, but to be honest I do not plan to research and implement that for Vera as it is end of life.

Cheers Rene

When @retireditguy started this thread, I actually tried installing it myself with Reactor to see what, if any, conflicts there might have been. It all worked fine for me, but at that point, it seemed he had uninstalled so I didn’t post about it (sorry about that; wrong choice). Anyway, I saw no conflicts between Reactor and MSW (and I even did a quick code review on MSW on Github to see if anything stood out that might be a problem, and it’s whistle clean).

@reneboer My test was run on my venerable old Vera 3 (one Plus lives on the shelf now, and the other is house/production, so isn’t used for experimentation). Even that ancient 1040 firmware had no trouble getting OpenWeather data, so it looks to me like it still works for the moment, and therefore should also work on the slightly more modern 7.3x family on the Plus/Secure. The Edge is sometimes a bit of a tweener; it’s not built exactly like 3 or Plus, so YMMV, but I’d expect closer to Plus (and therefore still working as well).

Edit: To add, @retireditguy , if you’re not on the latest Reactor from Github, please do upgrade. There are some relevant bug fixes. I no longer publish my plugins through the Vera App Marketplace; that became too inconsistent to deal with some time ago, so I’ve given up.

Thanks for your reply and the heads-up on Reactor. I will upgrade both Vera Plus units as soon as I have a few minutes. I am a bit confused regarding the cjson and zlib errors in the Vera log. If these modules are optional, why are they reporting as luup_require can’t find in the log? Also, do I understand that you are able to run MWS successfully on and old Vera 3 and you believe it should run on a Plus? Did you need to enter any data other than the OpenWeather API key in the MWS settings or elsewhere? Thanks again for your assistance. The "conversion to ezlo is definitely a pain.I purchased an ezlo plus and this whole exercise is like starting from zero. I suspect MSR is in my future. Did I read that you have successfully ported it to ezlo?

Is MWS available on ezlo? Also, referring back to my earlier post, does configuration of MWS require entering any data other than the OpenWeather Api key, for example, ID and password?

This is really a @reneboer question but it has a generic cause so I’ll answer on his behalf: in order to see if the library is available, you have to attempt to load it. You can’t stop the log message if the load fails, but the failure doesn’t cause the plugin to stop; it’s a “controlled crash”. The message can be safely ignored. If MWS were my plugin, I would probably not attempt to load these if I knew I wasn’t running on openLuup, because that’s the only system on which these libraries would likely exist.

Correct.

Nope. I just popped in my API key and it worked immediately.

It’s not a port, it’s a whole new thing, and it does work with Ezlo (Plus, Secure, and latest-generation Atom).

if Weather is of interest, then Ezlo has a built in capability to provide Weather, as well as connectivity to other weather services…

you can see how I got the temp in New York…
and I even simply dragged and dropped the “temp” into a “cloud variable” so that I can use this variable in any other MeshBot I create…

Thanks for your replies. One last question, did you install MWS from the Marketplace or from Github?

Thank you very much for the “heads-up”. I am a retired IT executive and a long time Vera user, but only recently purchased an Ezlo Plus. I have to admit, I find the impending “migration” to Ezlo intimidating, mostly because I don’t yet understand all the parts of the new architecture including ezlogic and Nucal. (Waiting for the announced device migration toolkit.) The only “programming” I have done in the last 10+ years was Vera and Reactor scripting. I am glad to see that Ezlo is building some meshbots for general use by Ezlo owners. Is there or will there be documentation regarding the individual meshbots? For example, I “installed” the Ezlo Weather and Open Weather meshbots and was able to recreate your “Get Temperature” example. However, it’s unclear to me how I can modify the OpenWeather meshbot to obtain additional data, specifically humidity and wind speed. Can you provide any suggestions on where to start learning how to interact with the Ezlo, especially Mios/ezlogic.com?
Lastly it’s hard to believe you have the time to participate on this board. You must be really committed to Ezlo’s success.

1000%! :slight_smile:

I am selfishly building the last ever home automation I want to use in my home :slight_smile:

Hello @retireditguy

You can find documentation on Ezlogic and meshbots here.

Regarding your question about getting other variables other than temperature, I’m not sure these integrations give other data. I’ll check if there’s a way to do it.

Hi @retireditguy and @reneboer

I’m rebuilding a VeraPlus and looking to get out from under the impending Darksky shutdown by switching to openweathermap.org using MWS. Looks to me like the current MWS version is using a non-free API call - “onecall”. I get the authentication error too if I just run the query in the browser, or in the plugin of course.

The version 1.1 of the MWS plugin seems to call the non-free API. Looks like its on line 918 - L_MsWeather.lua if I’m reading it right.

The current free api is user “Professional Collections” and has a certain rate/limit you can access the weather data (which is pretty high for free use - 1 million calls/month).

Ideally the URL would look more like: https://api.openweathermap.org/data/2.5/weather?lat=%s&lon=%s&units=%s&lang=%s&appid=%s&exclude=hourly
…but I’ve tried this - also to no avail - but the browser response comes back successful.

I’m not quite sure how to debug further. Tips would be welcome.

Replying to myself with more data:

luup_log:86: Multi Weather Station_debug: Calculated next poll at 2022-12-04 19:04:30 in 60 seconds. <0x7473c520>
06	12/04/22 19:03:30.101	Device_Variable::m_szValue_set device: 86 service: urn:upnp-rboer-com:serviceId:Weather1 variable: eLastPollTSe was: 1670198550 now: 1670198610 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x7473c520>
50	12/04/22 19:03:30.102	luup_log:86: Multi Weather Station_debug: calling OpenWeather API with url = https://api.openweathermap.org/data/2.5/weather?lat=43.3862&lon=-79.8371&units=metric&lang=en&appid=NOTMYAPIKEY&exclude=hourly,daily,minutely <0x7473c520>
50	12/04/22 19:03:30.510	luup_log:86: Multi Weather Station_debug: {"coord":{"lon":-79.8371,"lat":43.3862},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"base":"stations","main":{"temp":-0.01,"feels_like":-0.01,"temp_min":-1.45,"temp_max":1.11,"pressure":993,"humidity":74},"visibility":10000,"wind":{"speed":0.89,"deg":84,"gust":3.58},"clouds":{"all":14},"dt":1670198490,"sys":{"type":2,"id":2007398,"country":"CA","sunrise":1670157328,"sunset":1670190244},"timezone":-18000,"id":5911592,"name":"Burlington","cod":200} <0x7473c520>
02	12/04/22 19:03:30.512	luup_log:86: Multi Weather Station_warning: No current data <0x7473c520>
50	12/04/22 19:03:30.512	luup_log:86: Multi Weather Station_debug: No forecast data configured <0x7473c520>
50	12/04/22 19:03:30.513	luup_log:86: Multi Weather Station_debug: calling OpenWeather API with url = https://api.openweathermap.org/data/2.5/air_pollution?lat=43.3862&lon=-79.8371&appid=NOTMYAPIKEY <0x7473c520>
50	12/04/22 19:03:31.109	luup_log:86: Multi Weather Station_debug: {"coord":{"lon":-79.8371,"lat":43.3862},"list":[{"main":{"aqi":1},"components":{"co":253.68,"no":0,"no2":12.34,"o3":57.22,"so2":5.72,"pm2_5":5.29,"pm10":6.74,"nh3":1.96},"dt":1670198610}]} <0x7473c520>

Looks like I’m getting data back, but the plugin doesn’t seem to be doing its thing…

Again - any tips are welcome! - Thanks!

Replying to myself again… but I think I’m on to something:

Here is the onecall url:

(https://api.openweathermap.org/data/3.0/onecall?lat=33.44&lon=-94.04&exclude=hourly,daily&appid=)

Here is the response:

                

{
  "lat": 39.31,
  "lon": -74.5,
  "timezone": "America/New_York",
  "timezone_offset": -18000,
  "current": {
    "dt": 1646318698,
    "sunrise": 1646306882,
    "sunset": 1646347929,
    "temp": 282.21,
    "feels_like": 278.41,
    "pressure": 1014,
    "humidity": 65,
    "dew_point": 275.99,
    "uvi": 2.55,
    "clouds": 40,
    "visibility": 10000,
    "wind_speed": 8.75,
    "wind_deg": 360,
    "wind_gust": 13.89,
    "weather": [
      {
        "id": 802,
        "main": "Clouds",
        "description": "scattered clouds",
        "icon": "03d"
      }
    ]
  },
  "minutely": [
    {
      "dt": 1646318700,
      "precipitation": 0
    },
    ...
  },
    "hourly": [
    {
      "dt": 1646316000,
      "temp": 281.94,
      "feels_like": 278.49,
      "pressure": 1014,
      "humidity": 67,
      "dew_point": 276.16,
      "uvi": 1.49,
      "clouds": 52,
      "visibility": 10000,
      "wind_speed": 7.16,
      "wind_deg": 313,
      "wind_gust": 10.71,
      "weather": [
        {
          "id": 803,
          "main": "Clouds",
          "description": "broken clouds",
          "icon": "04d"
        }
      ],
      "pop": 0.03
    },
    ...
  }
    "daily": [
    {
      "dt": 1646326800,
      "sunrise": 1646306882,
      "sunset": 1646347929,
      "moonrise": 1646309880,
      "moonset": 1646352120,
      "moon_phase": 0.03,
      "temp": {
        "day": 281.63,
        "min": 271.72,
        "max": 282.21,
        "night": 271.72,
        "eve": 277.99,
        "morn": 280.92
      },
      "feels_like": {
        "day": 277.83,
        "night": 264.72,
        "eve": 273.35,
        "morn": 277.66
      },
      "pressure": 1016,
      "humidity": 55,
      "dew_point": 273.12,
      "wind_speed": 9.29,
      "wind_deg": 3,
      "wind_gust": 16.48,
      "weather": [
        {
          "id": 500,
          "main": "Rain",
          "description": "light rain",
          "icon": "10d"
        }
      ],
      "clouds": 49,
      "pop": 0.25,
      "rain": 0.11,
      "uvi": 3.38
    },
    ...
    },
    "alerts": [
    {
      "sender_name": "NWS Philadelphia - Mount Holly (New Jersey, Delaware, Southeastern Pennsylvania)",
      "event": "Small Craft Advisory",
      "start": 1646344800,
      "end": 1646380800,
      "description": "...SMALL CRAFT ADVISORY REMAINS IN EFFECT FROM 5 PM THIS\nAFTERNOON TO 3 AM EST FRIDAY...\n* WHAT...North winds 15 to 20 kt with gusts up to 25 kt and seas\n3 to 5 ft expected.\n* WHERE...Coastal waters from Little Egg Inlet to Great Egg\nInlet NJ out 20 nm, Coastal waters from Great Egg Inlet to\nCape May NJ out 20 nm and Coastal waters from Manasquan Inlet\nto Little Egg Inlet NJ out 20 nm.\n* WHEN...From 5 PM this afternoon to 3 AM EST Friday.\n* IMPACTS...Conditions will be hazardous to small craft.",
      "tags": [

      ]
    },
    ...
  ]

And if we look at the new method:

(https://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid=)

With the response:

                          

{
  "coord": {
    "lon": 10.99,
    "lat": 44.34
  },
  "weather": [
    {
      "id": 501,
      "main": "Rain",
      "description": "moderate rain",
      "icon": "10d"
    }
  ],
  "base": "stations",
  "main": {
    "temp": 298.48,
    "feels_like": 298.74,
    "temp_min": 297.56,
    "temp_max": 300.05,
    "pressure": 1015,
    "humidity": 64,
    "sea_level": 1015,
    "grnd_level": 933
  },
  "visibility": 10000,
  "wind": {
    "speed": 0.62,
    "deg": 349,
    "gust": 1.18
  },
  "rain": {
    "1h": 3.16
  },
  "clouds": {
    "all": 100
  },
  "dt": 1661870592,
  "sys": {
    "type": 2,
    "id": 2075663,
    "country": "IT",
    "sunrise": 1661834187,
    "sunset": 1661882248
  },
  "timezone": 7200,
  "id": 3163858,
  "name": "Zocca",
  "cod": 200
}                                              

And from the log file in my previous post above:

02	12/04/22 19:03:30.512	luup_log:86: Multi Weather Station_warning: No current data <0x7473c520>

…which is quite correct, as the response data doesn’t have a current element.

Hi @retireditguy ,

thanks for your efforts and feedback on this. We are putting our best effort on these integrations and try to make it easy for you to use them without any code. So right now only temperature data is retrieved and its trivial to get all data from the API. Shortly we will update the service and present all data. Please stay tuned.

That sounds great, but coming from the world of Vera, it is all very confusing to me right now. (Hopefully “soon” is not too far off.) After “installing” Ezlo Weather and OpenWeather via Ezlogic, I found that I had two instances of both EzloWeather and the OpenWeather token in Vera Mobile. After removing and reinstalling Vera Mobile, I also found the PAASAuthentication device. I have no idea what PAASAuthentication’s role is or why it was installed. I also found that a script was added called “Get City Temp”. There is no indication in the script how to input the desired city name variable. Hopefully once I have time to review “Quickstart - help.mios.com” I will start to understand what is going on and how to use these capabilities. The scene scripting in Ezlo is also differently confusing. Why do all Ezlo device scene scripts apparently start with a state change? Vera device scene scripts started by testing the current state and proceeded from there. It’s the difference between “If x is on” versus “if x changes to on”.

Hi @retireditguy

  1. You ask and we listen, as of now you can use humidity and wind speed from opeanweather and in Ezloweather.

can you please help us identify the problem in this case. A screenshot from Vera mobile app showing PAASAuthentication and script objects. those should not be displayed at all.

Again can you please give more information on how you see the device options in meshbots in ezlogic in your account. Because in ezlogic, there is no obligation for device state changes.

However , due to the nature of the “trigger” meaning, an event is required from a datasource. So if you want to start a chain of events according to some device state(current state) , how would the computer know, when to start the events ? As long as the device state does not change, it is impossible. So, naturally, meshbots (or any logic which require a “start” event, would base on some event triggered from a data source. That can be a temperature sensor broadcasting its current temperature. Even in that case, the “trigger” is based on that event and compares the data coming from the device with another data source (or static data)
So it does not make sense to “start/trigger” meshbots based on current status of anything. You can however, “after” starting the meshbot, make comparisons of current states of device states with some other data source. we call them “exceptions”. And you can use them only for comparison purposes and not to trigger the meshbots.
Hope the explanation helps.

1 Like