[RELEASE] Weather-Display With OWM-Alerts Forecast Driver

UPDATED V0.5.2 06/12/2022

  • Both MyTile and the Three day Forecast Tile now use the Icon and Text selected in the 'Condition Icon/Text for current day on MyTile & Three Day Forecast Tile' option.

This has been corrected in the code. Re-import the code or do a Repair in HPM. The version number was not updated.

Thanks @arnb

[UPDATED] V0.5.3 07/26/2022

  • Improved Fallback to hub location defaults and estimates for Sunrise-Sunset.org poll failure.

[UPDATED] V0.5.4 07/28/2022

[UPDATED 08/20/2022 V0.5.4]

  • More corrections to sunrise/sunset data when when there is a Sunrise-Sunset.org failure.

If using HPM Update or do a repair. Otherwise open the driver code and re-import from the Github source.

[UPDATED V0.5.6 08/22/2022]

This version completely removes the sunrise-sunset.org poll. It will use the Hub's sunrise and sunset times then calculate Noon as the mid-point of those. It estimates twilight begin as 25 minutes before sunrise and twilight end as 25 minutes after sunset. With these estimates the sunrise-sunset.org poll is no longer required.

I made this change very quickly, but I have not seen any errors in my brief testing. Please report any issues and I will address as quickly as I can. Thanks.

[UPDATED V0.5.7 08/23/2022]

  • Added user selection of 2.5 or 3.5 OWM API Key

  • Moved Schedule Change log notice to Extended Logging.

image

If you have a legacy OWM 2.5 API Key the new API Key Version must be OFF (Default). If you have a new OWM 3.0 API Key the API Key Version must be ON.

If using HPM do an Update or a repair. Otherwise open the driver code and re-import the code. Thanks.

What advantages does having a OWM 3.0 API Key have over 2.5 ? I went to the OpenWeather website and it wasn't immediately clear to me. Is the 3.0 API subscription only and 2.5 is free? I haven't paid for my API key to access OWM and don't plan to change that if I can help it.

I don't know that there are any advantages of the 3.0 key versus the 2.5 key. The 2.5 key is no longer obtainable, so new users can only get a 3.0 key. In order to get a 3.0 key they must put in a payment method that will be charged should they exceed the 1,000 calls per day 'free' limit. As far as I have been able to determine the functionality is identical. A 2.5 key will only work on the 2.5 API endpoint. It will not work on the 3.0 API endpoint. A 3.0 key will only work on the 3.0 API endpoint. It will not work on the 2.5 API endpoint.

4 Likes

@Matthew, thanks for this great driver. I am wondering if the attribute Weather Condition Code IDs could be added to the driver?

The driver does not expose the actual condition_id as an attribute. Please feel free to add that to your copy of the driver it you need it. The driver does the mapping of condition_id to condition_code, icon_code(s) and condition_text. See driver code line 1797-1853 for the mapping used.

Thank you and sorry to admit that, actually, I don't know how to do that (write or modify a driver). I was wondering if you could add it to a future version, sorry if that was presumptive. But thank you again.

[UPDATED V0.5.8 01/05/2023]

  • Bug fix for myTile not showing icon when neither the 'Three day Forecast Tile' nor the 'Forecast High/Low Temperatures' Optional attributes are selected.

If using HPM do an Update or a repair. Otherwise open the driver code and re-import the code. Thanks.

[UPDATED V0.5.9 01/23/2023]

  • Bug fix for wind_cardinal that is creating a "No Data" response w/ 3rd party tile apps.

If using HPM do an Update or a repair. Otherwise open the driver code and re-import the code. Thanks.

[UPDATED V0.6.0 05/30/2023]

  • Changes to prevent errors and better reporting in situations where there is no sunrise or sunset.

If using HPM do an Update or a repair. Otherwise open the driver code and re-import the code. Thanks.

[UPDATED V0.6.1 06/03/2023]

If using HPM do an Update or a Repair. Otherwise open the driver code and re-import the code. Thanks.

[UPDATED V0.6.2 08/31/2023]

Added pull request from @nh.schottfam to display sun 'altitude' & 'azimuth' as stand-alone optional attributes. Code cleanups.

attribute 'altitude' // sun angle up from the horizon (0 on your horizon, 90 straight up)|
attribute 'azimuth' // sun angle along the horizon (0 is N, 90 East, etc..)|

If using HPM do an Update or a Repair. Otherwise open the driver code and re-import the code. Thanks.

Feature request : I pull illuminance from OWM to give me a value of the outdoor brightness. I think this has worked for a long while but I currently am getting an error about a null value.
app:1992024-01-22 09:36:09.761 PMerrorjava.lang.NullPointerException: Cannot get property 'currentIlluminance' on null object on line 3185 (method modeOffHandler)
This error generates through a Room Lighting app/rule that is supposed to turn the light on if I have a value of 2000 or less outside.
I believe that Illuminance is a defined Capability of HE and as such should be declared in the driver. However it isn't declared as one in the driver, it's just a simple attribute but it is using the same name/spelling. Using Room Lighting, I'm allowed to select a drop down of capabilities to pick a comparison - it allows me to select 'Illuminance' but this always returns this error.
I rewrote the Room Lighting to use 'custom attribute' of illuminance - and viola. success. I think this is a slippery slope when using dedicated keywords as attributes.

  • My feature request is to rename the attribute, or tie the attribute to the capability so it can be used as one. thank you for your consideration.

The driver does use capability of illuminance.

You should check that your virtual device is actually using this driver. The error you are receiving indicates a problem in the method 'modeOffHandler' on line 3185 of the code. This driver does not have an 'modeOffHandler' method and the last line of code in the driver is #2467. The error also indicates it is from 'app:199'. This driver is not an app, it is a device driver. Find out what app:199 is and that is the source of the error.

thanks! I didn't look close enough - my error comes from Room Lighting (app 199). I rewrote using 'custom attribute' and my problem went away.

1 Like