OpenWeatherMap-Alerts-Weather-Driver

Not.if it is failing and retrying.

Good point!

I've been using the OpenWeatherMap driver since switching to Humitat from SmartThings. I have my latitude/longitude set correctly, and for the most part, the weather is generally reliable and matches other sources of weather that I can retrieve for my location. However, I have several variables that randomly seem to report incorrect during some data refreshes. For example, my Ecobee thermostat was announcing to open all the windows at home since it thought the weather was favorable, but it was not. This was followed soon after by a message to close all the windows. In looking at the weather device event log, I can see that the dewpoint was hovering in the upper sixties all day, but for two isolated moments this morning, it got reported in the low fifties which triggered some of my automations. Any knowledge about what causes this or how to fix it?

Same thing happened yesterday too where several data refreshes pulled inconsistent data, and then it returned to normal again.

The driver just reports what it is provided by OWM. If OWM provides inconsistent data, then this driver will reflect that. Like most weather data providers, OWM pulls data from many different sources, some of those are personal weather stations that may not be be that reliable. If the area you are polling for has limited sources to gather information from, and those sources are not consistent in either frequency of reporting or data consistency, then OWM results may reflect that inconsistency.

Thanks, Matthew. Definitely not a driver problem, I know. That driver is awesome! Didn't know what options I had with OWM to refine their data or pick which reporting stations correspond to my longitude and latitude or other strategies to prevent a discrepant value coming through to trigger non-sensical automations. I also considered perhaps taking a median or average value over time and then connecting my trigger to that calculated value might be a way to skirt the problem, but I'm not sure how to accomplish that level of fanciness in webcore either. Truthfully, I would love to solve the problem at the source instead. I'm in a smaller suburb outside of Chicago, so I'm typically used to some pretty consistent weather values, so I haven't experienced this problem in the past.

1 Like

Is there a possibility of adding AQI to the OWM pull? I see someone has a separate driver for it, but it would make sense to integrate as long as you are already pulling the data.

IIRC the AQI is only in the secondary set.

Yeah, on looking at the API, I noticed that it was a separate call and would be better served in a separate driver as not everyone needs that kind of information.
I will modify and update the driver I found at that link. (It only pulled a single level, I wanted the PM2.5 I will add and post.)

1 Like

Hi Matthew,

I am little puzzled, I am in the West Coast. Sunrise here is around 6:40am. Usually, it's shine and bright after 7:45am here. But Openweather device won't show "illuminance" Lux value until after 11pm or sometimes noon. Is there anyway I can make it to show the Lux value earlier? (My polling schedule is every 10 minutes)

Thanks in advance.

The driver calculates a LUX value and reports it as 'illuminance'. That attribute value is reported in the Current States.

The driver does not have the ability to report, or not report, attributes only during certain times. Standard attributes are reported/updated (in Current States) at your selected polling intervals. Any optional attributes will only report/update at your selected polling intervals if you have turned them on.

Suggesting that the driver is somehow only reporting illuminance after 11:00 AM makes no sense to me? It does not work that way. Perhaps your hub location is not set correctly, or you are using the optional 'Override Hub Location Coordinates' feature and those are not correctly set for your location? The driver does determine your sunrise/sunset times based on your Hub location. 'illuminance' is a calculation based on sunrise/sunset times (among other factors). If your coordinates are off, then your illuminance calculation will be off too. The fact that you do not see illuminance until later in the day suggests that the coordinates are set to something west of where your hub is located. If that were correct then I would expect to see elevated illuminance numbers immediately after twilight ends too.

Just want to report here that the driver is indeed working and it does show the lux value but not showing in earlier log. Matthew helped explain that limiting the retention of the events on the weather driver because they report so frequently.

Thanks Matthew for your help.

2 Likes

I would like to second someone earlier who said that this driver was their favorite. I completely agree!! I've customized the 3-day tile for my Dashboards and the driver has worked perfectly.

I would like to use TTS during a Goodnight routine to speak tomorrow's weather using forecast_text1, forecast_low1 and forecast_high1. I see that forecast_text1 is exposed a Device Attribute however the other states are not. Is it possible to expose more/all states as Device Attributes for use in other areas of Hubitat?

You will need to need to turn on the On the optional attributes for those:
image
image

I have those two selected and they appear in the Device's Current States, however only forecast_text is available as an Attribute.


Please disregard the above. I haven't changed any settings for the Driver, however it's now exposing all States. :man_shrugging:t3:

2 Likes

Can you please replace the code that is generating these Logs:

with the Hubitat standard 'Enable descriptionText logging' Preference:

input "txtEnable", "bool", title: "Enable descriptionText logging", required: false, defaultValue: false

Doing so enables users to completely disable logging and adds your drivers to the txtEnable group in Preference Manager.

Thx

Update V0.6.2 released on August 23, 2022 moved those logs so they will only show if you have 'Extended Logging' enabled.

Okay, I updated, thanks.

Hello,

I have a question about the open weather map driver. I am trying to get this to work and am unable.

Here is the output from the logs:

It is saying 401:Unauthorized

However I have checked my API key and it works fine with this link:
http://api.openweathermap.org/data/2.5/weather?q=Berlin&APPID=XXXXX

I have played around with other links and can get all kinds of weather info I just cant get it to work with hubitat. I wonder if they changed their API call links? Is anyone else having this issue?

As an update I changed the URLs on lines 352 and 360 onecall -> weather and now my API key authenticates but then now there are some null pointer errors.

Not enough info to determine your issue, however is sounds like you are using the wrong version of the API. See this post. Hope that helps.

1 Like