Closed philbert2k closed 2 years ago
that was never a part of this custom integration.
It was a part of the older non-integration code that I used in the beginning.
it is still available by using a REST sensor to get the entire json structure of the alerts then pull whatever you want from it.
here is the REST sensor code example:
- platform: rest
resource: https://api.weather.gov/alerts/active?zone=<YOUR_ZONE_INFO>
name: NWS Alert Event
value_template: >
{% if value_json.features[0] is defined %}
{{ value_json['features'][0]['properties'].event }}
{% else %}
None
{% endif %}
json_attributes:
- features
headers:
User-Agent: Homeassistant
Accept: application/geo+json
scan_interval: 60
then use your code above to get the expiration data.
In the older version where there was two separate automations / sensors that would expose expiration field of the alert, example below. Is there any way to get it added back so it can be referenced in automations/templates.