Would love to get a component or a appdaemon python file for your lib… someway of adding one or more feeds of CAP-streams. Maybe filtering them by distance from “home location” and using them in home-assistant
I’ve only got some really basic skills in python so I don’t even know where to start
For this to work, the CAP feed will need to define an area for each entry that specifies geo location coordinates. Not all CAP feeds that I’ve seen do that; in some cases it’s just a textual description of the affected area.
For the glue code that joins the CAP feed via @kelvinn’s capparselib library to Home Assistant, you could take a look at how I’ve done something similar for GeoRSS feeds.
Indeed, a lot of CAP feeds either just reference a geocode, or include a Point geometry.
I’ve stitched to two together when receiving the alerts, e.g. an alert comes from NOAA with geocode of 48299, then I look that up in a geocode list and associate a geometry with it. For Points I just add a buffer of a bit.
I basically did the entire side project just before having a kid, and then had to drop everything until she is mostly self sufficient. I’m just now getting time to focus on some of these things a little bit.
I think this is achievable using the rest platform, e.g.
I was thinking that a more general CAP parser in hass would be best since a lot of countries are using CAP protocol for their messages. For example here is the swedish version http://api.krisinformation.se/v1/capmessage
I am trying to set this up and is my very first time creating anything. I have read as many guides as I can find but I cant seem to get this correct. the configuration check keeps failing. I tried weather: which I get no error saving (the green check mark) but the check config says:
Platform not found: weather.rest
Platform not found: weather.rest.
Here is my config if someone can point out my error please?
# weather Alerts
weather:
First, you should get in the habit of posting your code correctly following the instructions in the blue box at the top of the page. It makes it possible to indentation errors.
But on to your problem…
The code above doesn’t go under the weather: platform, it goes under the sensor: platform. So it would be:
Duly noted and my apologies! I have made the change and now I get an error of
duplicated mapping key at line 106, column -775:
sensor:
Im pretty sure its a indent or formatting error and moved various line spacing back and forth. I am just learning this and imho not very bright or good with coding, but willing to learn. Any suggestions?
Thanks for helping btw!
Finally figured it out after taking a break and being really frustrated. I was adding a new section with sensor where I should have just put it under the existing sensor. Also formatting was the bigger issue. Being extremely new to this (and any type of programming) indentation is king!
Thanks for helping and providing this code.
Any idea what could be causing this error? I added the sensors to my sensors.yaml file,I created a nws_weather_alert.yaml file with the automation code from op and created the nws_popup_on_wx_alert.py
EDIT: Nevermind, I had some spacing wrong. It Validated!
Thanks
I really like this feature, came in handy over the weekend as we had wind gusts up to 50 MPH.
I have received 3 Pushover alerts yesterday that stated “unavailable” would there be a way to ignore and not send notifications if there is no data available?
One last question, is there a way to display this notification only in my Weather Tab?
Thanks
I’m actually about ready to post an update to this set up that solves the “unavailable” situation and the multiple notifications. I’m just trying to finalize a couple of tweaks on it.
As far as just having it pop up in one tab I’m not if that’s possible. And TBH, I don’t think that I would want that anyway since it kind of defeats the purpose of the notification if you aren’t on that tab when the notification comes in.
Thanks, will be looking forward to the update, although I haven’t received an “unavailable” message since.
My only reason to have it on a single tab is that I already receive the notification on my phone and also on my Apple Watch, so since I am aware of the alert, I would just then need to look under the “Weather” tab for the details.
Also, thanks for all your work so far and sharing with the community.