I made an improved NOAA Tides sensor for my family's summer house

Thanks! I’ll wait and see if the author updates it. I don’t want to have yet another version floating around.

Also, I noticed that same string in three other places. I assume you’d change all of them, but maybe I’m misunderstanding.

You are understanding correctly. It is in line 116, 216, and 336. A ton of integrations still have this old call, including ones I made.

1 Like

HI All. I’ll update the code, but I am also receptive to Pull Requests in the future!

Here is the latest version with the fix

4 Likes

As a coder, I am thinking this suggestion would not be difficult. Scanning the code, I believe it would just be an arithmatic change for lines like 107 and 108. Here is the request:

My tide time differs from the nearest NOAA station because I am south of it a fair amount. Using willyweather.com, I can look up how much they had adjusted their predictions for my area. Would it be possible to add a variable to the sensor to adjust the tide measurement? I believe it would make it so that one could fine tune their tide schedule. I believe having a single number for the adjustment would be simple and yet be very helpful for people who want to hit the true high/low tide.

variables:
tide_adjust:-47

Example:
Source: Beverly Beach Tide Times, FL 32136 - WillyWeather
Capture

Thanks for making this and considering it!

Also, I have never investigated making a git repository HACS compliant. If I can find some time to research it, I will let you know. I believe that is all that is required to be able to add the repo into HACS and it should relate to just folder structure, I think.

You can always add a template sensor and make any adjustments you need to the tide times.

Just for completeness, be aware that the adjustment isn’t just one time offset. Often (as in the example above) there are different time offsets for the high and low. It’s even possible (although I haven’t checked this) that the higher high and lower high, for example, are different, if the tide is Mixed Semi-diurnal. So at a minimum you’d need two offsets for a location.

I agree with what Bill is saying- any transformations you want to apply can be done using the template sensor type.

I’m opposed to inserting that type of functionality directly into this project. The goal of this project is to simply map physical sensors operated by the NOAA to home-assistant sensors, not to create a fine-tunable tide chart for an arbitrary location. Actual tide prediction tied to a specific location that doesn’t have a buoy are incredibly complicated, and depend on the local geography of the seabed, the earth’s position and rotation around the sun, and the moon’s position and phase in relation to the earth. I’m disinclined to open that can of worms.

Fantastic work!

Is the current tide level supported? I’d love to create a binary sensor to tell me if the boat will fit under the bridge. Even better would be a sensor that told me how long I have to get to the bridge. This, is essentially just asking for the next time the tide will cross a threshold and if ebbing or flowing.

The current tide level is there. Look at the tide_factor attribute, which will give you a percentage between low (0%) and high (100%) tides. Combine that with the high_tide_level attribute and you’ll know the height of your high tide. The time is also there (next_tide_time if the next_tide_type is “High”) so you could write an automation to give you exactly what you want.

I just got this sensor working and I also created some template sensors to give you exactly what I have been looking for. Now I would like to pretty much reproduce the dashboard display that is given in the 1st post to this topic, and on the Github page, using the custom:mini-graph-card. Unfortunately, I’m having trouble. It looks like the custom:mini-graph-card may have changed rather significantly since the original topic and Github pag were created.

It looks like it is now unable to show non-numeric data. When I try to add the “Next tide” entity, on my card it shows “NaN”…which is obviously true. Same for “Last tide”, etc. Numeric data works fine, but I really wanted to nearly duplicate the look of the original post.

Is it still possible? If so, what am I missing?

This is mine:

  -
    entities:
      - entity: sensor.next_tide
      - entity: sensor.last_tide
    footer:
      entities:
        - sensor.water_level
      hours_to_show: 12
      icon: 'mdi:swim'
      line_color: darkblue
      lower_bound: 0
      points_per_hour: 60
      show:
        labels: false
      type: 'custom:mini-graph-card'
      upper_bound: 100
    title: Tides_Long Branch Pier
    type: entities

