Giter VIP home page Giter VIP logo

hass-ukho_tides's People

Contributors

blutack avatar ianbyrne avatar jfparis avatar jleagle avatar tombrien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hass-ukho_tides's Issues

Thanks!

Just a thanks for this. Perfect timing. Signed up for my Admiralty API key and was looking to do a chart - and voila there you were. Worked perfect out of the box. Great work.

Latest HomeAssistant

Latest version of HomeAssistant appears to have broken something. Error message saying β€œConfig flow could not be loaded: {"message":"Invalid handler specified"}” when trying to reinstall the integration.

Not an Issue: questions ;)

Thank you very much for the great integration. I'm a HA novice, and finding it challenging to get at details, since I think the documentation is very much designed as a reference to those who are already familar with it.

I an add the simple sensor to a card fine with station id/name and state of the tide (rising/falling), but how do I access attributes such as tide times & heights? I did skim through the files very quickly but attribute names didn't spring out at me.

Also, what are high & low tide offsets?

Additional Feature request - Tidal Height Offset?

Thanks for a great HA integration - this works so well πŸ‘πŸ‘πŸ‘

It is good to see that it has an offset for High and Low tide times. For many installations (including my own 😁) a tidal height offset would also be very useful.

The sailing club is 15 minutes behind Osea Island times, but also 2.1M higher (so the tide has 2.1M less height)

The height may more complex than it first seems, as it will need to allow for areas that dry out, and so stay at zero for a period of time, so there is effectively no "Low Tide Time" which results in any graph having a flat bottom for part of that tidal cycle.

Many Thanks

Makes Home Assistant Run Very Slow

I set up this integration as per the instructions with an Apex graph showing tidal curve and the text box displaying tide stats. After a few minutes of this running home assistant starts to become very slow.

Options flow doesn't load

Trying to load the options flow fails due to awaiting er.async_get(self.hass). Despite it's rather confusing name, the get function in the entity registry helper isn't an async function.
Full traceback:

2023-12-27 18:48:10.646 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 233, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 213, in post
    return await super().post(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post
    result = await self._flow_mgr.async_init(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 265, in async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ukho_tides/config_flow.py", line 211, in async_step_init
    entity_registry = await er.async_get(self.hass)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object EntityRegistry can't be used in 'await' expression

Feature requests: Pretty charts and off-set support

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!

HomeAssistant Update Stopped Data Pull

data has stopped being displayed since HA update (running in a VM), version

Home Assistant 2023.5.2
Supervisor 2023.04.1
Operating System 10.1
Frontend 20230503.3 - latest

Trying to reinstall failed with error "Config flow could not be loaded: {"message":"Invalid handler specified"}"

[Feature Request] Parameters might be improved

This integration works nicely for me, and is the best explained integration I've seen. Some improvements might be made in parameters.

The list of tidal stations isn't in a useful order, so it's hard to find a particular station. It's probably in the order supplied by UKHO. Could the integration sort the names into alphabetical order?

The description for using ApexCharts is slightly out of date. What used to be extend_to_end: false should now be extend_to: end.

The integration appears to get two days' worth of tides. Could there be a parameter to set the number of days?

Idea/Request: AU market

@ianByrne I really admire your work! Especially the ApexCharts integration. I was wondering if there's a possibility for you to create a similar project for the AU market, or if you could guide me towards resources to learn and potentially develop a similar project using Python. Thank you so much!

Bureau of Meteorology - Gold Coast Seaway

image

No data issue

Hi, great plugin which worked for a while but has stopped showing data. When I checked the logs, I saw that it was because I was getting errors saying the quota for free requests under the discovery tier of the UKHO API had been exceeded? Any thoughts?

Apex charts example won't load

When i copy and paste the apex charts code from the readme, it fails to load.

type: custom:apexcharts-card
graph_span: 2d
span:
  start: hour
  offset: '-5h'
now:
  show: true
  label: now
series:
  - entity: sensor.lee_on_solent_tide
    extend_to_end: false
    unit: m
    data_generator: |
      return entity.attributes.predictions.map((event) => {
        return [moment.utc(event[0]).local(), event[1]];
      });

No longer works after upgrading to HA 2023.5

Upgraded to HA 2023.5 last night and it broke the okho_tides integration (and some others!). On the Settings, Integrations page is shows an error "Failed to set up: Import error".

device_state_attributes error

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:549
...
Entity sensor.ventnor_tide (<class 'custom_components.ukho_tides.sensor.UkhoTidesSensor'>) implements device_state_attributes. Please report it to the custom component author.

I think it is on sensor.py line 158 device_state_attributes should now be extra_state_attributes?
Thanks

Discovery API Key not recognised.

It looks like the Admiralty Discovery Service have changed their subscriptions and sign-up process. The free Discovery API is still available, however your integration does not recognise the API key. When I run the configuration and enter the API into the API field it returns a "invalid_api_key" error message.

image

Display tide predictions in an easier to read format

Currently the tide sensor has a predictions attribute which is made up of an array of arrays:

predictions: [ [ '2023-01-01 06:00:00', '1.6' ], [ '2023-01-01 13:00:00', '0.2' ] ]

Perhaps it can be refactored into something more meaningful, like an array of objects:

predictions:
  - datetime: 2023-01-01 06:00:00
    height: 1.6
    event: high tide
  - datetime: 2023-01-01 13:00:00
    height: 0.2
    event: low tide

Either refactored (causing breaking changes for anyone using the attribute), or as a new attribute for backwards compatibility.

As requested here. PRs welcome

Document on how to sign up moved

The URL for how to sign up to the API key in the read.me is no longer valid

In this paragraph:

API Key
First up, you will need an API key from the Admiralty Maritime Data Solutions developer portal. Follow their guide on how to do so and select one of the UK Tidal API products - the Discovery tier is free (the paid APIs are untested for this integration, but should in theory work fine).

The URL I found this on was https://developer.admiralty.co.uk/docs/startup and here https://admiraltyapi.developer.azure-api.net/

Off-set not applied to prediction graph

The below image is of Willy Weather on RHS, my button card which shows the correct off-set value for high tide. However, the graph on lower LHS clearly shows high tide has passed. So I presume that the off-set is not been applied to the tide prediction data.

NextHighTide

Regards,

Your other user Dr John

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.