Tide Times

Certainly helps to keep things looking pro! :smiley:

Hoping to revive this stagnant thread.

What is latest result of this component / collection of sensors? Does anyone have a good API to use for collecting daily high/low tide info for USA locations?

Thanks in advance.

1 Like

Thanks for the revival @brahmafear :slight_smile:

It’s been working seamlessly for me since my last post but UK only so far.

I’d be keen to hear more about an API with global locations and accurate data. Getting the UK data alone has been a project as there is no API. My script grabs data from the Met Office website daily.

I still use this app on my iPhone which collects tide times globally - I’d love to know how it’s done!

1 Like

Since your last post this has become available https://home-assistant.io/components/weather.metoffice/ which makes use of the met office api (xml rather than json sadly)

Thanks all. I hacked together something using rest sensor component and the API available from aerisapi.com. Not perfect but good enough for now.

I have gone off the boil on this but my conclusion when I was actively looking at it was that the api at https://www.worldtides.info/ seemed to be useful.

Hi, are there any plans to get this built into HA?

I’ve built a custom sensor component for this now, using the worldtides.info API.

It queries worldtides.info every hour by default, and returns the following:

The state of the sensor defaults to the time of the next high tide, but you can easily query the attributes to retrieve the low tide change as well.

The component is added with the following:

sensor:
  - platform: worldtidesinfo
    api_key: "YOUR API KEY"
    latitude: "LATITUDE OF BEACH"
    longitude: "LONGITUDE OF BEACH"

Would be happy to share the component if there’s still interest in this.

2 Likes

Nice! Why not submit as a HASS component? Happy to help if needs be

The thought had crossed my mind :slight_smile:

This was a ‘teach yourself Python’ project though, so a bit of clean up work to do before I look at that. I had practically zero exposure to Python 3 days ago, and all scripting experience limited to PowerShell and some bash prior as well.

I’ve kept it relatively clean I think, but just need to ensure I’m not importing any modules that I’m not using anymore, can include any requirements in the component if there are any (don’t think there are). I tried various ways to accomplish things throughout the process and didn’t always clean up after myself as you can imagine!

Yes I too wrote a component to improve my python. Once it is working main tasks are to write the tests and clean up the code style wise. My repo is on https://github.com/robmarkcole/London-tube-status as may be useful guide to what I did. If you want any advice post your work to Github and I’d be happy to make comments :slight_smile:

Will do! Thanks a lot.

Hi,

I would be very interested in this component, so happy to help test if need be.

Thanks for all the hard work

I would also love to see this as a PR… in saying that… whens the plan for that to happen :wink: ?

Living close to the ocean, (10 min drive) I would love to get this information as well.

Been a bit slammed with work thIs week, but I still plan to do this. I have plans to change the component to make it a bit more practical, which I hope to get to this weekend. Once that’s done I’ll work through the process of getting the code up to HomeAssistants standards and then submit it. Hopefully I can do it all over the next two or three weeks - no idea on how long the process actually takes!

I’ve submitted this in PR8860 today.

The sensor looks like below now.

The state displays the upcoming tide - time in local time and whether it’s high or low - with attributes that show both the next high and low tide, tide heights, and time in UTC.

4 Likes

Bugger, there goes my python learning (although it has been on hold, so not surprising you beat me to it!)

2 Likes

Thanks guys this will be awesome.

Nice work! looks like this should be in the release this weekend!