National Weather Service: Bad Gateway

I recently upgraded to 0.109.6 and had to change the integration from YAML to UI. Since that change I keep getting the following: Error requesting NWS forecast station [Redacted] data: 502, message=‘Bad Gateway’

Is the API down for anyone else?

Yes, it happens more often than I’d like.

Been flaky since I upgraded to the new built-in NWS integration, for a couple of days now.

This hides it until it works…

card:
  entity: weather.k74s_daynight
  name: ' Anacortes'
  type: 'custom:weather-card'
conditions:
  - entity: weather.k74s_daynight
    state_not: unavailable
type: conditional

It’s annoying, the API has been down for the last two days so I assumed I messed up something. I have some automations based on the current temperature so I just setup open weather map as a backup. And will start using this sensor:

      current_temp:
        value_template: "{% if is_state('weather.nws_hourly', 'unavailable') %}{{ states.weather.openweathermap.attributes.temperature }}{% else %}{{ states.weather.nws_hourly.attributes.temperature }}{% endif %}"
        friendly_name: 'Current Temperature'

OK, I’m sure I’m doing something stupid here, but I tried to expand upon your conditional to have it show NWS weather if it’s available, and Dark Sky when it is not:

      - type: custom:weather-card
        entity: weather.dark_sky
      - type: conditional
        conditions:
          - entity: weather.kgbg_daynight
            state_not: "unavailable"
        card:
          - type: custom:weather-card
            entity: weather.kgbg_daynight
      - type: conditional
        conditions:
          - entity: weather.kgbg_daynight
            state: "unavailable"
        card:
          - type: custom:weather-card
            entity: weather.dark_sky

The first entry for the plain weather card works fine as expected. The conditional following it, copied from you, works as expected; the NWS weather card does not display. But the second conditional gives me an error:

No card type configured.
- type: 'custom:weather-card'
  entity: weather.dark_sky

Any idea why?

custom:weather-card sounds like it might be something from a custom component? Try weather-forecast (I think that’s the only lovelace weather card). If that works it might be something with the custom card you have installed.

It is, but it’s what I’m using on my second conditioanl which does work. I tried changing it to weather-forecast but get the same:

No card type configured.
- type: weather-forecast
  entity: weather.kgbg_hourly

After more staring, it seems to be the state_not condition. If I change it to state it doesn’t complain. If I leave it as state_not and set it to “fog” ( the current condition,) it also doesn’t complain. It does complain if I set it to “sunny”, where the state_not should match. It’s weird.