Tide Times

I’m trying to change the datum to ‘LAT’
Any suggestions? I attempted…

# Tides (World Tides)
  • platform: worldtidesinfo
    api_key: #
    name: Tide
    latitude: #
    longitude: #
    datum: “LAT”

…but still shows me tides with minus values like “-0.9” so doesn’t seem to be working

According to the documentation, this option does not exist.

In the offical API website it does

https://www.worldtides.info/apidocs

It doesn’t seem to me in home assistant component though.

Hello,
I’m fairly new to HA and your code here has turned me on to the “scrape” platform and sensor. I modified the url to match my area (quebec/st-romuald#_tides) and it is working perfectly.
I have two questions that i hope you can help me with.

The required “select” variable generally makes sense to me, but your string (#brujula_mareas_texto_movil) (which works just fine) mystifies me. Can you breakdown what I am looking at here?

The other question is about the “scan_interval”. what is the unit of measure, seconds, minutes?

I am in no great hurry, at your leisure please, it is most appreciated, thank you, Bob.

P.S. Many moons ago I lived in Whistler and often when traveling back and forth to Vancouver, i would stop and walk through Lighthouse Park.

Spanish. Author of this site wrote in Spanish.
#compass_tides_text_mobile

That answers that. I suppose the #_tides can be removed from the resource url or at least is unnecessary, no?

Hi Bob, you are correct. When you look at the source HTML for the page it’s in Spanish. That just happens to be the tag where the tide value resides. #_tides is not needed, I just left it in case the website gets refactored in some way.

Scan interval is just to slow down bandwidth usage and site traffic a bit from the default 30 seconds to 120 seconds. From the HA documentation:

SCAN INTERVAL
Platforms that require polling will be polled in an interval specified by the main component. For example a light will check every 30 seconds for a changed state. It is possible to overwrite this scan interval for any platform that is being polled by specifying a scan_interval configuration key. In the example below we set up the your_lights platform but tell Home Assistant to poll the devices every 10 seconds instead of the default 30 seconds.

Example configuration.yaml entry to poll your_lights every 10 seconds.

light:

  • platform: your_lights
    scan_interval: 10

Hi imikerussell!
Great work but is there a reason why this couldnt be integrated into HA as a sensor?

@BarryHampants Did you use WillyWeather API in another project or for yourself for HA? I did a non-api scraper for Tasker on Android. I could port that to python as a tide sensor for HA if others are interested.

2 Likes

@jtitley - sorry, been caught up on other stuff for months. I am fairly sure I just used it for tasker to give me an alert when when wind, waves, tide and swell aligned but I can’t remember now.

hello and for worltides how do you make the template for the hight_tide_height and low_tide_height?

I code this
value_template: '{{ states.sensor.sensor_tide.attributes.low_tide_height }}'
but how to indicate information about unit ‘m’

Specify unit of measurement per the docs https://www.home-assistant.io/integrations/template/

Just getting into HA and trying to add this. Think it is correct but not pulling new tide info, when I run tideupdate.py still getting ‘Sandow’ (Default) even though I have changed URL. Anyone able to help?

Not sure if my location is correct as running HA in docker.

Also how do you change the sensor icons?

There are some built in components now https://www.home-assistant.io/integrations/#search/tide

1 Like

Hello,
I’ve made improvement in WorldTideInfo in order to add curve for tide.
Hope if it an help
https://community.home-assistant.io/t/world-tide-info-v2-api-graph/260063

Has anybody attempted to integrate tidetimes.org.uk into HomeAssistant. I don’t think this can work if you have the Hass OS installation as no way of installing python or packages ?

@degreecy I’ve updated the repo since then so that it can drop in to custom_components folder. It’s still very basic but better than before.

3 Likes

I loved this until it started not working (to many api calls, I even tried it again 1 week ago and its already done, is there anyway in the folders py code I can get it to just pulll once a morning?

hey @rianoc - i have put the tides folder into custom_components but stuck on how to get it to show on my dashboard? or show up as a sensor :grimacing:

edit: i had multiple sensors: headers within my config file so only the last one was being loaded :face_with_head_bandage: now i just get

- but guessing i need to wait until tomorrow for it to scrape?

Edit: I waited and it now working :tada:

and if anyone wants the card yaml configuration:

type: entities
entities:
  - entity: sensor.tides
    name: Upcoming Tide
    icon: mdi:surfing
  - type: attribute
    entity: sensor.tides
    name: Low Tide Time
    attribute: low_tide_time
    icon: mdi:wave
  - type: attribute
    entity: sensor.tides
    name: High Tide Time
    attribute: high_tide_time
    icon: mdi:waves
  - type: attribute
    entity: sensor.tides
    name: Low Tide 2 Time
    attribute: low_tide_2_time
    icon: mdi:wave
  - type: attribute
    entity: sensor.tides
    name: High Tide 2 Time
    attribute: high_tide_2_time
    icon: mdi:waves