image

1 Like

Well then! I wonder what I’m doing wrong? I’ll try this soon…thanks!

Ok, figured it out!
So the Github page is a bit misleading. The custom:mini-graph-card is not the primary card that is used to configure this dashboard card. It is simply the “Entities” card. The Entities card will give you the title, the next tide and last tide rows (with icons) . And it will give you the graph as a footer.

The only thing the Entities card will NOT give you is the “Water level” title, the icon for that title and the actual value.

Here is my screenshot just using the Entities card:

If you change the footer type to custom:mini-graph-card, that then uses the mini-graph-card for the graph and you get the additional features.

3 Likes

Is it possible to show the height in feet?

Thanks for your terrific contribution, which is incredibly useful.

I am now receiving this log warning:

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:77
First occurred: 8:49:07 AM (1 occurrences)
Last logged: 8:49:07 AM

Detected integration that accesses the is_metric property of the unit system. This is deprecated and will stop working in Home Assistant 2023.1. Please adjust to use instance check instead… Please report issue to the custom integration author for noaa_tides using this method at custom_components/noaa_tides/sensor.py, line 63: elif hass.config.units.is_metric:

Thanks for reporting. I’ve released 0.1.5 which removes the deprecated call.

2 Likes

What card are you using? Mini Graph card or Entity Card? I copies your config and get several errors, all concerning the footer.

#########################################
Visual editor is not supported for this configuration:

  • The provided value for ‘footer.entities.0’ is not supported by the visual editor. We support (object) but received (“sensor.water_level”).
  • Key ‘footer.hours_to_show’ is not expected or not supported by the visual editor.
  • Key ‘footer.icon’ is not expected or not supported by the visual editor.
  • Key ‘footer.line_color’ is not expected or not supported by the visual editor.
  • Key ‘footer.lower_bound’ is not expected or not supported by the visual editor.
  • Key ‘footer.points_per_hour’ is not expected or not supported by the visual editor.
  • Key ‘footer.show’ is not expected or not supported by the visual editor.
  • Key ‘footer.upper_bound’ is not expected or not supported by the visual editor.
  • Key ‘footer.entities’ is not expected or not supported by the visual editor.
  • Key ‘footer.icon’ is not expected or not supported by the visual editor.
  • Key ‘footer.line_color’ is not expected or not supported by the visual editor.
  • Key ‘footer.lower_bound’ is not expected or not supported by the visual editor.
  • Key ‘footer.points_per_hour’ is not expected or not supported by the visual editor.
  • Key ‘footer.show’ is not expected or not supported by the visual editor.
  • Key ‘footer.upper_bound’ is not expected or not supported by the visual editor.
  • Key ‘footer.entities’ is not expected or not supported by the visual editor.
  • Key ‘footer.hours_to_show’ is not expected or not supported by the visual editor.
  • Key ‘footer.icon’ is not expected or not supported by the visual editor.
  • Key ‘footer.line_color’ is not expected or not supported by the visual editor.
  • Key ‘footer.lower_bound’ is not expected or not supported by the visual editor.
  • Key ‘footer.points_per_hour’ is not expected or not supported by the visual editor.
  • Key ‘footer.show’ is not expected or not supported by the visual editor.
  • Key ‘footer.upper_bound’ is not expected or not supported by the visual editor.

You can still edit your config in YAML.

This is my current config using the Mini Graph Card

type: entities
entities:
  - entity: sensor.next_tide
  - entity: sensor.last_tide
title: Steel Pier Tides
footer:
  entities:
    - sensor.water_level
  hours_to_show: 12
  icon: 'mdi:swim'
  line_color: darkblue
  lower_bound: 0
  points_per_hour: 60
  show:
    labels: false
  type: 'custom:mini-graph-card'
  upper_bound: 100 

I entered mine in yaml not with the visual editor. It is the same as I posted above and I believe the same as the author’s posted on github.