GithubHelp home page GithubHelp logo

custom-components / weatheralerts Goto Github PK

View Code? Open in Web Editor NEW
120.0 23.0 15.0 262 KB

A sensor that gives you weather alerts from alerts.weather.gov.

License: MIT License

Python 100.00%
homeassistant home-assistant custom-components weatheralerts

weatheralerts's Introduction

An integration to get weather alerts from weather.gov

GitHub release (latest by date) GitHub hacs_badge

GitHub stars GitHub GitHub issues GitHub commits since latest release (by SemVer)

Breaking changes

v0.1.2

  • The YAML packages currently available for weatheralerts v0.1.2 are not compatible with prior versions of weatheralerts. Older YAML packages should still work with weatheralerts v0.1.2, however, the most recent YAML package files contain new features and fixes.

Installation Quickstart

This qickstart install guide assumes you are already familiar with custom component installation and with the Home Assistant YAML configuration. If you need more detailed step-by-step instructions, check the links at the bottom for detailed instructions. Troubleshooting information, weatheralerts YAML package information, and Lovelace UI examples are also included in the Links at the bottom.

Install the weatheralerts integration via HACS. After installing via HACS, don't restart Home Assistant yet. We will do that after completing the YAML platform configuration.

You will need to find your zone and county codes by looking for your state or marine zone at https://alerts.weather.gov/. Once you find your state or marine zone, click into the Zone List and County List links and find the Zone Code and County Code your county. All you need are just the first two letters (your state or marine zone abbreviation) and the last three digits (zone/county ID number) of your zone code and county code to put into the platform configuration. The zone and county ID numbers are not usually the same number, so be sure to look up both codes.

Once installed and you have your state (or marine zone) abbreviation and ID numbers, add the weatheralerts sensor platform to your configuration. If your state is Wisconsin and your county is Outagamie, then the state abbreviation is WI, the zone ID number is 038, and the county ID number is 087. For the ID numbers, remove any leading zeros and your YAML platform configuration would look something like this:

sensor:
  platform: weatheralerts
  state: WI
  zone: 38
  county: 87

Once your configuration is saved, restart Home Assistant.

That completes the integration (custom component) installation.

Check the Links below for more detailed instructions, troubleshooting, and for YAML package and Lovelace UI usage and examples.

Updating via HACS

Check the Breaking Changes section of this README to see if you need to manually update the YAML packages or make any changes to your custom YAML or Lovelace UI cards. Simply use the Update button for the weatheralerts integration within HACS if there are no breaking changes and then restart Home Assistant.

Links

Todo list

  • Add more documentation
  • Add config flow to allow UI-based configuration (eliminate yaml-based platform configuration)
  • Create alternative (possibly simpler) YAML package or move some template sensors into the integration
  • Add backup weather alert source for occasions when weather.gov json feed is experiencing an outage
  • Add Canadian weather alerts

weatheralerts's People

Contributors

fortepc avatar ikifar2012 avatar jlverhagen avatar ludeeus avatar ntilley905 avatar tomhoover avatar vulp35 avatar wrt54g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

weatheralerts's Issues

Huge number of errors in Home Assistant log when there are no active alerts for my area

Version of the custom_component

v0.1.2

Describe the bug
Huge number of errors in Home Assistant log when there are no active alerts for my area.
Just checking to make sure this is working properly. I have been getting alerts and this was the first instance I have seen in my area with no alerts. (First few days of having this installed, we had a air quality alerts). When this alert went away and our area had no alerts, the errors were produced in the log. Is there a way to supress these if this is not really a fixable situation?

Log

