Weather Alert Changes since update

Running Home Assistant 0.84.6 in Docker, on a NUC with Ubuntu 18.04.

Upgraded to new version two days ago and have a problem with my weather alert, it is now missing the reason for the alert as in the following.
“The National Weather Service has issued a for your area. It expires at 9:00 PM on 12-24-2018.” Notice there is a blank space between a and for in the text.

- alias: Maricopa County NWS Notification Weather Alert
  trigger:
    platform: state
    entity_id: sensor.maricopa_nws_alert_count
  condition:
    condition: template
    value_template: '{{states.sensor.maricopa_nws_alert_count.state | int > 0}}'
  action:
    - service: notify.Home_Assistant
      data_template:
        title: Maricopa County Weather Alert
        message: "The National Weather Service has issued a {{ states.sensor.maricopa_nws_alert__event.state }} for your area. It expires at {{ as_timestamp(state_attr('sensor.maricopa_nws_alert_event', 'features')[0].properties.expires)| timestamp_custom('%-I:%M %p on %-m-%-d-%Y') }}."


- alias: East Valley NWS Notification Weather Alert
  trigger:
    platform: state
    entity_id: sensor.east_valley_nws_alert_count
  condition:
    condition: template
    value_template: '{{states.sensor.east_valley_nws_alert_count.state | int > 0}}'
  action:
    - service: notify.Home_Assistant
      data_template:
        title: Maricopa County Weather Alert
        message: "The National Weather Service has issued a {{ states.sensor.east_valley_nws_alert_alert_event.state }} for your area. It expires at {{ as_timestamp(state_attr('sensor.east_valley_nws_alert_event', 'features')[0].properties.expires)| timestamp_custom('%-I:%M %p on %-m-%-d-%Y') }}."

Weather card looks like this notice the Object in bottom right corner.
Screenshot%20from%202018-12-25%2007-51-07
Here is the code for the weather card

  - type: entities
    title: Weather Alerts
    show_header_toggle: false
    entities:
      - entity: sensor.maricopa_nws_alert_count
        name: Maricopa County Weather Alert Count
        icon: mdi:weather-lightning-rainy
      - entity: sensor.maricopa_nws_alert_event
        name: Maricopa County Weather Alert
        icon: mdi:cloud-alert
      - entity: sensor.east_valley_nws_alert_count
        name: East Valley Weather Alert Count
        icon: mdi:weather-lightning-rainy
      - entity: sensor.east_valley_nws_alert_event
        name: East Valley Weather Alert
        icon: mdi:cloud-alert    

Thanks for the help

It looks like you have an extra underscore in your template between “alert” & “event”.

the “[object Object]” is probably due to the fact that the attribute is longer than 255 characters. that confused me at first but everything seemed to work tho.

Thanks so much never noticed the “_” being doubled.
Any way to make the attribute smaller to work?
Thanks again

All of this is assuming you are using my set up for weather alerts. If you aren’t (but it looks really similar) then I’d have to get more specifics on what you are trying to do. but…

What do you mean “to work”?

The announcement doesn’t use the event sensor attribute. It uses the event sensor state. The attribute is only used in the pop up. You could also read it out in the announcement but from the above automations you aren’t using the attribute anywhere.

However, I don’t know if there is a way to shorten the attribute since it parses it directly from the NWS website.

Maybe it would be helpful to post your nws alert sensor code.

Please excuse my newness at this. Before we go further can you please tell me what is your setup for weather alerts. Where can I find it.

Someone sent me the code and if I am infringing I am sorry.

Thank you
Carlton

I searched your name and found the information. It does look exactly like that. This is probably the code I was given.

Let me review it and see what I have missed.

Carlton

Not infringing at all. That’s why I posted it in the forum. :smiley:

Let me know if you need any more help.

All right. I have reviewed your code and am slowly working through the echo integration. Small baby steps.

Now what I have noticed as seen in my two attachments, I believe that the object error is coming from the number of alerts. Notice one has 8 alerts and 8 objects, the other 4 alerts and 4 objects.
Many of the alerts have expired so why are the still showing in my code through lovelace?

I am new to lovelace and trying to understand it from the old system.
I am also sending my lovelace code.

Screenshot%20from%202018-12-28%2014-55-13 Screenshot%20from%202018-12-28%2014-55-43

  - title: Weather
    cards:
      - type: weather-forecast
        title: Weather
        entity: weather.yweather
      - type: entities
        title: Weather Alerts
        show_header_toggle: false
        entities:
          - entity: sensor.maricopa_cty_alert_count
            name: Maricopa County Weather Alert Count
            icon: mdi:weather-lightning-rainy
          - entity: sensor.maricopa_cty_alert_event
            name: Maricopa County Weather Alert
            icon: mdi:cloud-alert
          - entity: sensor.east_valley_alert_count
            name: East Valley Weather Alert Count
            icon: mdi:weather-lightning-rainy
          - entity: sensor.east_valley_alert_event
            name: East Valley Weather Alert
            icon: mdi:cloud-alert

It’s tons easier to just use the custom component that was build to get the alerts you’re looking for.

What are the sensors that you are using to get the alerts and the counts? Post the code for those, please.

And as @firstof9 stated there is an updated way to get the alerts using a custom_component that you can find the code for at the link above and to see how I ultimately implemented it into my weather alert code look towards the end of my thread where you found my original code. It does simplify a few things but if you used my original code that should work too. The custom_component just eases some of the code required since triggers and messaging report from a single sensor instead of two.

And as far as lovelace is concerned I don’t use it right now so I can’t help much there.

And for one last edit:

I’m not sure what you’re saying is a “error”.

is it that it lists the [objectObject] instead of the actual alert text?

Thanks for the reply. I am just leaving my house to work a 72 hour shift at my hotel.
I will get back to you after the first when I get off.

Again thank you for your patience.

Wow! I thought my 12 hour shifts were long! :anguished:

I use this in my lovelace UI config:

title: Weather
type: entities
show_header_toggle: false
entities:
  - script.weather_greeting
  - sensor.nws_alerts
  - sensor.nws_alert_title
  - sensor.dark_sky_nearest_storm_distance
  - sensor.dark_sky_wind_speed
  - sensor.dark_sky_cloud_coverage
  - sensor.allergy_index_today
  - sensor.cold__flu_forecasted_average
  - sensor.dark_sky_hourly_summary
  - sensor.dark_sky_daily_summary

Shows up like this:

Then I have @finity’s automations tweaked for sending alerts via my Google Homes, Pushbullet, and Discord.

I use this template sensor to get the title sensor:

   nws_alert_title:
      entity_id: sensor.nws_alerts
      value_template: '{{ state_attr("sensor.nws_alerts","title") }}'

I’m sure there’s an easier way via lovelace to get it without the extra sensor but this was easiest for me right now.