OpenWeatherMap-Alerts-Weather-Driver

Ok did that, then did a poll data, followed by a refresh, with the following error

dev:14092020-10-23 11:36:34.558 errorjava.lang.IllegalArgumentException: The JSON input text should neither be null nor empty. on line 1362 (pollOWMHandler)

I have seen that error sporadically right after I update the code. It seems to only happen occasionally on the first poll after a code update ..... then never again. I have not been able to determine why it happens, but since it does not occur (for me) after the first time, I have not been able to track that down. Let me know if you continue to see it.

Ok I will monitor the logs. Redid the Poll data, refresh: no errors.

One other HPM problem: unable to determine which package should be deleted, both have the same name.

image

I am not certain? If it was me I would probably manually delete the old ('NWS') driver code from my system, then do a 'Match Up' in HPM. I am just guessing ... again, I have never installed my driver(s) in HPM so I have never attempted it.

Sorry I made this so hard. I didn't anticipate that removing 'NWS' from the name would make this so cumbersome. In hindsight I should have left the old driver and depreciated it, then started a new driver/tread. Because of the issue you had (and overcame) with multiple automations I was thinking just renaming it would this would be easier.

2 Likes

I understand your situation, been there. Unintended consequences from wanting to do the right thing. The community will get through this, well most of us.

After looking at the manifest, perhaps removing any deprecated packages, then posting detailed instructions for installing the new renamed version would help.

2 Likes

Suggest installing HPM to test and verify your manifests. Continue with your normal development, then after releasing an updated version, reinstall using HPM. With HPM in non-automatic, manual update mode, this works for me.

Decided to push through and do an HPM uninstall. Clicked on the first "OpenWeatherMap-Alerts Weather Driver". The app asked if I wanted to delete "OpenWeatherMap-NWS-Alerts Weather Driver". Should you pick the wrong one, cancel. Done, problem solved (for me)

2 Likes

Better Update Instructions:
I updated the instruction on the latest update above on how to do the update with either HPM or without. Hope that helps.

I did not see where OWM provided definitions or time periods for this. The documentation is here:

@Matthew is it possible to click on one of the tiles and have it go full screen? That would be great for us who have a hard time seeing the small text on the screen....hate getting old.

I do not believe that is a capability with Hubitat dashboard tiles, at least I have never seen or heard of it.

I wonder if there is a css tile hack to do this.

Haven't tried it but you may be able to use ::hover to reset the height and width of the tile

You can do that with images in the Hubitat dashboard (like a radar GIF). Not sure about dynamic tile information like this though.

[UPDATED]
v0.3.3
10/23/2020

Changes:

SPECIAL NOTE IF YOU ARE UPDATING FROM A VERSION PRIOR TO V0.3.2:
(not required if you have version V.0.3.2 or higher already installed or you are doing a first time install)

The suggested updated method with HPM is to do a new install with the new driver (without the 'NWS' in the filename. Once installed, go to your virtual device and update the driver to use the new driver. You can use HPM to delete the old driver as follows: Do an 'Uninstall. If there are two drivers listed with the same name, click on the first "OpenWeatherMap-Alerts Weather Driver". The app asked if I wanted to delete "OpenWeatherMap- NWS -Alerts Weather Driver". Should you pick the wrong one (the one WITHOUT 'NWS' in the name), cancel and retry with the other selection. (Thanks @arnb for those details).

If you do not use HPM then since the filename and the directory name has changed you will need to copy the code and paste it over your current driver. (You cannot use the ImportURL for this this one time because the name and location has changed). Once installed, go to your virtual device and check/update the driver to make sure it is using the new driver.

2 Likes

UPDATED]
v0.3.4
10/24/2020

Changes:

  • Added an indicator of multiple weather alerts on the dashboard tiles. Only the first alert will be displayed, but if there are additional alerts there will be a "+1" (or +2 up to +9). You can click on the alert displayed to go to the OWM page for your location and see additional details on the alerts. See this post if you have issues with the OWM location page,
  • additional optimizations and minor bug fixes (by @nh.schottfam).

SPECIAL NOTE IF YOU ARE UPDATING FROM A VERSION PRIOR TO V0.3.2:
(not required if you have version V.0.3.2 or higher already installed or you are doing a first time install)

The suggested updated method with HPM is to do a new install with the new driver (without the 'NWS' in the filename. Once installed, go to your virtual device and update the driver to use the new driver. You can use HPM to delete the old driver as follows: Do an 'Uninstall. If there are two drivers listed with the same name, click on the first "OpenWeatherMap-Alerts Weather Driver". The app asked if I wanted to delete "OpenWeatherMap- NWS -Alerts Weather Driver". Should you pick the wrong one (the one WITHOUT 'NWS' in the name), cancel and retry with the other selection. (Thanks @arnb for those details).

If you do not use HPM then since the filename and the directory name has changed you will need to copy the code and paste it over your current driver. (You cannot use the ImportURL for this this one time because the name and location has changed). Once installed, go to your virtual device and check/update the driver to make sure it is using the new driver.

@Matthew Is your app able to provide a tile representing this? This snippet is from TimeandDate.com

Not graphically. It does have optional attributes of

  • tw_begin (Twilight Begin)
  • sunriseTime
  • noonTime
  • sunsetTime
  • tw_end (Twilight End)

If you want these attributes to be available you need to turn in the optional attribute:
image

I may have figured this out. it is related to field sunRiseSet being undefined. This field is set using an async HTTP request. I suspect the HTTP results have not been received, posted and the sunRiseSet field created when the field is tested on an initial restart, causing the null/empty error. After that it's always available

Map sunRiseSet = parseJson(myGetData('sunRiseSet')).results

dev:14092020-10-24 17:16:34.417 errorjava.lang.IllegalArgumentException: The JSON input text should neither be null nor empty. on line 1360 (pollOWMHandler)

Line 269 asynchttpGet('sunRiseSetHandler', requestParams)

1 Like

[UPDATED]
v0.3.5
10/25/2020

Changes:

  • Bug fix for null JSON returns.

SPECIAL NOTE IF YOU ARE UPDATING FROM A VERSION PRIOR TO V0.3.2:
(not required if you have version V.0.3.2 or higher already installed or you are doing a first time install)

The suggested updated method with HPM is to do a new install with the new driver (without the 'NWS' in the filename. Once installed, go to your virtual device and update the driver to use the new driver. You can use HPM to delete the old driver as follows: Do an 'Uninstall. If there are two drivers listed with the same name, click on the first "OpenWeatherMap-Alerts Weather Driver". The app asked if I wanted to delete "OpenWeatherMap- NWS -Alerts Weather Driver". Should you pick the wrong one (the one WITHOUT 'NWS' in the name), cancel and retry with the other selection. (Thanks @arnb for those details).

If you do not use HPM then since the filename and the directory name has changed you will need to copy the code and paste it over your current driver. (You cannot use the ImportURL for this this one time because the name and location has changed). Once installed, go to your virtual device and check/update the driver to make sure it is using the new driver.

1 Like