Setting up NWS since Dark sky is going away

Got it, thanks!

It looks like in order to get some of the other data that NWS provides (that the weather integration doesn’t support) like dewpoint, there would need to be changes to the pynws library to pull that information - the forecast has the information (based on their API page)

Can you share which forecast has this? Probably the raw grid forecast? The current integration uses the textual forecasts which presents the data in a format easily used in home assistant.

the gridpoint “raw” : /gridpoints/{wfo}/{x},{y}
My WFO is PBZ, and X and Y are the lat/long in integer format (for me 40,79) Been screwing around with it on https://www.weather.gov/documentation/services-web-api#/

I suck at programming, but my husband does it for a living and has said he’d help me figure it out. Willing to make a go at it - completely unsure how to integrate into HA, but I’m sure the code for the Darksky sensor could help me figure it out…

The raw forecast endpoint has a ton of data, as you can see, which makes it hard to decide what to add to home assistant. I’m hesitant to bring it to the built in integration. So in my opinion, this is best ingested as a rest sensor in home assistant and you can extract exactly what you want. You don’t even need to make your own custom component. Even though you say you suck at programming, maybe you won’t after you ignore me and make your custom component anyway :crazy_face:.

I’m working on refactoring pynws to be easier to extend. Right now it is a bit disorganized. You are welcome to contribute of course.

You could also consider asking the NWS to add dew point to the simpler forecast end point at /gridpoints/{wfo}/{x}/{y}/forecast. Then it would be dead simple to integrate in the existing code.

I should have added that this raw gridpoints end point has not yet been added to pynws, but I can add it after I refactor the library to make these things easier.

heh, I just had my husband walk me through how to download a copy in github to make changes (last I used version control SVN was “new”… so was Java…) I think I can add the endpoint pretty easily, it’s the what to do with it once I get it… But I had never considered a REST sensor - I’ve created a REST switch for something else, so I’m guessing it’s not that bad…

Hi! First, thanks to everyone working on HA. It’s great and very powerful but a lot to grok at first.

I found this thread trying to integrate NWS (in lieu of DarkSky) and hope to use the HACS custom animated weather card. Before I go too far down the rabbit hole, is this a (mostly) solved issue?

I have the latest Hassio running on RPi but the NWS integration doesn’t populate either the standard weather or the custom animated weather card in a way I can understand. Both cards are missing info and show data that makes no sense (current temp/daily highs & lows). I’ve tried both daynight and hourly entities.

The card pictured in firstof9’s post looks pretty good to me but I see no way to implement it with the current integration. Is there something easy that I’m missing?

Sorry if I missed something that should be intuitively obvious. Definitely a newbie that’s still trying to get his head around all of this. I have some experience with python programming but web stuff is still mostly a mystery to me. And YAML (especially formatting) is pretty darn obtuse. Just trying to implement MattewFlamm’s markdown card code in UI has been an exercise in frustration as the syntax is different within the Lovelace code editor:

can not read a block mapping entry; a multiline key may not be an implicit key at line 10, column 1: ^

Note: there is no line 10, so formatting/syntax is off even though I only only changed indentation level to account for the dash at the beginning that the editor doesn’t accept and changed the weather entity name.

I’ve been trying to avoid hard coded setup and use the UI (integrations, Lovelace, general setup, etc.) as much as possible. I’m wondering if this was a mistake and I should put most of it the YAML files.

TLDR: Newbie is struggling to drink from the firehose and hopes to implement the animated weather card shown but can’t work it out with the Lovelace interface and NWS integration. Help please? Thanks.

@firstof9 is using a custom version of NWS integration. It won’t work with the built in version as the forecast isn’t inherently a once a day forecast from NWS. It is twice a day and most frontend cards do not handle this case well. There is a PR to fix this on the built-in weather forecast card, but it seems to be stuck in purgatory.

Can you post the PR?

That PR is for the weather card not the integration.

My repo with the modified integration works with current versions of HA. I also put a modified custom weather card (credit to bramkragten) on github as well.

This is the result of my tinkering:
image

Nice card. It looks like it retains all of the functionality of the darksky card.

However, when I tried to install your custom ha-nws component I get an error in the log:

2020-09-13 16:21:19 ERROR (MainThread) [homeassistant.components.weather] The ha-nws platform for the weather integration does not support platform setup. Please remove it from your config.

i put the integration in as shown for the integration in post 15.

is that not the correct way to set it up?

Also how does that integration decide the location of your HA to get the correct weather data?

It looks to be fairly closely synced to the official integration, which no longer supports yaml configuration a la ADR-0010. You can only configure via UI. The default latlon had always been your home assistant location.

I tried that way too.

So, I installed the nws custom component

then going to the “integrations” section and doing a search for “nws” I get these choices:

ex

then selecting the first one “NWS” I get this:

ex1

I guessed at what needed to go into the first blank (location name?) but I’m not sure what goes into the last box. is that supposed to be the email address from the yaml configuration method?

but then when I filled in my integration location name and hit submit I got an entity called “weather.kfgw” or some such entity id. And there was no data. So something isn’t working.

EDIT:

I added my email to the bottom line and now I ghet two entities. One is weather.<my_email>_daynight and the other is weather.<my_email>_hourly. But both are “unavailable”.

So something still isn’t working.

First line is API key, which can be anything right now. Last line is an optional station.

Thanks for the reply. Re-reading this thread with a clearer head I think I get installation as a custom integration of ha-nws process. Fingers crossed…

Thanks for creating the exceptional.svg. That was always the missing piece for me with using ha-nws.

For some reason, however, the exceptional.svg is showing up too large (see below) when it’s the current icon. Any idea where within weather-card.js I can adjust that?

I also have a strange issue where the forecast will sometimes populate a couple days prior to the current date. I suppose that could be an API issue.

Yup that’s an API issue.

Ya I haven’t gotten around to resizing it yet. Maybe later today.

Thanks! Usually it’s a non-issue however, living in the Inland Northwest we’re under a fog of wildfire smoke for a few weeks every summer. Lately, everything’s been exceptional.