Setting up NWS since Dark sky is going away

It was a quick and dirty solution, could dump the overnight forecast into the main forcast as well prefixed with “Tonight…”

Wow - it’s amazing to see this thread has expanded. Sorry for not responding sooner. @MatthewFlamm what can I do to help make the integration better? Do I need to make a github issue?

Be safe out there!

I suppose we can keep it going here. Merging the detailed description makes sense, but what about the state itself, e.g. sunny vs snowy. This one simply cannot be combined and one or the other must be discarded.

I wondering why it needs to be merged at all. Would it be possible to just prevent the flipping until the next day? So 0 stays daytime and 1 stays nighttime and that gets replaced. 2 and 3 would always be tomorrow day and night, respectively, and so on. Wouldn’t that completely resolve the merging of the detailed and condition attributes?

Then the frontend display using weather card is no good.

I think I understand. Would it be possible to modify the name of the attributes to add day and night. So Day_Condition and Night_Condition. Day_Detailed_Description and Night_Detailed_Description?

We’d have to break it out into individual sensors like the Dark Sky integration, which I was planning to do eventually if someone else didn’t :stuck_out_tongue:

This I was planning to use myself as a stop gap till then.

My use case is very simple, I use the custom weather card with animated icons.
When using the 5 day forecast with NWS I get 2 Thu, 2 Fri and 1 Sat. (I understand why)
When using Darksky I get highs and lows for the next 5 days.
That’s all I want/need.

My little hack provides the 5 day forecast.

1 Like

Yes, I found it about half an hour ago! I am testing it out right now.
This is the first time I have used a custom component so I am taking it slow to learn and understand. Thank you

1 Like

This is the best part forward for sensors in my opinion, but the popular custom cards will have trouble using it unless you discard the night data.

Ideally someone can make a custom card for NWS data.

1 Like

Anyone still working on progress with this? I am starting to use NSW since DarkSky is going away.

Started pulling a "friendly forecast" that I display in a markdown card but that's as far as I've gotten. 
   friendly_forecast:
        friendly_name: 'Current Forecast'
        value_template: "{{ state_attr('weather.kilg_daynight', 'forecast')[0].detailed_description}}"

Are you asking how to get the forecast into a card? This is what I use for the markdown card:

 - type: markdown
   content: |-
     # Weather Forecast
     {% for s in state_attr('weather.home', 'forecast'\
)[:4] %}
     **{{strptime(s.datetime[:10], '%Y-%m-%d').strftim\
e('%A')}}** {% if not s.daytime %}**Night**{%  endif %}
     {{s.detailed_description}}
     {% endfor %}

2 Likes

I was looking at your solution again today as the new weather forecast card makes the NWS weather forecasts even worse to view using the default card on small screens. What happens when the first forecast is the nighttime forecast, i.e. there is no daytime forecast at all for that day?

Works great!!! Thanks for this.

Tinkering with this myself as I want to replace DarkSky. Visually I know what I’d like it to look like (duplicate the forecast icon line from the animated DarkSky card into an AM/PM stacked so if the first day is only a providing a night forecast, the AM for that day would be blank), now just trying to get there data wise.

Then it puts in: "Tonight, <insert forecast>" because it’s looking at the “isDaytime” bool.
I also use the custom weather-card rather than the built in card.

image

That is how it works when the first forecast is a day forecast, but my reading of the code is that at 10 PM, for example, you discard the night forecast with this check:

That is some hot weather for May 1st!

You have to discard it because the card would still display the current day w/o a daytime temp.
The cards are looking for a pair of temps in order to display them.

Only for Canadians :wink: