rianoc / tides Goto Github PK
View Code? Open in Web Editor NEWPulling tide information from an RSS feed for use with home assistant
Pulling tide information from an RSS feed for use with home assistant
Hi
Seems some locations in https://tidetimes.org.uk/ only offer one High (and Low I guess) tide per day. Not sure if this is caused by timing of the actual tide or an issue with their platform. Either way it throws an error in HA as below because the second High Tide cannot be read.
Location I've seen this happening for is https://tidetimes.org.uk/balbriggan-tide-times which seems to have either two Highs with no Lows or some other combination, but at all times only two times there?
I've circumvented by using another location and all seems OK so just throwing it out there in case you wanted to have a look.........
2021-12-17 02:35:48 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform tides
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 748, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 541, in _async_write_ha_state
extra_state_attributes = self.extra_state_attributes
File "/config/custom_components/tides/sensor.py", line 71, in extra_state_attributes
attr["high_tide_2_time"] = self.data[2][1]
IndexError: list index out of range
Here's the current RSS info for that location
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Balbriggan Tide Times</title>
<link>https://www.tidetimes.org.uk/balbriggan-tide-times</link>
<description>Balbriggan tide times.</description>
<lastBuildDate>Fri, 17 Dec 2021 00:00:00 GMT</lastBuildDate>
<language>en-gb</language>
<atom:link href="https://www.tidetimes.org.uk/balbriggan-tide-times.rss" rel="self" type="application/rss+xml"/>
<item>
<title>Balbriggan Tide Times for 17th December 2021</title>
<link>https://www.tidetimes.org.uk/balbriggan-tide-times</link>
<guid>https://www.tidetimes.org.uk/balbriggan-tide-times</guid>
<pubDate>Fri, 17 Dec 2021 00:00:00 GMT</pubDate>
<description><a href="https://www.tidetimes.org.uk" title="tide times">Tide Times</a> &amp; Heights for <a href="https://www.tidetimes.org.uk/balbriggan-tide-times" title="Balbriggan tide times">Balbriggan</a> on 17th December 2021<br/><br/>10:20 - High Tide (4.1m)<br/>22:31 - High Tide (3.99m)<br/></description>
</item>
</channel>
</rss>
This looks amazing and would love to have it implemented on my instance of HomeAssistant. However, would or could this work with Hassio (i.e. the self contained OS + Home Assistant Core) ? I don't think its possible to install "pip" ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.