ESPHome tide clock

I want to build a graphic tide clock using LVGL. I easily build a gauges that spins 360 degrees with high tide at the top and low at the bottom.

I just need the time of the previous high tide and the next high tide and then divide that time by 360 degrees

This API call can get the high an low tides from a 72 hour range.

https://api.tidesandcurrents.noaa.gov/api/prod/datagetter?station=8454578&product=predictions&datum=MLLW&time_zone=lst_ldt&units=english&interval=hilo&format=json&begin_date=20241209&range=72

I just need some code to parse through the JSON and get the last and next high tide based on the current time.

Looks like there is already way to do this but the lambda is beyond my skill level.

Can anybody help me with this?

Use one of the tide integrations in home assistant and import the sensors into esphome.

Yes it’s easy to get the hi/lo tide times from both this API or home assistant but it’s calculating the angle of the analog tide clock that I can’t figure out how to do.

Take a look here Tides in Lovelace - #11 by nickrout. This is in Lovelace, but might give you some ideas.