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

@bschatzow It looks like the station stopped supporting water temperature
https://api.tidesandcurrents.noaa.gov/api/prod/datagetter?begin_date=20200828&end_date=20200828&station=8531680&product=water_temperature&datum=MLLW&interval=hilo&units=english&time_zone=lst_ldt&application=py_noaa&format=json

because of the way the code is written, this causes an error that also breaks air temperature. I’ll release an update to restore air temperature, but the lack of water temperature is out of my hands

Edit: version 0.1.2 has the code and should restore air temperatures to your dashboard.
Edit 2: while I was testing I confirmed that the last water temperature measurement was on 2020-08-19

@johnnyc yes, eventually i’d like to look at station metadata and automatically pull in all the available data.

1 Like

Confirm that the change fixes it for me.

Water Temperature	E1	1	7.7 ft. above MLLW	 Disabled - Aug 19 2020 11:42PM, RESTART

I sent an email to the coop user services to see if the sensor can be restarted.
Just got a response from the email:
"
Your message has been forwarded to our Customer Services email address for response.

I believe that you are referring to the notice found on the Station Home Page for 8531680 Sandy Hook, NJ

This is a “standardized” automated message used without our 24-hour monitoring system.

The temperature sensor at 8531680 Sandy hook has malfunctioned.

Repairs and will require a field team from our office in Chesapeake, Virginia to visit the site in order to make repairs.

However, with travel restrictions due to COVID presently in place, we do not know when that will be.

I hope that this response has answered your questions. If not, please let me know.

Should you have additional questions, please contact our office.

Phone: (301) 713-2815

E-mail: [email protected]

Regards,

Todd Ehret

Oceanographer

User Services Team

NOAA’s Center for Operational Oceanographic Products and Services

Web: tidesandcurrents.noaa.gov"

Being a member of a “field team” for the NOAA sounds like just about the coolest job description I can imagine!

Whats up with this warning in my core logs?

"usr/local/lib/python3.8/site-packages/noaa_coops/noaa_coops.py:421: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead"

The underlying noaa_coops library uses a deprecated function in pandas. It’s safe to ignore.

1 Like

I see that entity_id: is now deprecated. The template examples use this. I believe it must be removed by .116.

I was setting up multiple buoys to query and I have three successful noaa_tides instances in my Home Assistant install now. I’m running into a problem with setting up a forth bouy in Hawaii. I’m located on the East Coast, and the first three bouys were all in the same timezone.

I’ve checked the noaa-coops calls myself, and the issue lies with calling a lst-ldt (or just lst) with ‘future time’ because it creates a request to the NOAA bouy for East Coast formatted time which hasn’t passed in Hawaii.

I’ve also seen that GMT time works fine. I tried setting my Home Assistant to use GMT, but no luck. I still see no data from the bouy.

Any thoughts on a fix?

Well after spending all too long trying to figure this out, read the source more closely and found the time_zone config field. Set that to gmt and I’m working.

Have you considered making the repo compatible with HACS so it could be added as a custom repo to HACS?

I’ve had one PR submitted to enable HACs, but I think the author abandoned it… I’m open to HACs but I don’t use it personally.

not sure i understand. If you forked noaa_tides why could you not make your project HACS compatible? The noaa_tides is part of HA so it does not need it. NOTE: I could be missing a detail here.

Basically, there’s no reason it can’t be HACS compatible, but since I do not use HACs, I don’t plan to make it HACS compatible. However, if someone else wants to contribute a PR to make it HACS compatible, I will approve it.

To bad, it look’s like it’s not working anymore under Home Assistant v.2021.6!
Can somebody confirm that?

Working for me. I only have 2021.5 I do not see .6 available.

Oh shut my fault, 2021.5 is right, then I will try again and come back in case of issues.
Thanks for answer.

OK, I tried the example Sensors and the Config Check brings out “invalid option for type”?
Are there changes for station type?

Hi @Automot, sorry to hear you’re having trouble configuring the sensor. Can you share your yaml configuration?

It’s just the basic sensor entry with another StationID:
No Templates right now, because Config Check fails.
sensor.yaml

  • platform: noaa_tides
    name: tides
    station_id: 8726917
    type: tides
    scan_interval: 360

Due I miss something here?
I have no problems with the basic Home Assistant NOAA Integration.

Edit:
Let me check my custom_components, maybe there is a problem, all other integrations are using HACS.

I solved the Problem, after adding the noaa_tides folder to custom_components I missed the Home Assistant restart. I added everything at once, witch cause a config validation fail, no time for Home Assistant to read in the component information.
So thanks to @jshufro and @bschatzow for the tide sensors. Is there a way to readout future tides for the next 24 Hours?
Thanks again for your work appreciated.

Right now it only supports the next tide, which is 0-6 hours or so.

This section of the sample config shows how to do it

        next_tide:
            friendly_name: "Next tide"
            entity_id: sensor.tides
            value_template: "{{ state_attr('sensor.tides', 'next_tide_type') }} tide at {{ state_attr('sensor.tides', 'next_tide_time') }}"
            icon_template: "{% if is_state_attr('sensor.tides', 'next_tide_type', 'High') %}mdi:waves{% else %}mdi:wave{% endif %}"