I thought so. It works in the template test area, but not as a sensor. Any idea? I’m getting unknown for the value of my two sensor.
nws_alert_1:
value_template: >
{% if states.sensor.nws_alert_event.attributes.features[0] is defined %}
Headline 1
{{states.sensor.nws_alert_event.attributes.features[0].properties.headline }}
Details
{{states.sensor.nws_alert_event.attributes.features[0].properties.description }}
Instructions
{{states.sensor.nws_alert_event.attributes.features[0].properties.instruction }}
{% else %}
none
{% endif %}
entity_id: sensor.time
nws_alert_2:
value_template: >
{% if states.sensor.nws_alert_event.attributes.features[1] is defined %}
Headline 2
{{states.sensor.nws_alert_event.attributes.features[1].properties.headline }}
Details
{{states.sensor.nws_alert_event.attributes.features[1].properties.description }}
Instructions
{{states.sensor.nws_alert_event.attributes.features[1].properties.instruction }}
{% else %}
none
{% endif %}
entity_id: sensor.time
The current value of the sensor is
{
"features": [
{
"id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3844197-3282438",
"type": "Feature",
"geometry": null,
"properties": {
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3844197-3282438",
"@type": "wx:Alert",
"id": "NWS-IDP-PROD-3844197-3282438",
"areaDesc": "Maryland Beaches; Virginia Beach; Accomack; Northampton; Eastern Currituck",
"geocode": {
"UGC": [
"MDZ025",
"VAZ098",
"VAZ099",
"VAZ100",
"NCZ102"
],
"SAME": [
"024047",
"051810",
"051001",
"051131",
"037053"
]
},
"affectedZones": [
"https://api.weather.gov/zones/forecast/MDZ025",
"https://api.weather.gov/zones/forecast/VAZ098",
"https://api.weather.gov/zones/forecast/VAZ099",
"https://api.weather.gov/zones/forecast/VAZ100",
"https://api.weather.gov/zones/forecast/NCZ102"
],
"references": [
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843746-3282092",
"identifier": "NWS-IDP-PROD-3843746-3282092",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843746-3282093",
"identifier": "NWS-IDP-PROD-3843746-3282093",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843746-3282094",
"identifier": "NWS-IDP-PROD-3843746-3282094",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282080",
"identifier": "NWS-IDP-PROD-3843740-3282080",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282081",
"identifier": "NWS-IDP-PROD-3843740-3282081",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282082",
"identifier": "NWS-IDP-PROD-3843740-3282082",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282083",
"identifier": "NWS-IDP-PROD-3843740-3282083",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843305-3281815",
"identifier": "NWS-IDP-PROD-3843305-3281815",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843305-3281814",
"identifier": "NWS-IDP-PROD-3843305-3281814",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843305-3281816",
"identifier": "NWS-IDP-PROD-3843305-3281816",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3842142-3281012",
"identifier": "NWS-IDP-PROD-3842142-3281012",
"sender": "[email protected]",
"sent": "2019-09-29T15:19:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3842142-3281011",
"identifier": "NWS-IDP-PROD-3842142-3281011",
"sender": "[email protected]",
"sent": "2019-09-29T15:19:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843745-3282089",
"identifier": "NWS-IDP-PROD-3843745-3282089",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843745-3282090",
"identifier": "NWS-IDP-PROD-3843745-3282090",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843745-3282091",
"identifier": "NWS-IDP-PROD-3843745-3282091",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843306-3281817",
"identifier": "NWS-IDP-PROD-3843306-3281817",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843306-3281819",
"identifier": "NWS-IDP-PROD-3843306-3281819",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843306-3281818",
"identifier": "NWS-IDP-PROD-3843306-3281818",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843304-3281812",
"identifier": "NWS-IDP-PROD-3843304-3281812",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843304-3281813",
"identifier": "NWS-IDP-PROD-3843304-3281813",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843744-3282087",
"identifier": "NWS-IDP-PROD-3843744-3282087",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843744-3282088",
"identifier": "NWS-IDP-PROD-3843744-3282088",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
}
],
"sent": "2019-09-30T17:49:00-04:00",
"effective": "2019-09-30T17:49:00-04:00",
"onset": "2019-09-30T17:49:00-04:00",
"expires": "2019-10-01T02:00:00-04:00",
"ends": "2019-10-01T20:00:00-04:00",
"status": "Actual",
"messageType": "Update",
"category": "Met",
"severity": "Moderate",
"certainty": "Likely",
"urgency": "Expected",
"event": "Rip Current Statement",
"sender": "[email protected]",
"senderName": "NWS Wakefield VA",
"headline": "Rip Current Statement issued September 30 at 5:49PM EDT until October 1 at 8:00PM EDT by NWS Wakefield VA",
"description": "* LOCATION...Ocean side beaches of Maryland, Virginia, and\nCurrituck County North Carolina.\n\n* TIMING...Through Tuesday evening.\n\n* SURF OR RIP CURRENT RISK...There is a high risk of rip currents.\n3 to 4 ft breakers are expected along the surf.",
"instruction": "A Beach Hazards Statement is issued when threats such as rip\ncurrents...longshore currents...sneaker waves and other hazards\ncreate life-threatening conditions in the surf zone. Caution\nshould be used when in or near the water.\n\nThere is a high risk of rip currents.\n\nRip currents are powerful channels of water flowing quickly away\nfrom shore...which occur most often at low spots or breaks in the\nsandbar and in the vicinity of structures such as jetties and\npiers. Heed the advice of lifeguards...beach patrol flags and\nsigns.\n\nIf you become caught in a rip current...relax and float. Don't\nswim against the current. If able, swim in a direction following\nthe shoreline. If unable to escape, face the shore and call or\nwave for help.",
"response": "Avoid",
"parameters": {
"NWSheadline": [
"BEACH HAZARDS STATEMENT NOW IN EFFECT THROUGH TUESDAY EVENING... ...HIGH RIP CURRENT RISK NOW IN EFFECT THROUGH TUESDAY EVENING"
],
"VTEC": [
"/O.EXT.KAKQ.RP.S.0013.000000T0000Z-191002T0000Z/"
],
"PIL": [
"AKQCFWAKQ"
],
"BLOCKCHANNEL": [
"CMAS",
"EAS",
"NWEM"
],
"eventEndingTime": [
"2019-10-01T20:00:00-04:00"
]
}
}
},
{
"id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3844197-3282437",
"type": "Feature",
"geometry": null,
"properties": {
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3844197-3282437",
"@type": "wx:Alert",
"id": "NWS-IDP-PROD-3844197-3282437",
"areaDesc": "Maryland Beaches; Virginia Beach; Accomack; Northampton; Eastern Currituck",
"geocode": {
"UGC": [
"MDZ025",
"VAZ098",
"VAZ099",
"VAZ100",
"NCZ102"
],
"SAME": [
"024047",
"051810",
"051001",
"051131",
"037053"
]
},
"affectedZones": [
"https://api.weather.gov/zones/forecast/MDZ025",
"https://api.weather.gov/zones/forecast/VAZ098",
"https://api.weather.gov/zones/forecast/VAZ099",
"https://api.weather.gov/zones/forecast/VAZ100",
"https://api.weather.gov/zones/forecast/NCZ102"
],
"references": [
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843746-3282092",
"identifier": "NWS-IDP-PROD-3843746-3282092",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843746-3282093",
"identifier": "NWS-IDP-PROD-3843746-3282093",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843746-3282094",
"identifier": "NWS-IDP-PROD-3843746-3282094",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282080",
"identifier": "NWS-IDP-PROD-3843740-3282080",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282081",
"identifier": "NWS-IDP-PROD-3843740-3282081",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282082",
"identifier": "NWS-IDP-PROD-3843740-3282082",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282083",
"identifier": "NWS-IDP-PROD-3843740-3282083",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843305-3281815",
"identifier": "NWS-IDP-PROD-3843305-3281815",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843305-3281814",
"identifier": "NWS-IDP-PROD-3843305-3281814",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843305-3281816",
"identifier": "NWS-IDP-PROD-3843305-3281816",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3842142-3281012",
"identifier": "NWS-IDP-PROD-3842142-3281012",
"sender": "[email protected]",
"sent": "2019-09-29T15:19:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3842142-3281011",
"identifier": "NWS-IDP-PROD-3842142-3281011",
"sender": "[email protected]",
"sent": "2019-09-29T15:19:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843745-3282089",
"identifier": "NWS-IDP-PROD-3843745-3282089",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843745-3282090",
"identifier": "NWS-IDP-PROD-3843745-3282090",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843745-3282091",
"identifier": "NWS-IDP-PROD-3843745-3282091",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843306-3281817",
"identifier": "NWS-IDP-PROD-3843306-3281817",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843306-3281819",
"identifier": "NWS-IDP-PROD-3843306-3281819",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843306-3281818",
"identifier": "NWS-IDP-PROD-3843306-3281818",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843304-3281812",
"identifier": "NWS-IDP-PROD-3843304-3281812",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843304-3281813",
"identifier": "NWS-IDP-PROD-3843304-3281813",
"sender": "[email protected]",
"sent": "2019-09-30T05:18:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843744-3282087",
"identifier": "NWS-IDP-PROD-3843744-3282087",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
},
{
"@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843744-3282088",
"identifier": "NWS-IDP-PROD-3843744-3282088",
"sender": "[email protected]",
"sent": "2019-09-30T12:20:00-04:00"
}
],
"sent": "2019-09-30T17:49:00-04:00",
"effective": "2019-09-30T17:49:00-04:00",
"onset": "2019-09-30T17:49:00-04:00",
"expires": "2019-10-01T02:00:00-04:00",
"ends": "2019-10-01T20:00:00-04:00",
"status": "Actual",
"messageType": "Update",
"category": "Met",
"severity": "Moderate",
"certainty": "Likely",
"urgency": "Expected",
"event": "Beach Hazards Statement",
"sender": "[email protected]",
"senderName": "NWS Wakefield VA",
"headline": "Beach Hazards Statement issued September 30 at 5:49PM EDT until October 1 at 8:00PM EDT by NWS Wakefield VA",
"description": "* LOCATION...Ocean side beaches of Maryland, Virginia, and\nCurrituck County North Carolina.\n\n* TIMING...Through Tuesday evening.\n\n* SURF OR RIP CURRENT RISK...There is a high risk of rip currents.\n3 to 4 ft breakers are expected along the surf.",
"instruction": "A Beach Hazards Statement is issued when threats such as rip\ncurrents...longshore currents...sneaker waves and other hazards\ncreate life-threatening conditions in the surf zone. Caution\nshould be used when in or near the water.\n\nThere is a high risk of rip currents.\n\nRip currents are powerful channels of water flowing quickly away\nfrom shore...which occur most often at low spots or breaks in the\nsandbar and in the vicinity of structures such as jetties and\npiers. Heed the advice of lifeguards...beach patrol flags and\nsigns.\n\nIf you become caught in a rip current...relax and float. Don't\nswim against the current. If able, swim in a direction following\nthe shoreline. If unable to escape, face the shore and call or\nwave for help.",
"response": "Avoid",
"parameters": {
"NWSheadline": [
"BEACH HAZARDS STATEMENT NOW IN EFFECT THROUGH TUESDAY EVENING... ...HIGH RIP CURRENT RISK NOW IN EFFECT THROUGH TUESDAY EVENING"
],
"VTEC": [
"/O.EXT.KAKQ.BH.S.0013.000000T0000Z-191002T0000Z/"
],
"PIL": [
"AKQCFWAKQ"
],
"BLOCKCHANNEL": [
"CMAS",
"EAS",
"NWEM"
],
"eventEndingTime": [
"2019-10-01T20:00:00-04:00"
]
}
}
}
],
"friendly_name": "NWS Alert Event"
}