Hi,
since traveling to the eastern part of our globe, I would be interested if we could have a sensor/weather alert for tropical storms world wide, like we can have for the world wide quakes.
Think I couldn’t find it in the description of the available geo-location integrations or weather components, but might have missed it though. Some of the available services seem to be limited to specific areas?
geo_rss_events: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 450, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/geo_rss_events/sensor.py", line 151, in update
status, feed_entries = self._feed.update()
File "/usr/local/lib/python3.7/site-packages/georss_client/__init__.py", line 54, in update
status, data = self._fetch()
File "/usr/local/lib/python3.7/site-packages/georss_client/__init__.py", line 84, in _fetch
feed_data = parser.parse(response.text)
File "/usr/local/lib/python3.7/site-packages/georss_client/xml_parser/__init__.py", line 72, in parse
postprocessor=XmlParser.postprocessor)
File "/usr/local/lib/python3.7/site-packages/xmltodict.py", line 327, in parse
parser.Parse(xml_input, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 1
and don’t know it that means, the component is buggy, the url is incorrect (which it isnt…, or the data is malformed
I get the same error message which indicates that the incoming XML feed cannot be parsed. Just looking at the XML source I cannot see anything out of the ordinary, and the library I wrote for this integration does in principle support that XML format.
I will have to do a bit more testing, but for now this looks like a bug (or an unsupported format) in the integration. Please feel free to raise this as an issue on GitHub.
To be sure, I checked if the url would be live in Feedly, which it is…
this is btw a marvelous source for the integration, so might I suggest/hope that if you look closer, you could suggest a way how to use it best, and see if and what ‘events’ are to be monitored?
thanks @exxamalte for picking this up immediately.
would this be the place, since you’re at it now to ask you if you could make it possible to have the component track a device, and have it use the gps coordinates of that device. Would make it a great tool that way to have it follow the device and the weather disasters around the device.
If so, having the sensor use an entity_name_space option would enhance even further.
Alright, now that the bug has been fixed, let’s have a look at what else you are trying to achieve:
I understand your use-case, but unfortunately at this point in time HA is missing a bit of infrastructure to realise what you are proposing. An to be quite honest, I don’t think this would be easy to implement. Sorry.
Well, the sensor itself does support entity_namespace. But this integration only creates a single sensor, and each event is added as an attribute.
In hindsight, I have to admit that the geo_rss_events sensor probably has limited value, and that was one of the reasons to implement the geolocation platform.
Before I make any changes, can I ask you if otherwise the geo_rss_events integration provides enough value? As you know, we have been adding several geolocation integrations in the meantime, which work very differently, and I just want to make sure that we focus on extending/changing integrations that actually provide value to users.
As an alternative, I could think of adding the capability to define a long/lat template to the geolocation trigger? That would then work immediately for all geolocation integrations.
not really sure tbh, I haven’t used it otherwise, this seemed to be the only way for now to add those streams to HA, so I wanted to give it a try.
that really sounds very good to me, but given GeoJSON - Home Assistant I don’t think I really understand what you are saying about a trigger? Or is that built in the integration? If so, being able to set that in the config for geo_json_events would be even better possibly, although we’d have to have a json feed of course. Since I was so glad I had found the rss feed, which are more easily available in the net, probably both integrations will prove their value.
I guess both would take advantage of adding the templated lat/lon option !
Yes, that is correct. There is currently no generic integration that supports GeoRSS.
If there is a wider agreement that the GDACS feed is useful, I could look at implementing a geolocation integration for this feed.
The next step would then be to either implement a new trigger or extend the existing one that would work like this: Trigger whenever any geolocation entity with source “gdacs_feed” gets into vicinity of the device tracker.
o yes, that would be exactly what I was looking for, and have been for a while aamof, since I also need that for the quakes integration which I now have set to follow some fixed lat/lon of a certain device. And have it set to a rather large radius, to prevent having to change the integration all the time
so, that brings us back to the first part of your reply:
Given:
GDACS is a cooperation framework between the United Nations, the European Commission and disaster managers worldwide to improve alerts, information exchange and coordination in the first phase after major sudden-onset disasters
I would think that the world community has expressed their agreement already Seems to me this would need to be a main source for HA to import feed/news from with the geo_location integration
cool!
please let me know if and how I can help to test/develop the efforts, thanks so very much for this. Would be a true enhancement to these important sensors/intergrations
I constantly get notifications about drought in New Zealand, but no other notification gets served. Of course no lat long settings are in the feedreader config, bit checking the feed url, many other alerts are on…and much closer to my Home instance.
Would you know how to change the behavior of this integration?
First of all, the feedreader integration does not have any concept of distance to home and instead just treats all items in a feed the same way.
You set max_entries: 5 which basically means that it will only process the first 5 entries of the feed.
Once the update from the feed is successful, the integration filters items based on their published date (in the GDACS feed it will most likely look at the pubDate entry of each item). The integration compares that date with the last time it updated the feed and discards all entries that have note been updated. The timestamp is stored in your configuration folder in a file feedreader.pickle, i.e. you can delete this to get a fresh start with this integration.
Now, when you look at the GDACS homepage you can see a list of all current alerts where it says:
In bold: i) new events; ii) events where a significant worsening has been detected […]; iii) events where new information products are available
The NZ drought is currently bold, so I assume that this gets frequently updated, and thus probably a new published date, and that’s why it keeps producing notifications for you.