So i lost my Wunderground api that was giving me my weather alerts, i saw @finity post and @eracknaphobia using rest to get the alerts and was inspired by it to create my own custom sensor. It is using https://pypi.org/project/noaa-sdk/
eracknaphobia is directly interacting with the weather api via the component, i am just using the already built noaa-sdk to do all the heavy lifting for me to get basically the same information. It seems the noaa-sdk also has retrys built in if the first request failed. The noaa-sdk is pretty full featured and should be pretty easy for me to add in more config options such as filtering by urgency,serverity,type, or status(alert/update,cancelled). Also it seems the noaa-sdk is actively being maintained so if something changes on the weather.gov side i wouldn’t have to make changes to my sensor, just have to wait for noaa-sdk to be updated.
I also was reading https://developers.home-assistant.io/docs/en/creating_component_code_review.html and item #4 stuck out to me
I’ll keep watching here for updates and if i figure it gives at least the equivalent functionality as the other custom component I’ll gladly switch over.
I don’t think that’s a concern until/unless you decide you want to try to get your component integrated into HA. I’ve never tried but I’ve heard that is a pretty steep hill to climb so a lot of custom components stay that way.
I am curious if anyone has suggestions on how i should split up multiple alerts. I am pondering the idea of creating separate numbered attributes for multiple alerts. Then it would be sorted by severity.
Is this a good idea or a terrible one?
If there are 2 events, see second set of highlights. That’s what i have it doing now, it also sorts it by urgency and severity, so most urgent then most severe will be first.
I am trying to install under hassio .94 any guidance as per the sdk placement and install would be a help many thanks
also any thought about supporting multi zones
I was just trying this again and I also noticed the line talking about the noaa-sdk…Do we need to add this to HA too? Didn’t seem like it in the readme.
Also just to be clear we are copying and placing the folder “noaa_alerts” not “noaa_alerts-master” under /config/custom_components/ right?
Error I’m seeing
2019-06-06 17:05:49 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform noaa_alerts
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/noaa_alerts/sensor.py", line 50, in setup_platform
add_devices([noaa_alertsSensor(zoneid, event_urgency, event_severity, latitude, longitude)])
File "/config/custom_components/noaa_alerts/sensor.py", line 78, in __init__
self.update()
File "/usr/local/lib/python3.7/site-packages/homeassistant/util/__init__.py", line 224, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/noaa_alerts/sensor.py", line 81, in update
from noaa_sdk import noaa
ModuleNotFoundError: No module named 'noaa_sdk'