ianByrne / HASS-ukho_tides

Home Assistant integration for tide information
MIT License
28 stars 5 forks source link

Feature requests: Pretty charts and off-set support #1

Closed DrJohnT closed 3 years ago

DrJohnT commented 3 years ago

Thank you so much for spending your own time writing this extension for HA. Having tried a few "tide" extensions for HA, this is the only one that works for me!

I originally started using an Australian site for tidal information called Willy Weather. They provide excellent graphics, but can only be integrated into HA by adding a dedicate tab panel mode as shown below:

Home Assistant Willy Weather

Later I found they got their tidal data from UKHO. Indeed their web site is very informative as it tells me how they derived the tide times from a nearby tide station. i.e.

WillyWeather

I was wondering if your component could possibly be extended to add an off-set for low and high tide, just like Willy Weather apply.

I saw you have an ambition to "Generate pretty charts for the dashboard". Well I have started using Apex Charts from HACS and I was wondering if your component could possibly be extended to provide the raw data for Apex Charts to use??

FYI, I made a new sensor wrapper around the sensor generated by your component so I could use a button card to encapsulate the information:

Home Assistant Dashboard

sensor:
- platform: template
  sensors:
    greenwich_tide:
      friendly_name_template: >-
        {{ states("sensor.north_woolwich_tide") }} Tide
      value_template: >-
        {% if states("sensor.north_woolwich_tide") == 'Falling' %}
          Low in {{ state_attr("sensor.north_woolwich_tide","next_tide_in") }}
        {% else %}
          High in {{ state_attr("sensor.north_woolwich_tide","next_tide_in") }}
        {% endif %}
      icon_template: >-
        {{ state_attr("sensor.north_woolwich_tide","icon") }}

Note that I edited your sensors.py to add the next_tide_in attribute.

Thanks again for the hard work!

ianByrne commented 3 years ago

Wow @DrJohnT ! I am honestly quite blown away that someone has even discovered this little project, let alone found it useful in some way 😁 Many thanks for your suggestions - my current task is battling with the Options Flow to more easily add/remove stations via the UI. Once done, I'll be moving ahead with prettying up the charts and I will be sure to look at the offset request too.

Thanks again!

ianByrne commented 3 years ago

Hi @DrJohnT - I have now released an update which includes high/low offsets. You can find some more info in the readme - please let me know if you run into any troubles.

Next step is pretty charts

DrJohnT commented 3 years ago

Works a treat! Thank you Ian

ianByrne commented 3 years ago

Hi @DrJohnT - I've now pushed a new update to expose all the tide times as an attribute predictions, which can be plugged into ApexCharts. See the main repo Readme for deets and screenshots.

Thanks again for the suggestions and do please let me know if any new issues/ideas

DrJohnT commented 3 years ago

Nice job! I immediately added to my dashboard: Overview - Home Assistant

DrJohnT commented 3 years ago

If you would like me to review any text / release notes when you come to publish on HACS, I would be more than happy. I believe UKHO have data for the entire planet. so this extension would be useful to anyone living by the ocean or major river. The other tidal integrations are pretty poor by comparison due to lack of data