I have a weather alert sensor (https://github.com/custom-components/weatheralerts) which provide alert information from the NWS (National Weather Service) for the county where we live.
The sensor works like it should, but alerts are published in the sensor as an array.
Using Node-Red via the HA plugin (version: 6.1.4), I am trying to create a flow to output the individual alerts as notifications. First I'd like to have them as persistent notifications in HA, which I use the call service node to do that.
I can't seem to work out how to feed the call service node the correct syntax with the title and message needed for the notification.
This is the flow I have built so far. The alerts are an array, so I move them into the payload, then split that to output each individual alert.
A specific alert looks like:
area: "Oakland; Livingston; Midland; Lenawee; Huron; Bay; Tuscola; Monroe; Genesee; Saginaw; Sanilac; Wayne; Shiawassee; St. Clair; Lapeer; Washtenaw; Macomb"
certainty: "Likely"
description: "* WHAT...West winds 20 to 30 mph with gusts up to 50 mph↵expected.↵↵* WHERE...Portions of southeast Michigan.↵↵* WHEN...From 10 AM this morning to 8 PM EDT this evening.↵↵* IMPACTS...Damaging winds could blow down large tree limbs and↵power lines. Power outages are possible. Tents may be blown↵over. Travel could be difficult, especially for high profile↵vehicles."
ends: "2020-04-13T20:00:00-04:00"
event: "Wind Advisory"
instruction: "Use extra caution when driving, especially if operating a high↵profile vehicle. Secure outdoor objects."
response: "Execute"
sent: "2020-04-13T04:33:00-04:00"
severity: "Moderate"
title: "Wind Advisory issued April 13 at 4:33AM EDT until April 13 at 8:00PM EDT"
urgency: "Expected"
NWSheadline: array[1]
effective: "2020-04-13T04:33:00-04:00"
expires: "2020-04-13T16:00:00-04:00"
onset: "2020-04-13T10:00:00-04:00"
status: "Actual"
messageType: "Update"
category: "Met"
sender: "w-nws.webmaster@noaa.gov"
senderName: "NWS Detroit/Pontiac MI"
I don't necessarily need every component of this, but I am trying to output at least the description as the message for the HA persistent notification. What have I missed here to get this to work?