Open brodykenrick opened 6 months ago
Hello, Great Idea, I would add a forecast sensor.
Meanwhile, you have calendar that brings the information
Great. Thanks. Let me know when you need any testing or any other input.
I can also create and share some apex charts for the plots when the feature is available.
Hello, I have added forecast sensor. For the beginning, just the height + time. Please give me feed back (v13.1.0)
Awesome - Thanks @jugla !
That feature is working for my location.
state_class: measurement
attribution: Data provided by WorldTides
Unit displayed: metric
current_height_utc: 2024-05-07T12:30+0000
current_height: 1.181
forecast_duration_in_hour: 1
unit_of_measurement: m
icon: mdi:chevron-triple-down
friendly_name: tides_forecast_tide_height
Getting the tide in an hour will be very useful for my use case. If I got one hour and two then I'd be set for the case I am thinking.
A note that I think we don't want current_height used for those values but rather forecast_height (as that value is not "current").
I think a more general solution, and the kind that could be used for other forecast uses and for replicating the matlib charts, would be to use an array under forecast like this:
state_class: measurement
attribution: Data provided by WorldTides
Unit displayed: metric
unit_of_measurement: m
icon: mdi:chevron-triple-down
friendly_name: tides_forecast_tide_height
forecast:
- datetime_utc: 2024-05-07T12:30+0000
height: 1.181
- datetime_utc: 2024-05-07T13:00+0000
height: 1.107
perhaps each 30 mins for the next 6 or 12 hours?
Hello Thanks ! Agree, it is not the current height in the forecast. I have to reorganize a little the source code. I will add the forecast data in several attributes, so that it will match the description you propose. :-)
The word tides info custom component could make provide predicted/forecast tide heights at 30/60 min intervals (made available as an attribute forecast).
The matplotlib images are handy and functional but it might be more powerful to provide a forecast (as an attribute) like weather does (and other components, like PV/Solar forecasts also use).
Forecasts would allow users to both more readily create their own plots (using for example ApexCharts) and also to extract the predicted tide height at a time rather than just to be able to receive the next high and low. That would allow them to make determinations of when tide is above a certain level or below a certain level and for how long. Having forecasts would also allow users to cross-filter with weather data to easily determine the right tide and "good" weather as another forecast for other automations (like good times to go for a kayak - because the tide is right and the weather is warm and sunny).
Describe the solution you'd like
Extend the sensor.tides (or create a new sensor.tides_forecast) to include the attributes for a forecast on 30/60 mins
The new forecast attributes added as above with at least the datetime and the predicted height for each 30 min period (or hourly). Other details could also be added like tide tendency. The forecast values could be going back 6 hours and forward 42 hours like the current implementation/defaults. it might also be nice to predict a full week ahead (using
days
setting in the world tides info API).I think UTC time would be best. I think the current implementation already gets data at 30 mins intervals. However, 60 mins might more naturally match with a weather forecast and other plottable forecasts.
Describe alternatives you've considered I was going to create a sensor using the high/low tide numbers and the rule of twelfths to overcome the recent matplotlib issues but the details are already avaialble in the upstream API so it would be a nice extension of this great component to support forecasts.