[RELEASE] Precipitation and Weather Monitor for National Weather Service Data (USA Only)

I just started seeing the following error

2024-06-07 02:57:17.053 PMerrorjava.net.UnknownHostException: w1.weather.gov: Name or service not known on line 343 (method refresh)

Tried a quick DNS lookup on w1.weather.gov and it is missing now on both google and cloudflare DNS. Not sure if this is a temporary issue or permanent or something else beyond my limited knowledge?

EDIT: sorry I should have scrolled back further. I now see the note about a changed url. Will you be posting that update soon or can you share the new url?

It's

https://forecast.weather.gov/data/obhistory/

Line 339 of the driver. It doesn't work completely but I get the basic data I want.

1 Like

I have an updated version running without errors. I plan on publishing it tomorrow.

1 Like

Version 1.1.0 has been published via HPM. Release notes are:
Simplified some of the calculations.
Accomodated a change in the URL used by the NWS for retrieving this data.
Fixed bug with totals when period spans across months.
Added a CheckWateringThreshold so it could be called externally if desired.

2 Likes

There used to be a precip24hr attribute, that doesn't seem to exist now.

Maybe this is something that changed in the data being provided in the API. The attribute disappeared after I manually changed the URL. Although not initially, as I am pretty sure it was there when I checked it right after making the update. Sometime later when I checked my dashboard the tile that was supposed to show that attribute showed an error.

Never mind, did a clear all and refresh and it came back.

It wasn’t visible because the initial value was null. Once it was populated with data it became visible.

Version 1.1.1 has been published via HPM. Release notes are:
Minor update to add the "TemperatureMeasurement" capability to the driver and renamed the "Temperature" attribute to "temperature" which is required for it to be used as a temperature sensor.

In short, the last reported temperature downloaded from the NWS can be accessed as a Hubitat temperature sensor. This was a user request which makes good sense.

3 Likes

I set this up to use with sprinkler timer written by @csteele.

My questions is I am seeing 2 water attributes. Is this correct or do I have a faulty install? If it is correct, which do I choose for wet/dry?

1 Like

Two water attributes is an item I asked Gary to look into a few weeks back but he's been away for a bit. He told me he'd look at it when he got back.

I believe it's just cosmetic, either water attribute will work.

2 Likes

Thanks!

Just installing your App now.

I found this a little confusing.

I expected to see an interface where I could configure things.

I'm sure there is a good reason but a little extra info on that page would not go amiss.

Sorry, this was supposed to be a DM.

you gotta do what it says first :smiley: :smiley:

click the DONE button

lengthy answer:

Child apps don't get saved til the Done button is clicked. So without this step, if you got into the child and started setting up a lot of timelines, etc. and clicked Back or closed the browser tab, it would be lost and I'd get that flood of messages :smiley: This method, which I first saw used in HubConnect back in 2019, means the child is at least created and saved, empty but ready to be configured.

1 Like

Here is the deal:


You are getting a water variable for the capability "WaterSensor" and another one for the attribute "water".

I don't know about you but I have always declared both in my drivers and my guess is that others have as well. I wonder if there is a difference in the API in one of the recent updates.

chatGPT says you could de-dupe with this change to your code (not tested).
atts = outdoorRainDevice?.supportedAttributes
.collect { it?.toString()?.toLowerCase() } // Normalize case
.toSet() // Remove duplicates
.sort() // Sort in natural order

Probably best to assume other drivers will have this issue and add this workaround to your code.

I understand the WHY -- you have the same attribute defined twice. Groovy allows overloading but in this case, no overloading is done.

It looks like a flaw to my eyes for the case of someone else maintaining the code, I wouldn't do it intentionally. I've done a bunch of "the guy that maintained this is gone now, you should take this 7 year old code" this year and I'm not enjoying the gotchas that are not my own. :smiley:

I'll add the workaround because ChatGPT has led me astray only 38% of the time, so far. We're running neck and neck, although I do feel like I might eventually fall behind. :smiley:

2 Likes

I will remove the attributes, I'm just saying that I don't think I'm the only one guilty of doing this. Later on I remembered de-duping the attribute list in Tile Builder but not really digging into the WHY at that point.

BTW. I tried to setup a Zone last night but it will not work for me as it is currently defined. I use a bank of relays to activate the various zones, so they appear as switches rather than valves.

I have only ever had one "Smart Sprinkler System" in my life, the EtherRain Controller. Then I built the driver for it and chose Valve as the capability. So "valve" is firmly fixed in my head. :smiley:

The action is very switch-like... binary. On/off, open/closed.

Your sprinkler system is more DIY using relays? I understand that ALL sprinkler systems use relays to activate the valves, but that's hidden in my system in the sense that I'm telling it about the end result, not the intermediate result. Relay activates the valve, making "valve" the target.

Obviously I can revise Sprinkler Schedule to allow capability.switch but am still digesting the need and trying to visualize the how. :slight_smile:

I was originally going to use switches(relays) until I went above ground (and spigot valves) to bypass the condo association. So I can see the need for having access to the switch capability.

Can you allow the selection of switches and valves in the same selection menu? It's been a long time since I messed with groovy so can't remember if that is possible.

Response moved to:

1 Like

BUT, we really should cease hijacking Gary's topic. I'm going to move that over to my sprinkler topic.

2 Likes

Code updated to 1.1.2 to eliminate appearance of duplicate water and temperature attributes (harmless but annoying).
Available now via HPM.

1 Like