2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: list object has no element 0 when rendering '{% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[0] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[0].endsExpires) - as_timestamp(now()) > 0)) %}
on
{% else %}
off
{% endif %}'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('UndefinedError: list object has no element 0') while processing template 'Template("{% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[0] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[0].endsExpires) - as_timestamp(now()) > 0)) %}
on
{% else %}
off
{% endif %}")' for attribute '_attr_native_value' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].id }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].id }}
{% else %}
None
{% endif %}")' for attribute 'alert_id' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].event }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].event }}
{% else %}
None
{% endif %}")' for attribute 'alert_event' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].area }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].area }}
{% else %}
None
{% endif %}")' for attribute 'alert_area' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') }}
{% else %}
None
{% endif %}")' for attribute 'alert_NWSheadline' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].description }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].description }}
{% else %}
None
{% endif %}")' for attribute 'alert_description' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].messageType }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].messageType }}
{% else %}
None
{% endif %}")' for attribute 'alert_messageType' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].status }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].status }}
{% else %}
None
{% endif %}")' for attribute 'alert_status' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].category }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].category }}
{% else %}
None
{% endif %}")' for attribute 'alert_category' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].urgency }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].urgency }}
{% else %}
None
{% endif %}")' for attribute 'alert_urgency' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].severity }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].severity }}
{% else %}
None
{% endif %}")' for attribute 'alert_severity' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].certainty }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].certainty }}
{% else %}
None
{% endif %}")' for attribute 'alert_certainty' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].response }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].response }}
{% else %}
None
{% endif %}")' for attribute 'alert_response' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].instruction }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].instruction }}
{% else %}
None
{% endif %}")' for attribute 'alert_instruction' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].sent }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].sent }}
{% else %}
None
{% endif %}")' for attribute 'alert_sent' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].effective }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].effective }}
{% else %}
None
{% endif %}")' for attribute 'alert_effective' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].onset }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].onset }}
{% else %}
None
{% endif %}")' for attribute 'alert_onset' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].expires }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].expires }}
{% else %}
None
{% endif %}")' for attribute 'alert_expires' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].title }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].title }}
{% else %}
None
{% endif %}")' for attribute 'alert_title' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].title }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].title }}
{% else %}
None
{% endif %}")' for attribute 'display_title' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].zoneid }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].zoneid }}
{% else %}
None
{% endif %}")' for attribute 'alert_zoneid' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{% if states.sensor.weatheralerts.attributes.alerts[0].NWSheadline != "null" %}
{{ states.sensor.weatheralerts.attributes.alerts[0].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') }}<br>
{% endif %}
<br>{{ states.sensor.weatheralerts.attributes.alerts[0].description | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}</ul><br>
{% if states.sensor.weatheralerts.attributes.alerts[0].instruction != None %}
{{ states.sensor.weatheralerts.attributes.alerts[0].instruction | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}<br>
{% endif %}
<br>Where : {{ state_attr('sensor.weatheralerts', 'friendly_name') }}
<br>Effective: {{ states.sensor.weatheralerts.attributes.alerts[0].effective }}
{%- if states.sensor.weatheralerts.attributes.alerts[0].ends != None %}
<br>Ends: {{ states.sensor.weatheralerts.attributes.alerts[0].ends }}
{%- endif %}
<br>Expires: {{ states.sensor.weatheralerts.attributes.alerts[0].expires }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{% if states.sensor.weatheralerts.attributes.alerts[0].NWSheadline != "null" %}
{{ states.sensor.weatheralerts.attributes.alerts[0].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') }}<br>
{% endif %}
<br>{{ states.sensor.weatheralerts.attributes.alerts[0].description | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}</ul><br>
{% if states.sensor.weatheralerts.attributes.alerts[0].instruction != None %}
{{ states.sensor.weatheralerts.attributes.alerts[0].instruction | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}<br>
{% endif %}
<br>Where : {{ state_attr('sensor.weatheralerts', 'friendly_name') }}
<br>Effective: {{ states.sensor.weatheralerts.attributes.alerts[0].effective }}
{%- if states.sensor.weatheralerts.attributes.alerts[0].ends != None %}
<br>Ends: {{ states.sensor.weatheralerts.attributes.alerts[0].ends }}
{%- endif %}
<br>Expires: {{ states.sensor.weatheralerts.attributes.alerts[0].expires }}
{% else %}
None
{% endif %}")' for attribute 'display_message' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
Attention!!! Weather alert for {{ state_attr('sensor.weatheralerts', 'friendly_name') }}. A {{ states.sensor.weatheralerts.attributes.alerts[0].title }}. {{ states.sensor.weatheralerts.attributes.alerts[0].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') | capitalize }}.
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
Attention!!! Weather alert for {{ state_attr('sensor.weatheralerts', 'friendly_name') }}. A {{ states.sensor.weatheralerts.attributes.alerts[0].title }}. {{ states.sensor.weatheralerts.attributes.alerts[0].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') | capitalize }}.
{% else %}
None
{% endif %}")' for attribute 'spoken_title' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].description | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}
{% if states.sensor.weatheralerts.attributes.alerts[0].instruction != None %}
{{ states.sensor.weatheralerts.attributes.alerts[0].instruction | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}
{% endif %}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 0 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_1') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[0].description | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}
{% if states.sensor.weatheralerts.attributes.alerts[0].instruction != None %}
{{ states.sensor.weatheralerts.attributes.alerts[0].instruction | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}
{% endif %}
{% else %}
None
{% endif %}")' for attribute 'spoken_message' in entity 'sensor.weatheralerts_alert_1'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: list object has no element 1 when rendering '{% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[1] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[1].endsExpires) - as_timestamp(now()) > 0)) %}
on
{% else %}
off
{% endif %}'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('UndefinedError: list object has no element 1') while processing template 'Template("{% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[1] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[1].endsExpires) - as_timestamp(now()) > 0)) %}
on
{% else %}
off
{% endif %}")' for attribute '_attr_native_value' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].id }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].id }}
{% else %}
None
{% endif %}")' for attribute 'alert_id' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].event }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].event }}
{% else %}
None
{% endif %}")' for attribute 'alert_event' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].area }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].area }}
{% else %}
None
{% endif %}")' for attribute 'alert_area' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') }}
{% else %}
None
{% endif %}")' for attribute 'alert_NWSheadline' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].description }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].description }}
{% else %}
None
{% endif %}")' for attribute 'alert_description' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].messageType }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].messageType }}
{% else %}
None
{% endif %}")' for attribute 'alert_messageType' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].status }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].status }}
{% else %}
None
{% endif %}")' for attribute 'alert_status' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].category }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].category }}
{% else %}
None
{% endif %}")' for attribute 'alert_category' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].urgency }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].urgency }}
{% else %}
None
{% endif %}")' for attribute 'alert_urgency' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].severity }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].severity }}
{% else %}
None
{% endif %}")' for attribute 'alert_severity' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].certainty }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].certainty }}
{% else %}
None
{% endif %}")' for attribute 'alert_certainty' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].response }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].response }}
{% else %}
None
{% endif %}")' for attribute 'alert_response' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].instruction }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].instruction }}
{% else %}
None
{% endif %}")' for attribute 'alert_instruction' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].sent }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].sent }}
{% else %}
None
{% endif %}")' for attribute 'alert_sent' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].effective }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].effective }}
{% else %}
None
{% endif %}")' for attribute 'alert_effective' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].onset }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].onset }}
{% else %}
None
{% endif %}")' for attribute 'alert_onset' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].expires }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].expires }}
{% else %}
None
{% endif %}")' for attribute 'alert_expires' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].title }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].title }}
{% else %}
None
{% endif %}")' for attribute 'alert_title' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].title }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].title }}
{% else %}
None
{% endif %}")' for attribute 'display_title' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].zoneid }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].zoneid }}
{% else %}
None
{% endif %}")' for attribute 'alert_zoneid' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{% if states.sensor.weatheralerts.attributes.alerts[1].NWSheadline != "null" %}
{{ states.sensor.weatheralerts.attributes.alerts[1].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') }}<br>
{% endif %}
<br>{{ states.sensor.weatheralerts.attributes.alerts[1].description | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}</ul><br>
{% if states.sensor.weatheralerts.attributes.alerts[1].instruction != None %}
{{ states.sensor.weatheralerts.attributes.alerts[1].instruction | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}<br>
{% endif %}
<br>Where : {{ state_attr('sensor.weatheralerts', 'friendly_name') }}
<br>Effective: {{ states.sensor.weatheralerts.attributes.alerts[1].effective }}
{%- if states.sensor.weatheralerts.attributes.alerts[1].ends != None %}
<br>Ends: {{ states.sensor.weatheralerts.attributes.alerts[1].ends }}
{%- endif %}
<br>Expires: {{ states.sensor.weatheralerts.attributes.alerts[1].expires }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{% if states.sensor.weatheralerts.attributes.alerts[1].NWSheadline != "null" %}
{{ states.sensor.weatheralerts.attributes.alerts[1].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') }}<br>
{% endif %}
<br>{{ states.sensor.weatheralerts.attributes.alerts[1].description | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}</ul><br>
{% if states.sensor.weatheralerts.attributes.alerts[1].instruction != None %}
{{ states.sensor.weatheralerts.attributes.alerts[1].instruction | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}<br>
{% endif %}
<br>Where : {{ state_attr('sensor.weatheralerts', 'friendly_name') }}
<br>Effective: {{ states.sensor.weatheralerts.attributes.alerts[1].effective }}
{%- if states.sensor.weatheralerts.attributes.alerts[1].ends != None %}
<br>Ends: {{ states.sensor.weatheralerts.attributes.alerts[1].ends }}
{%- endif %}
<br>Expires: {{ states.sensor.weatheralerts.attributes.alerts[1].expires }}
{% else %}
None
{% endif %}")' for attribute 'display_message' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
Attention!!! Weather alert for {{ state_attr('sensor.weatheralerts', 'friendly_name') }}. A {{ states.sensor.weatheralerts.attributes.alerts[1].title }}. {{ states.sensor.weatheralerts.attributes.alerts[1].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') | capitalize }}.
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
Attention!!! Weather alert for {{ state_attr('sensor.weatheralerts', 'friendly_name') }}. A {{ states.sensor.weatheralerts.attributes.alerts[1].title }}. {{ states.sensor.weatheralerts.attributes.alerts[1].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') | capitalize }}.
{% else %}
None
{% endif %}")' for attribute 'spoken_title' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].description | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}
{% if states.sensor.weatheralerts.attributes.alerts[1].instruction != None %}
{{ states.sensor.weatheralerts.attributes.alerts[1].instruction | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}
{% endif %}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 1 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_2') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[1].description | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}
{% if states.sensor.weatheralerts.attributes.alerts[1].instruction != None %}
{{ states.sensor.weatheralerts.attributes.alerts[1].instruction | regex_replace('\n\n','<p>') | regex_replace('\n',' ') | regex_replace('\*','\n*') | regex_replace('<p>','\n\n') }}
{% endif %}
{% else %}
None
{% endif %}")' for attribute 'spoken_message' in entity 'sensor.weatheralerts_alert_2'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: list object has no element 2 when rendering '{% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[2] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[2].endsExpires) - as_timestamp(now()) > 0)) %}
on
{% else %}
off
{% endif %}'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('UndefinedError: list object has no element 2') while processing template 'Template("{% if (states('sensor.weatheralerts') != 'unavailable') and (state_attr('sensor.weatheralerts', 'alerts')[2] != null) or ((states('sensor.weatheralerts') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts', 'alerts')[2].endsExpires) - as_timestamp(now()) > 0)) %}
on
{% else %}
off
{% endif %}")' for attribute '_attr_native_value' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].id }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].id }}
{% else %}
None
{% endif %}")' for attribute 'alert_id' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].event }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].event }}
{% else %}
None
{% endif %}")' for attribute 'alert_event' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].area }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].area }}
{% else %}
None
{% endif %}")' for attribute 'alert_area' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].NWSheadline | regex_replace('\[\'','') | regex_replace('\'\]','') }}
{% else %}
None
{% endif %}")' for attribute 'alert_NWSheadline' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].description }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].description }}
{% else %}
None
{% endif %}")' for attribute 'alert_description' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].messageType }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].messageType }}
{% else %}
None
{% endif %}")' for attribute 'alert_messageType' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].status }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].status }}
{% else %}
None
{% endif %}")' for attribute 'alert_status' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].category }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].category }}
{% else %}
None
{% endif %}")' for attribute 'alert_category' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].urgency }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].urgency }}
{% else %}
None
{% endif %}")' for attribute 'alert_urgency' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].severity }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].severity }}
{% else %}
None
{% endif %}")' for attribute 'alert_severity' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].certainty }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].certainty }}
{% else %}
None
{% endif %}")' for attribute 'alert_certainty' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].response }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].response }}
{% else %}
None
{% endif %}")' for attribute 'alert_response' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].instruction }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].instruction }}
{% else %}
None
{% endif %}")' for attribute 'alert_instruction' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].sent }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].sent }}
{% else %}
None
{% endif %}")' for attribute 'alert_sent' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].effective }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].effective }}
{% else %}
None
{% endif %}")' for attribute 'alert_effective' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].onset }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].onset }}
{% else %}
None
{% endif %}")' for attribute 'alert_onset' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].expires }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].expires }}
{% else %}
None
{% endif %}")' for attribute 'alert_expires' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].title }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].title }}
{% else %}
None
{% endif %}")' for attribute 'alert_title' in entity 'sensor.weatheralerts_alert_3'
2022-06-23 12:54:06 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].title }}
{% else %}
None
{% endif %}' but no default was specified') while processing template 'Template("{% if states('sensor.weatheralerts')|int > 2 or (states('sensor.weatheralerts') == "unavailable" and states('sensor.weatheralerts_alert_3') == "on") %}
{{ states.sensor.weatheralerts.attributes.alerts[2].title }}
{% else %}

Error with new update. sameid: '021001'

2018-09-13 02:23:06 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform weatheralerts
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
return fut.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/sensor/weatheralerts.py", line 38, in setup_platform
add_devices([WeatherAlertsSensor(sameid)])
File "/home/homeassistant/.homeassistant/custom_components/sensor/weatheralerts.py", line 43, in init
self.update()
File "/home/homeassistant/.homeassistant/custom_components/sensor/weatheralerts.py", line 48, in update
self._published = nws.alerts[0].published
IndexError: list index out of range

Unknown to No Alerts

When there are no alerts detected it show say "No Alerts" vise "Unknown" which it shows now. Just an idea.

List of Categories, Severity Levels, Urgency Levels

Would it be possible for to post a list of the possible NOAA categories, severity levels, and urgency levels in the wiki if you have this info available (or can get it) so these values can be used in scripts/automations? I have searched high and low and can't seem to locate this information on the NOAA website.

This information would be very helpful to determine if an alert should be waking me up at 4am. The availability of this data what sets this sensor apart from the other NWS web based sensor. It would be nice to be able to take advantage of it.

summary attribute cut short

Version of the custom_component
d6a7ec3

Describe the bug
The summary attribute is always cut off. In order to get the full value I have to check online somewhere. The last time I looked, the summary was 320 characters long, a few days ago it was 361 characters long. Darksky component doesn't seem to have this problem, though it has other issues.

log
Nothing in logs.

Dependabot couldn't find a requirements.txt for this project

Dependabot couldn't find a requirements.txt for this project.

Dependabot requires a requirements.txt to evaluate your project's current Python dependencies. It had expected to find one at the path: /requirements.txt.

If this isn't a Python project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

Need help with sensor being unavalible

So i am not sure why my sensor is not working it constantly just says unavailable as a status. any ideas?
`# weather Alerts Haccs Pt 1
#url https://alerts.weather.gov/
sensor:

  • platform: weatheralerts
    state: IL
    zone: "013"
    county: "043"`

2022-08-29 10_55_49-Developer Tools – Home Assistant
i have a lot more code if needed just didnt wanna make it to long on my initial post.

Add additional alert properties

Is your feature request related to a problem? Please describe.
I would like additional properties exposed - effective, expires, and NWSheadline.

Describe the solution you'd like
I can submit a PR, but I'd like to know which option below you'd prefer.

Describe alternatives you've considered

  1. I can add these three properties to each of the alerts objects.
  2. The full properties object could be pushed to the alerts object.

They're both minor changes and I tested both without issues. I personally think option 2 would be better because it doesn't limit anything from the end-user, however it would be a breaking change - area would become areaDesc, and title would go away (from my limited testing the "generated" title seems to be the same as event).

Additional context
ends is None in my testing, but expires does have a datetime. NWSheadline is perfect for a broadcast message because it's a good concise description of the alert that won't get truncated.

Reported state when no alert

When there is no active alert sensor.weatheralerts state is reported as 'unknown'. Because of this I cannot test to see if the sensor is currently connected and active which I would like to do so I receive a notification the component has not connected for some reason.

Would it be possible to have the sensor report "None" when there are no active alerts instead of "unknown"? Seems like it would be a more intuitive value to report on the front end also.

image

Unable to decode JSON error

Version of the custom_component
add6019

Describe the bug
Error message in home-assistant.log

Log

2019-12-27 10:30:28 ERROR (MainThread) [custom_components.weatheralerts.sensor] 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url='https://api.weather.gov/alerts/active/zone/TXZ159
2019-12-27 10:38:20 ERROR (MainThread) [custom_components.weatheralerts.sensor]

Additional info:

  1. I found it odd the first error message didn't include a trailing ' after the url (there is one at the beginning of the url).
  2. The second error message contained no descriptive text.

I don't know if either of the above items have anything to do with the error, but I wanted to provide complete information.

Finally, right after I noticed the error in the log, the link above was returning:

{
    "type": "FeatureCollection",
    "features": [],
    "title": "current watches, warnings, and advisories for McLennan (TXZ159) TX",
    "updated": "2019-12-26T17:01:08+00:00"
}

sensor not showing in HA - No Error in Logs

Version of the cusom_component
Installed: 705c1d6

Describe the bug
I installed weatheralerts via HACS and added the config shown below to my sensor.yaml however after restarting HA there is no sensor showing within the states page that corresponds to this.

My understanding is I should see a sensor called sensor.010 as it defaults to the zone??

There are no errors showing in the log. I am seeing this in the log so I assume it is loading and working correctly -> "You are using a custom integration for weatheralerts which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant."

  • platform: weatheralerts
    state: NJ
    zone: 010

log
No errors are showing in log

Icon for red flag warning

Version of the custom_component

Describe the bug
The icon for Red Flag warning is missing the "hass:" part

Log

Add your logs here.

getting error after putting weatheralerts_1.yaml in packages folder

when checking configuration in HA before rebooting as last step in the install process, I get this error - Configuration invalid
extra keys not allowed @ data['weatheralerts_1']

I followed a great youtube video tutorial by SlackerLabs, and followed it to a T...

https://youtu.be/Tm4s4f0B6zw

I also checked the documentation to see if I could see any differences between your install instruction and SlackerLabs. no doubt, I failed to follow instructions somewhere, but not sure if this error is familiar to anyone. thanks

Detected integration that called async_timeout.timeout with loop keyword argument.

Version of the custom_component
v 0.1.4

Describe the bug
After upgrading HA to 2021.12.0, a log entry states: “Detected integration that called async_timeout.timeout with loop keyword argument. …”

Log

Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for weatheralerts using this method at custom_components/weatheralerts/sensor.py, line 88: async with async_timeout.timeout(20, loop=hass.loop):

Add your logs here.

Dependabot couldn't find a requirements.txt for this project

Dependabot couldn't find a requirements.txt for this project.

Dependabot requires a requirements.txt to evaluate your project's current Python dependencies. It had expected to find one at the path: /requirements.txt.

If this isn't a Python project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

Timeout errors

Version of the custom_component
1.2.4

Describe the bug
After a power outage everything is working except for weatheralerts. (It might be an API issue since nws_alerts is taking a long time to load as well.) It's throwing timeout errors when trying to load. However, when I go directly to https://api.weather.gov/alerts/active?zone=TXZ213,TXC201 the JSON comes right up in my browser. All other integrations are working fine. It might be an API issue since nws_alerts is taking a long time to load as well. Trying to track down if this is a hardware issue on my end.

Log

(Please let me know how to find the debug log if you need more information)

This error originated from a custom integration.

Logger: custom_components.weatheralerts.sensor
Source: custom_components/weatheralerts/sensor.py:118
Integration: weatheralerts (documentation)
First occurred: 18:01:13 (7 occurrences)
Last logged: 18:22:34

[TimeoutError]


input_text limited to 255 Characters so won't Hold Five alert IDs

Version, Current, V1.3?
(Note, I renamed entities to the 'motherlode' zone from 'weatheralerts'

** Bug **
Alert IDs are stored in an input_text helper. These are limited to 255 characters total, but the total concatenated string for five alerts is 349 Characters. For example:

urn:oid:2.49.0.1.840.0.f9a6097f6d0e41b9224fd529f005effa05ff9757.001.1 
urn:oid:2.49.0.1.840.0.c6397b712c111522feb786d9bab7d545aa86668d.001.1 
urn:oid:2.49.0.1.840.0.9e404887452349de9b387fa6efa8d1a6ada8541a.002.1 
urn:oid:2.49.0.1.840.0.7f73c6a9ede216c8f21fd80675b4ad8cfd435f81.001.1 
urn:oid:2.49.0.1.840.0.0ad126d6a7c5c2d956b8e75693617d4dbb0cf112.001.1

Log

Logger: homeassistant.components.input_text
Source: components/input_text/__init__.py:274
Integration: Input text ([documentation](https://www.home-assistant.io/integrations/input_text), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+input_text%22))
First occurred: 1:29:37 PM (2 occurrences)
Last logged: 1:29:47 PM
Invalid value: urn:oid:2.49.0.1.840.0.f9a6097f6d0e41b9224fd529f005effa05ff9757.001.1 urn:oid:2.49.0.1.840.0.c6397b712c111522feb786d9bab7d545aa86668d.001.1 urn:oid:2.49.0.1.840.0.9e404887452349de9b387fa6efa8d1a6ada8541a.002.1 urn:oid:2.49.0.1.840.0.7f73c6a9ede216c8f21fd80675b4ad8cfd435f81.001.1 urn:oid:2.49.0.1.840.0.0ad126d6a7c5c2d956b8e75693617d4dbb0cf112.001.1 (length range 0 - 255)

Input_text definition:

input_text:
  motherlode_triggered_ui_alert_ids:
    name: Motherlode Triggered Weather Alert IDs - UI
    icon: mdi:information-variant
    max: 255
    initial: None

Input_text action from automation:

      - service: input_text.set_value
        data: #data_template:
          entity_id: input_text.motherlode_triggered_ui_alert_ids
          value: "{{ state_attr('sensor.motherlode_alert_1', 'alert_id') }} {{ state_attr('sensor.motherlode_alert_2', 'alert_id') }} {{ state_attr('sensor.motherlode_alert_3', 'alert_id') }} {{ state_attr('sensor.motherlode_alert_4', 'alert_id') }} {{ state_attr('sensor.motherlode_alert_5', 'alert_id') }}"

Custom name support for sensor entities

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
I would like a way to supply the name for each sensor created. Currently they become "sensor.county". Depending on the name of the county that could be fairly generic. Ultimately I personally would like "sensor.weather_alerts_county", however others may want to name them other things, so the most flexible option would be for an optional argument to supply the name.

Describe alternatives you've considered
I'm considering modifying the code myself, but I'm not really a strong developer and thought it worth seeing if this might be something easy to do in the source rather than me doing a one time hack.

Additional context
Nothing specific.

Dependabot couldn't find a requirements.txt for this project

Dependabot couldn't find a requirements.txt for this project.

Dependabot requires a requirements.txt to evaluate your project's current Python dependencies. It had expected to find one at the path: /requirements.txt.

If this isn't a Python project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

Different icons for each alert type

Is your feature request related to a problem? Please describe.
Not a problem, an enhancement

Describe the solution you'd like
I have manually edited the weatheralerts_1.yaml file to provide distinct icons for the different alert types. Hope you'll be able to include these in the default code.

Under each of the alerts I replaced

icon_template: hass:alert-rhombus

with:

        icon_template: >-
          {% set mapper =  {
              '911 Telephone Outage Emergency' : 'hass:phone-alert',
              'Administrative Message' : 'hass:message-text',
              'Air Quality Alert' : 'hass:blur',
              'Air Stagnation Advisory' : 'hass:blur',
              'Arroyo And Small Stream Flood Advisory' : 'hass:water-alert',
              'Ashfall Advisory' : 'hass:cloud-alert',
              'Ashfall Warning' : 'hass:cloud-alert',
              'Avalanche Advisory' : 'hass:alert',
              'Avalanche Warning' : 'hass:alert',
              'Avalanche Watch' : 'hass:alert',
              'Beach Hazards Statement' : 'hass:beach',
              'Blizzard Warning' : 'hass:snowflake-alert',
              'Blizzard Watch' : 'hass:snowflake-alert',
              'Blowing Dust Advisory' : 'hass:blur',
              'Blowing Dust Warning' : 'hass:blur',
              'Brisk Wind Advisory' : 'hass:weather-windy',
              'Child Abduction Emergency' : 'hass:human-male-child',
              'Civil Danger Warning' : 'hass:image-filter-hdr',
              'Civil Emergency Message' : 'hass:image-filter-hdr',
              'Coastal Flood Advisory' : 'hass:waves',
              'Coastal Flood Statement' : 'hass:waves',
              'Coastal Flood Warning' : 'hass:waves',
              'Coastal Flood Watch' : 'hass:waves',
              'Dense Fog Advisory' : 'hass:weather-fog',
              'Dense Smoke Advisory' : 'hass:smoke',
              'Dust Advisory' : 'hass:blur',
              'Dust Storm Warning' : 'hass:blur',
              'Earthquake Warning' : 'hass:alert',
              'Evacuation - Immediate' : 'hass:exit-run',
              'Excessive Heat Warning' : 'hass:thermometer-plus',
              'Excessive Heat Watch' : 'hass:thermometer-plus',
              'Extreme Cold Warning' : 'hass:thermometer-minus',
              'Extreme Cold Watch' : 'hass:thermometer-minus',
              'Extreme Fire Danger' : 'hass:fire-alert',
              'Extreme Wind Warning' : 'hass:weather-windy',
              'Fire Warning' : 'hass:fire-alert',
              'Fire Weather Watch' : 'hass:fire-alert',
              'Flash Flood Statement' : 'hass:water-alert',
              'Flash Flood Warning' : 'hass:water-alert',
              'Flash Flood Watch' : 'hass:water-alert',
              'Flood Advisory' : 'hass:water-alert',
              'Flood Statement' : 'hass:water-alert',
              'Flood Warning' : 'hass:water-alert',
              'Flood Watch' : 'hass:water-alert',
              'Freeze Warning' : 'hass:thermometer-minus',
              'Freeze Watch' : 'hass:thermometer-minus',
              'Freezing Fog Advisory' : 'hass:snowflake-alert',
              'Freezing Rain Advisory' : 'hass:snowflake-alert',
              'Freezing Spray Advisory' : 'hass:snowflake-alert',
              'Frost Advisory' : 'hass:snowflake-alert',
              'Gale Warning' : 'hass:weather-windy',
              'Gale Watch' : 'hass:weather-windy',
              'Hard Freeze Warning' : 'hass:thermometer-minus',
              'Hard Freeze Watch' : 'hass:thermometer-minus',
              'Hazardous Materials Warning' : 'hass:radioactive',
              'Hazardous Seas Warning' : 'hass:sail-boat',
              'Hazardous Seas Watch' : 'hass:sail-boat',
              'Hazardous Weather Outlook' : 'hass:message-alert',
              'Heat Advisory' : 'hass:thermometer-plus',
              'Heavy Freezing Spray Warning' : 'hass:snowflake-alert',
              'Heavy Freezing Spray Watch' : 'hass:snowflake-alert',
              'High Surf Advisory' : 'hass:surfing',
              'High Surf Warning' : 'hass:surfing',
              'High Wind Warning' : 'hass:weather-windy',
              'High Wind Watch' : 'hass:weather-windy',
              'Hurricane Force Wind Warning' : 'hass:weather-hurricane',
              'Hurricane Force Wind Watch' : 'hass:weather-hurricane',
              'Hurricane Local Statement' : 'hass:weather-hurricane',
              'Hurricane Warning' : 'hass:weather-hurricane',
              'Hurricane Watch' : 'hass:weather-hurricane',
              'Hydrologic Advisory' : 'hass:message-text',
              'Hydrologic Outlook' : 'hass:message-text',
              'Ice Storm Warning' : 'hass:snowflake-alert',
              'Lake Effect Snow Advisory' : 'hass:snowflake-alert',
              'Lake Effect Snow Warning' : 'hass:snowflake-alert',
              'Lake Effect Snow Watch' : 'hass:snowflake-alert',
              'Lake Wind Advisory' : 'hass:weather-windy',
              'Lakeshore Flood Advisory' : 'hass:waves-arrow-up',
              'Lakeshore Flood Statement' : 'hass:waves-arrow-up',
              'Lakeshore Flood Warning' : 'hass:waves-arrow-up',
              'Lakeshore Flood Watch' : 'hass:waves-arrow-up',
              'Law Enforcement Warning' : 'hass:car-emergency',
              'Local Area Emergency' : 'hass:alert',
              'Low Water Advisory' : 'hass:wave',
              'Marine Weather Statement' : 'hass:sail-boat',
              'Nuclear Power Plant Warning' : 'hass:radioactive',
              'Radiological Hazard Warning' : 'hass:biohazard',
              'Red Flag Warning' : 'fire-alert',
              'Rip Current Statement' : 'hass:surfing',
              'Severe Thunderstorm Warning' : 'hass:weather-lightning',
              'Severe Thunderstorm Watch' : 'hass:weather-lightning',
              'Severe Weather Statement' : 'hass:message-text',
              'Shelter In Place Warning' : 'hass:account-box',
              'Short Term Forecast' : 'hass:message-text',
              'Small Craft Advisory' : 'hass:sail-boat',
              'Small Craft Advisory For Hazardous Seas' : 'hass:sail-boat',
              'Small Craft Advisory For Rough Bar' : 'hass:sail-boat',
              'Small Craft Advisory For Winds' : 'hass:sail-boat',
              'Small Stream Flood Advisory' : 'hass:water-alert',
              'Snow Squall Warning' : 'hass:snowflake-alert',
              'Special Marine Warning' : 'hass:sail-boat',
              'Special Weather Statement' : 'hass:message-alert',
              'Storm Surge Warning' : 'hass:waves-arrow-up',
              'Storm Surge Watch' : 'hass:waves-arrow-up',
              'Storm Warning' : 'hass:weather-lightning',
              'Storm Watch' : 'hass:weather-lightning',
              'Test' : 'hass:message-text',
              'Tornado Warning' : 'hass:weather-tornado',
              'Tornado Watch' : 'hass:weather-tornado',
              'Tropical Depression Local Statement' : 'hass:weather-hurricane',
              'Tropical Storm Local Statement' : 'hass:weather-hurricane',
              'Tropical Storm Warning' : 'hass:weather-hurricane',
              'Tropical Storm Watch' : 'hass:weather-hurricane',
              'Tsunami Advisory' : 'hass:waves-arrow-up',
              'Tsunami Warning' : 'hass:waves-arrow-up',
              'Tsunami Watch' : 'hass:waves-arrow-up',
              'Typhoon Local Statement' : 'hass:weather-hurricane',
              'Typhoon Warning' : 'hass:weather-hurricane',
              'Typhoon Watch' : 'hass:weather-hurricane',
              'Urban And Small Stream Flood Advisory' : 'hass:home-flood',
              'Volcano Warning' : 'hass:image-filter-hdr',
              'Wind Advisory' : 'hass:weather-windy',
              'Wind Chill Advisory' : 'hass:thermometer-minus',
              'Wind Chill Warning' : 'hass:thermometer-minus',
              'Wind Chill Watch' : 'hass:thermometer-minus',
              'Winter Storm Warning' : 'hass:snowflake-alert',
              'Winter Storm Watch' : 'hass:snowflake-alert',
              'Winter Weather Advisory' : 'hass:snowflake-alert' } %}
          {% set state =  states['sensor.weatheralerts_1_alert_1'].attributes.alert_event %}
          {{ mapper[state] if state in mapper else 'hass:alert-rhombus' }}

repeating the same code in each alert block, substituting the alert number.

Describe alternatives you've considered
I'm sure there's a more elegant way to do this.

NULL values

Version of the custom_component
0.1.5

Describe the bug
null values are being generated for alert_NWSheadline and at the end of spoken_title variables. This is not occurring for all weather alerts. I'm not seeing anything immediate that would be causing the null value

Log
Nothing is being writing in the HA log files.

Attached are the api json file from https://api.weather.gov/alerts/active?zone=WIZ060,WIC089 and the HA generated sensor.weatheralerts_1_alert_# variables. The nulls are in the second alert file.

WIZ060_WIC089.json.txt
sensor.weatheralerts_1_alert_1.txt
sensor.weatheralerts_1_alert_2.txt

Not Receiving Weather Alert Notification

Version of the custom_component
Installed: 61049c6

Describe the bug
I currently have a production setup and a Dev setup running. My production setup is using this community add-on and my Dev setup is using the setup from here -> https://community.home-assistant.io/t/severe-weather-alerts-from-the-us-national-weather-service/71853

I believe both of these are capturing alerts from the the U.S. National Weather Service however this component doesn't seem to return any alerts. I did receive an alert from the other service in my Dev environment. I did not receive an alert from this component. This is what is showing for this sensor:

image

Here is what is showing for my Dev setup:
image

I was expecting to receive the same alert for this component. Maybe I have something setup incorrectly however I believe it is setup correctly but it never seems to return any alerts. I am not seeing any errors in the logs for this component so I am unable to provide that. Please advise if I have something incorrectly setup that would prevent me from receiving the alerts. I would like to use this component due to its simplicity and use through HACS.

This is my currently yaml setup:

- platform: weatheralerts
  state: NJ
  zone: 10

Log
Not seeing any errors int the logs


Error while setting up platform weatheralerts

Version of the cusom_component

weatheralerts.py - _version = '0.0.3'
HA 0.76.2

Describe the bug
Error while setting up platform weatheralerts:
File "/config/deps/lib/python3.6/site-packages/weatheralerts/geo.py", line 75, in _get_states_from_samecodes
state = self.samecodes[code]['state']
TypeError: 'NoneType' object is not subscriptable

sameid: '027053'

log

2018-08-29 04:13:27 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.weatheralerts
2018-08-29 04:13:27 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform weatheralerts
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/sensor/weatheralerts.py", line 38, in setup_platform
    add_devices([WeatherAlertsSensor(sameid)])
  File "/config/custom_components/sensor/weatheralerts.py", line 43, in __init__
    self.update()
  File "/config/custom_components/sensor/weatheralerts.py", line 47, in update
    nws = WeatherAlerts(samecodes=self._sameid)
  File "/config/deps/lib/python3.6/site-packages/weatheralerts/weather_alerts.py", line 43, in __init__
    self.scope = self.geo.getfeedscope(self.samecodes)
  File "/config/deps/lib/python3.6/site-packages/weatheralerts/geo.py", line 59, in getfeedscope
    states = self._get_states_from_samecodes(geocodes)
  File "/config/deps/lib/python3.6/site-packages/weatheralerts/geo.py", line 75, in _get_states_from_samecodes
    state = self.samecodes[code]['state']
TypeError: 'NoneType' object is not subscriptable

Error on Loading (looks like the old/closed bug that was not resolved)

Using newest version (downloaded 1/20/2019). It is in the proper folder, and this is not my first/only custom component.

Describe the bug
Fails to load. My config:

- platform: weatheralerts
  sameid: '029189'

log
Sun Jan 20 2019 20:40:51 GMT-0600 (Central Standard Time)

Error while setting up platform weatheralerts
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/sensor/weatheralerts.py", line 38, in setup_platform
add_devices([WeatherAlertsSensor(sameid)])
File "/config/custom_components/sensor/weatheralerts.py", line 43, in init
self.update()
File "/config/custom_components/sensor/weatheralerts.py", line 47, in update
nws = WeatherAlerts(samecodes=self._sameid)
File "/config/deps/lib/python3.6/site-packages/weatheralerts/weather_alerts.py", line 43, in init
self.scope = self.geo.getfeedscope(self.samecodes)
File "/config/deps/lib/python3.6/site-packages/weatheralerts/geo.py", line 59, in getfeedscope
states = self._get_states_from_samecodes(geocodes)
File "/config/deps/lib/python3.6/site-packages/weatheralerts/geo.py", line 75, in _get_states_from_samecodes
state = self.samecodes[code]['state']
TypeError: 'NoneType' object is not subscriptable

Alert being shown when there is none - Timeout error

Version of the custom_component
0.1.1

Describe the bug
An active alert is being shown while there is none. Looks like there is a timeout error after enabling debug logging.

Log

2020-04-20 08:16:08 ERROR (MainThread) [custom_components.weatheralerts.sensor] [TimeoutError] 
2020-04-20 08:16:08 WARNING (MainThread) [homeassistant.components.sensor] Platform weatheralerts not ready yet. Retrying in 30 seconds.
2020-04-20 08:16:12 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.weatheralerts_1_active_alerts fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/template/sensor.py", line 224, in async_update
    self._state = self._template.async_render()
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 221, in async_render
    return compiled.render(kwargs).strip()
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/local/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in top-level template code
TypeError: 'NoneType' object is not iterable

Errors - list object has no element 0

Version of the custom_component

v0.1.3

Describe the bug
Multiple errors in the log - list object has no element 0. This repeats for elements 0-4

Log

2020-12-08 07:45:47 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('UndefinedError: list object has no element 0') while processing template 'Template("{% if (states('sensor.weatheralerts_1') != 'unavailable') and (state_attr('sensor.weatheralerts_1', 'alerts')[0] != null) or ((states('sensor.weatheralerts_1') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_1', 'alerts')[0].endsExpires) - as_timestamp(now()) > 0)) %}
on
{% else %}
off
{% endif %}")' for attribute '_state' in entity 'sensor.weatheralerts_1_alert_1'

Ignore specific types of alerts

Is there a way to not receive any alerts of a particular type? For example, I live in an area with a red flag alert every day. A UI notification is not necessary for these alerts as they happen every day, so being able to prevent them from triggering would be of great benefit. Is this possible? Thanks.

Template Variable Error

Version of the custom_component

0.1.5

Describe the bug
Getting a template error in the logs. I am sure I am missing something stupid but can't figure it out. I even started from scratch but still get this filling up my logs. Appreciate any insight!

Log

Template variable error: 'None' has no attribute 'attributes' when rendering '{% set mapper = { '911 Telephone Outage Emergency' : 'hass:phone-alert', 'Administrative Message' : 'hass:message-text', 'Air Quality Alert' : 'hass:blur', 'Air Stagnation Advisory' : 'hass:blur', 'Arroyo And Small Stream Flood Advisory' : 'hass:water-alert', 'Ashfall Advisory' : 'hass:cloud-alert', 'Ashfall Warning' : 'hass:cloud-alert', 'Avalanche Advisory' : 'hass:alert', 'Avalanche Warning' : 'hass:alert', 'Avalanche Watch' : 'hass:alert', 'Beach Hazards Statement' : 'hass:beach', 'Blizzard Warning' : 'hass:snowflake-alert', 'Blizzard Watch' : 'hass:snowflake-alert', 'Blowing Dust Advisory' : 'hass:blur', 'Blowing Dust Warning' : 'hass:blur', 'Brisk Wind Advisory' : 'hass:weather-windy', 'Child Abduction Emergency' : 'hass:human-male-child', 'Civil Danger Warning' : 'hass:image-filter-hdr', 'Civil Emergency Message' : 'hass:image-filter-hdr', 'Coastal Flood Advisory' : 'hass:waves', 'Coastal Flood Statement' : 'hass:waves', 'Coastal Flood Warning' : 'hass:waves', 'Coastal Flood Watch' : 'hass:waves', 'Dense Fog Advisory' : 'hass:weather-fog', 'Dense Smoke Advisory' : 'hass:smoke', 'Dust Advisory' : 'hass:blur', 'Dust Storm Warning' : 'hass:blur', 'Earthquake Warning' : 'hass:alert', 'Evacuation - Immediate' : 'hass:exit-run', 'Excessive Heat Warning' : 'hass:thermometer-plus', 'Excessive Heat Watch' : 'hass:thermometer-plus', 'Extreme Cold Warning' : 'hass:thermometer-minus', 'Extreme Cold Watch' : 'hass:thermometer-minus', 'Extreme Fire Danger' : 'hass:fire-alert', 'Extreme Wind Warning' : 'hass:weather-windy', 'Fire Warning' : 'hass:fire-alert', 'Fire Weather Watch' : 'hass:fire-alert', 'Flash Flood Statement' : 'hass:water-alert', 'Flash Flood Warning' : 'hass:water-alert', 'Flash Flood Watch' : 'hass:water-alert', 'Flood Advisory' : 'hass:water-alert', 'Flood Statement' : 'hass:water-alert', 'Flood Warning' : 'hass:water-alert', 'Flood Watch' : 'hass:water-alert', 'Freeze Warning' : 'hass:thermometer-minus', 'Freeze Watch' : 'hass:thermometer-minus', 'Freezing Fog Advisory' : 'hass:snowflake-alert', 'Freezing Rain Advisory' : 'hass:snowflake-alert', 'Freezing Spray Advisory' : 'hass:snowflake-alert', 'Frost Advisory' : 'hass:snowflake-alert', 'Gale Warning' : 'hass:weather-windy', 'Gale Watch' : 'hass:weather-windy', 'Hard Freeze Warning' : 'hass:thermometer-minus', 'Hard Freeze Watch' : 'hass:thermometer-minus', 'Hazardous Materials Warning' : 'hass:radioactive', 'Hazardous Seas Warning' : 'hass:sail-boat', 'Hazardous Seas Watch' : 'hass:sail-boat', 'Hazardous Weather Outlook' : 'hass:message-alert', 'Heat Advisory' : 'hass:thermometer-plus', 'Heavy Freezing Spray Warning' : 'hass:snowflake-alert', 'Heavy Freezing Spray Watch' : 'hass:snowflake-alert', 'High Surf Advisory' : 'hass:surfing', 'High Surf Warning' : 'hass:surfing', 'High Wind Warning' : 'hass:weather-windy', 'High Wind Watch' : 'hass:weather-windy', 'Hurricane Force Wind Warning' : 'hass:weather-hurricane', 'Hurricane Force Wind Watch' : 'hass:weather-hurricane', 'Hurricane Local Statement' : 'hass:weather-hurricane', 'Hurricane Warning' : 'hass:weather-hurricane', 'Hurricane Watch' : 'hass:weather-hurricane', 'Hydrologic Advisory' : 'hass:message-text', 'Hydrologic Outlook' : 'hass:message-text', 'Ice Storm Warning' : 'hass:snowflake-alert', 'Lake Effect Snow Advisory' : 'hass:snowflake-alert', 'Lake Effect Snow Warning' : 'hass:snowflake-alert', 'Lake Effect Snow Watch' : 'hass:snowflake-alert', 'Lake Wind Advisory' : 'hass:weather-windy', 'Lakeshore Flood Advisory' : 'hass:waves-arrow-up', 'Lakeshore Flood Statement' : 'hass:waves-arrow-up', 'Lakeshore Flood Warning' : 'hass:waves-arrow-up', 'Lakeshore Flood Watch' : 'hass:waves-arrow-up', 'Law Enforcement Warning' : 'hass:car-emergency', 'Local Area Emergency' : 'hass:alert', 'Low Water Advisory' : 'hass:wave', 'Marine Weather Statement' : 'hass:sail-boat', 'Nuclear Power Plant Warning' : 'hass:radioactive', 'Radiological Hazard Warning' : 'hass:biohazard', 'Red Flag Warning' : 'fire-alert', 'Rip Current Statement' : 'hass:surfing', 'Severe Thunderstorm Warning' : 'hass:weather-lightning', 'Severe Thunderstorm Watch' : 'hass:weather-lightning', 'Severe Weather Statement' : 'hass:message-text', 'Shelter In Place Warning' : 'hass:account-box', 'Short Term Forecast' : 'hass:message-text', 'Small Craft Advisory' : 'hass:sail-boat', 'Small Craft Advisory For Hazardous Seas' : 'hass:sail-boat', 'Small Craft Advisory For Rough Bar' : 'hass:sail-boat', 'Small Craft Advisory For Winds' : 'hass:sail-boat', 'Small Stream Flood Advisory' : 'hass:water-alert', 'Snow Squall Warning' : 'hass:snowflake-alert', 'Special Marine Warning' : 'hass:sail-boat', 'Special Weather Statement' : 'hass:message-alert', 'Storm Surge Warning' : 'hass:waves-arrow-up', 'Storm Surge Watch' : 'hass:waves-arrow-up', 'Storm Warning' : 'hass:weather-lightning', 'Storm Watch' : 'hass:weather-lightning', 'Test' : 'hass:message-text', 'Tornado Warning' : 'hass:weather-tornado', 'Tornado Watch' : 'hass:weather-tornado', 'Tropical Depression Local Statement' : 'hass:weather-hurricane', 'Tropical Storm Local Statement' : 'hass:weather-hurricane', 'Tropical Storm Warning' : 'hass:weather-hurricane', 'Tropical Storm Watch' : 'hass:weather-hurricane', 'Tsunami Advisory' : 'hass:waves-arrow-up', 'Tsunami Warning' : 'hass:waves-arrow-up', 'Tsunami Watch' : 'hass:waves-arrow-up', 'Typhoon Local Statement' : 'hass:weather-hurricane', 'Typhoon Warning' : 'hass:weather-hurricane', 'Typhoon Watch' : 'hass:weather-hurricane', 'Urban And Small Stream Flood Advisory' : 'hass:home-flood', 'Volcano Warning' : 'hass:image-filter-hdr', 'Wind Advisory' : 'hass:weather-windy', 'Wind Chill Advisory' : 'hass:thermometer-minus', 'Wind Chill Warning' : 'hass:thermometer-minus', 'Wind Chill Watch' : 'hass:thermometer-minus', 'Winter Storm Warning' : 'hass:snowflake-alert', 'Winter Storm Watch' : 'hass:snowflake-alert', 'Winter Weather Advisory' : 'hass:snowflake-alert' } %} {% set state = states['sensor.weatheralerts_1_alert_1'].attributes.alert_event %} {{ mapper[state] if state in mapper else 'hass:alert-rhombus' }}'

Timeouts and not pulling data

Version of the custom_component
0.1.1 with scan interval set to 120

Version of Hass
109.6

Describe the bug
Inconsistent alerts or not pulling data

Log

2020-05-14 15:48:05 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for weatheralerts which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-05-14 15:48:07 CRITICAL (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] weatheralert download failure - HTTP status code 502
2020-05-14 15:48:26 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.weather_alerts fails
2020-05-14 15:50:18 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 15:50:18 ERROR (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] Could not update the sensor (TimeoutError)
2020-05-14 15:52:19 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 15:54:20 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 15:56:21 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 15:58:18 CRITICAL (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] weatheralert download failure - HTTP status code 502
2020-05-14 16:00:23 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:00:23 ERROR (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] Could not update the sensor (TimeoutError)
2020-05-14 16:02:14 CRITICAL (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] weatheralert download failure - HTTP status code 502
2020-05-14 16:03:20 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
2020-05-14 16:04:18 CRITICAL (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] weatheralert download failure - HTTP status code 502
2020-05-14 16:06:26 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:06:26 ERROR (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] Could not update the sensor (TimeoutError)
2020-05-14 16:06:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of weather.forecast is taking over 10 seconds
2020-05-14 16:08:27 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:10:28 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:12:29 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:14:30 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:16:31 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:18:32 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:20:23 CRITICAL (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] weatheralert download failure - HTTP status code 502
2020-05-14 16:22:34 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:22:34 ERROR (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] Could not update the sensor (TimeoutError)
2020-05-14 16:24:35 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:26:34 CRITICAL (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] weatheralert download failure - HTTP status code 502
2020-05-14 16:28:30 CRITICAL (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] weatheralert download failure - HTTP status code 502
2020-05-14 16:29:27 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.2418367824] Client unable to keep up with pending messages. Stayed over 512 for 5 seconds
2020-05-14 16:30:38 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:30:38 ERROR (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] Could not update the sensor (TimeoutError)
2020-05-14 16:32:39 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:34:36 CRITICAL (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] weatheralert download failure - HTTP status code 502
2020-05-14 16:36:41 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:36:41 ERROR (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] Could not update the sensor (TimeoutError)
2020-05-14 16:38:32 CRITICAL (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] weatheralert download failure - HTTP status code 502
2020-05-14 16:40:30 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal read error on socket transport
Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/selector_events.py", line 801, in _read_ready__data_received
    data = self._sock.recv(self.max_size)
TimeoutError: [Errno 110] Connection timed out
2020-05-14 16:40:43 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:40:43 ERROR (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] Could not update the sensor (TimeoutError)
2020-05-14 16:42:34 CRITICAL (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] weatheralert download failure - HTTP status code 500
2020-05-14 16:44:45 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:44:45 ERROR (MainThread) [custom_components.weatheralerts.sensor] [ILZ103,ILC031] Could not update the sensor (TimeoutError)
2020-05-14 16:46:46 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:48:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds
2020-05-14 16:50:48 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.northern_cook is taking over 10 seconds

Supporting information
image

error without further content

Version of the custom_component

Describe the bug
A clear and concise description of what the bug is.
Not sure, but the sensor is not created and an empty error is displayed in the log

config is:
HA Hassio, Rpi4 103.5

sensor:
# https://github.com/custom-components/weatheralerts
# New Orleans, Louisiana
  - platform: weatheralerts
    state: LA
    zone: 62

tried it with '062' also, same error

Log

Add your logs here.

Schermafbeelding 2020-01-02 om 11 35 47
Schermafbeelding 2020-01-02 om 11 35 53

Errors and warnings in log

Version
0.1.2

Describe the bug
I keep getting errors and warnings in my system log. I have two locations I’m monitoring. I downloaded the weather_alerts1.yaml and changed the name to the location I’m monitoring (Vilas.yaml) and did the same thing for the second location (Malta.yaml). I modified the sensor names in each file to corespondent to the weatheralerts sensor in HA (also renamed to the location) and get the errors below. I get them for both locations.

Log
Logger: homeassistant.helpers.template
Source: helpers/template.py:1791
First occurred: 8:01:00 AM (50 occurrences)
Last logged: 8:18:20 AM

Template variable error: list object has no element 0 when rendering '{% if (states('sensor.weatheralerts_malta') != 'unavailable') and (state_attr('sensor.weatheralerts_malta', 'alerts')[0] != null) or ((states('sensor.weatheralerts_malta') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_malta', 'alerts')[0].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}'
Template variable error: list object has no element 1 when rendering '{% if (states('sensor.weatheralerts_malta') != 'unavailable') and (state_attr('sensor.weatheralerts_malta', 'alerts')[1] != null) or ((states('sensor.weatheralerts_malta') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_malta', 'alerts')[1].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}'
Template variable error: list object has no element 3 when rendering '{% if (states('sensor.weatheralerts_malta') != 'unavailable') and (state_attr('sensor.weatheralerts_malta', 'alerts')[3] != null) or ((states('sensor.weatheralerts_malta') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_malta', 'alerts')[3].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}'
Template variable error: list object has no element 2 when rendering '{% if (states('sensor.weatheralerts_malta') != 'unavailable') and (state_attr('sensor.weatheralerts_malta', 'alerts')[2] != null) or ((states('sensor.weatheralerts_malta') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_malta', 'alerts')[2].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}'
Template variable error: list object has no element 4 when rendering '{% if (states('sensor.weatheralerts_malta') != 'unavailable') and (state_attr('sensor.weatheralerts_malta', 'alerts')[4] != null) or ((states('sensor.weatheralerts_malta') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_malta', 'alerts')[4].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}'


This error originated from a custom integration.

Logger: custom_components.weatheralerts.sensor
Source: custom_components/weatheralerts/sensor.py:228
Integration: weatheralerts
First occurred: 8:15:50 AM (10 occurrences)
Last logged: 8:17:50 AM

[WIZ005,WIC125] Still no update (ClientConnectorError)
[ILZ011,ILC037] Still no update (ClientConnectorError)


Logger: homeassistant.helpers.template
Source: helpers/template.py:1291
First occurred: 8:01:00 AM (888 occurrences)
Last logged: 8:15:20 AM

Template warning: 'int' got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts_malta')|int > 4 or (states('sensor.weatheralerts_malta') == "unavailable" and states('sensor.weatheralerts_malta_alert_5') == "on") %} {{ states.sensor.weatheralerts_malta.attributes.alerts[4].title }} {% else %} None {% endif %}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1
Template warning: 'int' got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts_malta')|int > 4 or (states('sensor.weatheralerts_malta') == "unavailable" and states('sensor.weatheralerts_malta_alert_5') == "on") %} {{ states.sensor.weatheralerts_malta.attributes.alerts[4].zoneid }} {% else %} None {% endif %}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1
Template warning: 'int' got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts_malta')|int > 4 or (states('sensor.weatheralerts_malta') == "unavailable" and states('sensor.weatheralerts_malta_alert_5') == "on") %} {% if states.sensor.weatheralerts_malta.attributes.alerts[4].NWSheadline != "null" %} {{ states.sensor.weatheralerts_malta.attributes.alerts[4].NWSheadline | regex_replace('['','') | regex_replace('']','') }}
{% endif %}
{{ states.sensor.weatheralerts_malta.attributes.alerts[4].description | regex_replace('\n\n','

') | regex_replace('\n',' ') | regex_replace('*','\n*') | regex_replace('

','\n\n') }}
{% if states.sensor.weatheralerts_malta.attributes.alerts[4].instruction != None %} {{ states.sensor.weatheralerts_malta.attributes.alerts[4].instruction | regex_replace('\n\n','

') | regex_replace('\n',' ') | regex_replace('*','\n*') | regex_replace('

','\n\n') }}
{% endif %}
Where : {{ state_attr('sensor.weatheralerts_malta', 'friendly_name') }}
Effective: {{ states.sensor.weatheralerts_malta.attributes.alerts[4].effective }} {%- if states.sensor.weatheralerts_malta.attributes.alerts[4].ends != None %}
Ends: {{ states.sensor.weatheralerts_malta.attributes.alerts[4].ends }} {%- endif %}
Expires: {{ states.sensor.weatheralerts_malta.attributes.alerts[4].expires }} {% else %} None {% endif %}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1
Template warning: 'int' got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts_malta')|int > 4 or (states('sensor.weatheralerts_malta') == "unavailable" and states('sensor.weatheralerts_malta_alert_5') == "on") %} Attention!!! Weather alert for {{ state_attr('sensor.weatheralerts_malta', 'friendly_name') }}. A {{ states.sensor.weatheralerts_malta.attributes.alerts[4].title }}. {{ states.sensor.weatheralerts_malta.attributes.alerts[4].NWSheadline | regex_replace('['','') | regex_replace('']','') | capitalize }}. {% else %} None {% endif %}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1
Template warning: 'int' got invalid input 'unavailable' when rendering template '{% if states('sensor.weatheralerts_malta')|int > 4 or (states('sensor.weatheralerts_malta') == "unavailable" and states('sensor.weatheralerts_malta_alert_5') == "on") %} {{ states.sensor.weatheralerts_malta.attributes.alerts[4].description | regex_replace('\n\n','

') | regex_replace('\n',' ') | regex_replace('*','\n*') | regex_replace('

','\n\n') }} {% if states.sensor.weatheralerts_malta.attributes.alerts[4].instruction != None %} {{ states.sensor.weatheralerts_malta.attributes.alerts[4].instruction | regex_replace('\n\n','

') | regex_replace('\n',' ') | regex_replace('*','\n*') | regex_replace('

','\n\n') }} {% endif %} {% else %} None {% endif %}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1


Logger: homeassistant.components.template.template_entity
Source: components/template/template_entity.py:140
Integration: Template
First occurred: 8:01:00 AM (20 occurrences)
Last logged: 8:15:20 AM

TemplateError('UndefinedError: list object has no element 0') while processing template 'Template("{% if (states('sensor.weatheralerts_malta') != 'unavailable') and (state_attr('sensor.weatheralerts_malta', 'alerts')[0] != null) or ((states('sensor.weatheralerts_malta') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_malta', 'alerts')[0].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")' for attribute '_attr_native_value' in entity 'sensor.weatheralerts_malta_alert_1'
TemplateError('UndefinedError: list object has no element 1') while processing template 'Template("{% if (states('sensor.weatheralerts_malta') != 'unavailable') and (state_attr('sensor.weatheralerts_malta', 'alerts')[1] != null) or ((states('sensor.weatheralerts_malta') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_malta', 'alerts')[1].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")' for attribute '_attr_native_value' in entity 'sensor.weatheralerts_malta_alert_2'
TemplateError('UndefinedError: list object has no element 2') while processing template 'Template("{% if (states('sensor.weatheralerts_malta') != 'unavailable') and (state_attr('sensor.weatheralerts_malta', 'alerts')[2] != null) or ((states('sensor.weatheralerts_malta') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_malta', 'alerts')[2].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")' for attribute '_attr_native_value' in entity 'sensor.weatheralerts_malta_alert_3'
TemplateError('UndefinedError: list object has no element 3') while processing template 'Template("{% if (states('sensor.weatheralerts_malta') != 'unavailable') and (state_attr('sensor.weatheralerts_malta', 'alerts')[3] != null) or ((states('sensor.weatheralerts_malta') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_malta', 'alerts')[3].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")' for attribute '_attr_native_value' in entity 'sensor.weatheralerts_malta_alert_4'
TemplateError('UndefinedError: list object has no element 4') while processing template 'Template("{% if (states('sensor.weatheralerts_malta') != 'unavailable') and (state_attr('sensor.weatheralerts_malta', 'alerts')[4] != null) or ((states('sensor.weatheralerts_malta') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_malta', 'alerts')[4].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")' for attribute '_attr_native_value' in entity 'sensor.weatheralerts_malta_alert_5'

enough values to unpack

Version of the cusom_component
d6a7ec3

Describe the bug
Flooding the log with ERRORS.

log
[custom_components.weatheralerts.sensor] not enough values to unpack (expected 3, got 1)

ERROR (MainThread) [custom_components.weatheralerts.sensor] list index out of range

Version of the cusom_component
Weatheralerts Version= "0.1.1"
HASSIO Version = "0.91.0"

Describe the bug
When there is no active alert the following error appears during startup and then repeats in the every 30 seconds. When there is an active alert the sensor behaves has expected with no errors in the log.

ERROR (MainThread) [custom_components.weatheralerts.sensor] list index out of range

log
Note: I have set the log for weather alerts to debug but do not get any more detail on this error.
weather log
Add your logs here.

Zone and County Issue

Version of the custom_component
version 0.1.4

Describe the bug
Getting warnings and errors when restarting and randomly.

Log
Latest logs.

Add your logs here.
```This error originated from a custom integration.

Logger: custom_components.weatheralerts.sensor
Source: custom_components/weatheralerts/sensor.py:145
Integration: weatheralerts (documentation)
First occurred: 9:31:37 AM (8 occurrences)
Last logged: 10:11:34 AM

[TXZ205,TXC325] Possible API outage. Currently unable to download from weather.gov - HTTP status code 502
[TXZ203,TXC463] Possible API outage. Currently unable to download from weather.gov - HTTP status code 502

Error1

Logger: homeassistant.components.template.template_entity
Source: components/template/template_entity.py:72
Integration: Template (documentation, issues)
First occurred: 9:31:35 AM (21 occurrences)
Last logged: 10:11:35 AM

TemplateError('UndefinedError: list object has no element 1') while processing template 'Template("{% if (states('sensor.weatheralerts_3') != 'unavailable') and (state_attr('sensor.weatheralerts_3', 'alerts')[1] != null) or ((states('sensor.weatheralerts_3') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_3', 'alerts')[1].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")' for attribute '_state' in entity 'sensor.weatheralerts_3_alert_2'
TemplateError('UndefinedError: list object has no element 3') while processing template 'Template("{% if (states('sensor.weatheralerts_3') != 'unavailable') and (state_attr('sensor.weatheralerts_3', 'alerts')[3] != null) or ((states('sensor.weatheralerts_3') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_3', 'alerts')[3].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")' for attribute '_state' in entity 'sensor.weatheralerts_3_alert_3'
TemplateError('UndefinedError: list object has no element 0') while processing template 'Template("{% if (states('sensor.weatheralerts_2') != 'unavailable') and (state_attr('sensor.weatheralerts_2', 'alerts')[0] != null) or ((states('sensor.weatheralerts_2') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_2', 'alerts')[0].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")' for attribute '_state' in entity 'sensor.weatheralerts_2_alert_1'
TemplateError('UndefinedError: list object has no element 1') while processing template 'Template("{% if (states('sensor.weatheralerts_2') != 'unavailable') and (state_attr('sensor.weatheralerts_2', 'alerts')[1] != null) or ((states('sensor.weatheralerts_2') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_2', 'alerts')[1].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")' for attribute '_state' in entity 'sensor.weatheralerts_2_alert_2'
TemplateError('UndefinedError: list object has no element 2') while processing template 'Template("{% if (states('sensor.weatheralerts_2') != 'unavailable') and (state_attr('sensor.weatheralerts_2', 'alerts')[2] != null) or ((states('sensor.weatheralerts_2') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_2', 'alerts')[2].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")' for attribute '_state' in entity 'sensor.weatheralerts_2_alert_3'

Error 2

Logger: homeassistant.helpers.template
Source: helpers/template.py:1378
First occurred: 9:31:31 AM (139 occurrences)
Last logged: 10:14:35 AM

Template variable error: list object has no element 1 when rendering '{% if (states('sensor.weatheralerts_3') != 'unavailable') and (state_attr('sensor.weatheralerts_3', 'alerts')[1] != null) or ((states('sensor.weatheralerts_3') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_3', 'alerts')[1].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}'
Template variable error: list object has no element 3 when rendering '{% if (states('sensor.weatheralerts_3') != 'unavailable') and (state_attr('sensor.weatheralerts_3', 'alerts')[3] != null) or ((states('sensor.weatheralerts_3') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_3', 'alerts')[3].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}'
Template variable error: list object has no element 0 when rendering '{% if (states('sensor.weatheralerts_2') != 'unavailable') and (state_attr('sensor.weatheralerts_2', 'alerts')[0] != null) or ((states('sensor.weatheralerts_2') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_2', 'alerts')[0].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}'
Template variable error: list object has no element 1 when rendering '{% if (states('sensor.weatheralerts_2') != 'unavailable') and (state_attr('sensor.weatheralerts_2', 'alerts')[1] != null) or ((states('sensor.weatheralerts_2') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_2', 'alerts')[1].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}'
Template variable error: list object has no element 2 when rendering '{% if (states('sensor.weatheralerts_2') != 'unavailable') and (state_attr('sensor.weatheralerts_2', 'alerts')[2] != null) or ((states('sensor.weatheralerts_2') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_2', 'alerts')[2].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}'

Warning 3

Logger: homeassistant.helpers.event
Source: helpers/template.py:391
First occurred: 9:31:35 AM (6 occurrences)
Last logged: 9:31:35 AM

Error while processing template: Template("{% if (states('sensor.weatheralerts_2') != 'unavailable') and (state_attr('sensor.weatheralerts_2', 'alerts')[1] != null) or ((states('sensor.weatheralerts_2') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_2', 'alerts')[1].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")
Error while processing template: Template("{% if (states('sensor.weatheralerts_2') != 'unavailable') and (state_attr('sensor.weatheralerts_2', 'alerts')[2] != null) or ((states('sensor.weatheralerts_2') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_2', 'alerts')[2].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")
Error while processing template: Template("{% if (states('sensor.weatheralerts_3') != 'unavailable') and (state_attr('sensor.weatheralerts_3', 'alerts')[0] != null) or ((states('sensor.weatheralerts_3') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_3', 'alerts')[0].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")
Error while processing template: Template("{% if (states('sensor.weatheralerts_3') != 'unavailable') and (state_attr('sensor.weatheralerts_3', 'alerts')[1] != null) or ((states('sensor.weatheralerts_3') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_3', 'alerts')[1].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")
Error while processing template: Template("{% if (states('sensor.weatheralerts_3') != 'unavailable') and (state_attr('sensor.weatheralerts_3', 'alerts')[3] != null) or ((states('sensor.weatheralerts_3') == 'unavailable') and (as_timestamp(state_attr('sensor.weatheralerts_3', 'alerts')[3].endsExpires) - as_timestamp(now()) > 0)) %} on {% else %} off {% endif %}")
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 389, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1359, in _render_with_context
    return template.render(**kwargs)
  File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1289, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 924, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/local/lib/python3.8/site-packages/jinja2/sandbox.py", line 326, in getattr
    value = getattr(obj, attribute)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1383, in _fail_with_undefined_error
    raise ex
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1375, in _fail_with_undefined_error
    return super()._fail_with_undefined_error(*args, **kwargs)
jinja2.exceptions.UndefinedError: None has no element 0

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 505, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 391, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: UndefinedError: None has no element 0

Warning 4

This error originated from a custom integration.

Logger: custom_components.weatheralerts.sensor
Source: custom_components/weatheralerts/sensor.py:118
Integration: weatheralerts (documentation)
First occurred: 9:31:33 AM (2 occurrences)
Last logged: 9:31:34 AM

[ContentTypeError] 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('https://api.weather.gov/alerts/active?zone=TXZ205')
[ContentTypeError] 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('https://api.weather.gov/alerts/active?zone=TXZ203')

Zones not correct

Version of the custom_component
705c1d6

Describe the bug
Not sure if nationally but the zones in Florida do not work correctly. 8 needs to be added to whatever number the map tells you the zone is in order for it to show correctly in HA. Example Orange County should be zone 045 but 053 needs to be entered for it to work correctly.

Notifications being repeated

Version of the custom_component
v0.1.0

Describe the bug
Sometimes multiple alerts are issued at the same time (with the same 'sent' time in the json feed) and the json feed will randomly swap the order of these alerts each time the feed is downloaded. For example, Alert A and Alert B issued with the same 'sent' date/time info. Sometimes the json feed will show Alert A first and Alert B second, sometimes it will show Alert B first and Alert A second. This can cause new notifications to be triggered each time the weather alerts feed is downloaded with the alert order changed (potentially every 30 seconds)...which can get quite annoying and cause high quota usage if pushing notifications through a service like Pushbullet.

I am testing a fix now and will commit the change within a few days if I don't see any abnormal behavior as a result of the change. In the meantime, if you are experiencing this issue, you should disable the automations that trigger the notifications temporarily until the offending alerts expire and then you can re-enable those automations.

Old Weather alerts wont clear on Lovelace

Version of the custom_component
v0.1.4

Describe the bug
Weather Alerts Active won't clear after weather event and continues to show old expired Alerts on Lovelace

Log
No Errors are being reported just the keeps showing old expired alerts and Weather alerts are active keeps showing "Yes"

No 'version' key in the manifest file for custom integration 'weatheralerts'

Version of the custom_component
1.3
Describe the bug
No 'version' key in the manifest file for custom integration 'weatheralerts'
Looks like there needs to be a version key added to the manifest file.
Log
Logger: homeassistant.loader
Source: loader.py:802
First occurred: March 4, 2021, 8:49:51 PM (2 occurrences)
Last logged: March 4, 2021, 8:49:52 PM

No 'version' key in the manifest file for custom integration 'weatheralerts'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'weatheralerts'

Only one alert showing up

The other day my county had multiple alerts at once (I believe we only got to two), a wind advisory and a tornado watch. However, the component only ever picked up the wind advisory (I assume because it was published first). Is this a limitation of the component or something that could potentially be fixed, or am I doing something wrong?

Config:

- platform: weatheralerts
  state: 'GA'
  zone: '033'

Adding a C on the end of the state?

Version of the custom_component
Newest version (just downloaded)

Describe the bug
For some reason it is adding a C at the end of the state

Log
CRITICAL (MainThread) [custom_components.weatheralerts.sensor] Compiled county ID 'FLC647' is not valid

Here is my config:

  • platform: weatheralerts
    state: FL
    zone: 9
    county: 647

"Entity Not Available"

I've checked the error log but I haven't seen anything related to this. I've already done the whole shebang (cleared cache, uninstalled/reinstalled component. etc). STill shows "not available."

I'm using the latest version of HACS and this component. Home Assistant ver. 103.5

list

# Todo list
- [x] Add more documentation
- [ ] Add config flow to allow UI-based configuration (eliminate yaml-based platform configuration)
- [ ] Create alternative (possibly simpler) YAML package or move some template sensors into the integration
- [ ] Add backup weather alert source for occasions when weather.gov json feed is experiencing an outage


This issue was generated by todo based on a Todo comment in d334c3a. It's been assigned to @jlverhagen because they committed the code.

list index out of range

Version of the cusom_component
9acd01b

Describe the bug
On startup HA log gives list index out of range.

log

Log Details (ERROR)
Wed Jul 24 2019 00:08:41 GMT-0400 (Eastern Daylight Time)
list index out of range

I have just installed this from HACS.
I did see that another user had this error and changed their sameid and got it working.
Could there be a problem where some sameid's do not work?

Here is the snip of my configuration.yaml:

sensor:

  # NWS NOAA Alerts
  - platform: weatheralerts
    sameid: '021209'

Thank you!
DeadEnd

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.