Git Product home page Git Product logo

tmjo / ha-norwegiantide Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 383 KB

Tide information for Norway from Kartverket as a custom integration for Home Assistant. Provides tidal data such as time for high/low, ebb/flow and prediction, forecast and observation.

Python 99.33% Shell 0.12% Makefile 0.55%
tide tidal norway ocean sea sealevel waterlevel kartverket sehavniva tidevann flo fjaere ebb flow high low

ha-norwegiantide's Introduction

Norwegian Tide

Buy Me A Coffee hacs_badge Maintenance

This is a Home Assistant custom integration for Norwegian Tide which is interfacing an open API by the Norwegian Mapping Authority (Kartverket), more precisely sehavniva.no which provides information about water levels and tidal predicitions and forecasts. All data is ©Norwegian Mapping Authority (Kartverket).

Unfortunately the service only provides data for geographical positions in Norway - this is a limitation in the API and not in this integration.

OBS! Does not work with HA 2024.2.1 or 2024.2.2 due to a compatibility issue with Matplotlib, but it should be fixed from 2024.2.3 and onwards.

Installation

There are different methods of installing the custom component. HACS is by far the simplest way for unexperienced users and is recomended.

HACS installation

The installation is currently not included in HACS as a default repo, but can be installed through HACS by adding this repo as a custom repository.

  1. Make sure you have HACS installed in your Home Assistant environment.
  2. Go to HACS, select Integrations.
  3. Click on the three dots in the upper right corner and select Custom repositories
  4. Copy/paste the URL for this repo https://github.com/tmjo/ha-norwegiantide into the URL-field, select Integration as category and then click Add.
  5. You should now find the Norwegian Tide integration by searching for it in HACS, proceed to install it.
  6. Restart Home Assistant (a warning should be shown in log saying you're using a custom integration).
  7. Continue to the Configuration-section.

Manual

  1. Navigate to you home assistant configuration folder.
  2. Create a custom_components folder of it does not already exist, then navigate into it.
  3. Download the folder norwegian-tide from this repo and add it into your custom_components folder.
  4. Restart Home Assistant (a warning should be shown in log saying you're using a custom integration).
  5. Continue to the Configuration-section.

Git installation

  1. Make sure you have git installed on your machine.
  2. Navigate to you home assistant configuration folder.
  3. Create a custom_components folder of it does not already exist, then navigate into it.
  4. Execute the following command: git clone https://github.com/tmjo/ha-norwegiantide ha-norwegiantide
  5. Run bash links.sh
  6. Restart Home Assistant (a warning should be shown in log saying you're using a custom integration).
  7. Continue to the Configuration-section.

Configuration

Configuration is done through UI/Lovelace. In Home Assistant, click on Configuration > Integrations where you add it with the + icon.

You will be asked to give your location a name and to provide latitude and longitude as geographical position for the location you want to track. Finally select which sensors you would like the integration to add. More detailed description of this will be added, but in short there is one main sensor which contains all info and for most people probably this may be sufficient. You do not need to add other entities unless you want, but several detailed entities are available if you prefer to have them as separate entities instead of attributes on the main sensor. There is also a camera entity which creates a plot of the data by using Matplotlib.

Entities can be added and removed by clicking Options in HA integreation view at any time. It is also possible to enable more than one location by adding the integration several times.

Usage

Use the integration as you please, but I highly recommend to take a look at the Apexchart-card by Romrider - it is an excellent graph card for lovelace which also enables the possibility to show future values. This is necessary to display prediction- and forecast values which are stored as attributes in the main sensor. Example:

apexchart-card

The camera entity can also be used for UI since it provides a nice plot using Matplotlib, but I personally prefer the Apexchart-card since it provides more dynamics. The camera on the other hand can be handy if you would like to send notifications with an included forecast image/plot. It will look something like this:

camera entity

More detailed description will follow, but worth mentioning:

  • Prediction: A calculated prediction for the location
  • Forecast: Includes the weather effect on top of the prediction
  • Observation: The observed value on the closest station to your location

If you are curious about specific details and definitions, please see www.sehavniva.no.

The main sensor will keep the current forecast value as state and will contain all or most data as attributes. The other entities will contain more specific data according to their name.

Issues and development

Please report issues on github. If you would like to contribute to development, please do so through PRs.

License

MIT © Tor Magne Johannessen. All data is ©Norwegian Mapping Authority (Kartverket).

ha-norwegiantide's People

Contributors

tmjo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ha-norwegiantide's Issues

Lat/long error message for Norwegian coordinates

My location is in Trondheim, Norway, but it seems that whatever i do, the coordinates throw an error saying: "Latitude/longitude is wrong or outside coverage." The integration was installed a few days ago via HACS.

2021-08-26_08-43-04

Issues after update of home assistant core-2021.7.x

After the july update, I was forced to uninstall a-norwegian tide, because home-assisant became unstable.
No errors in the logs that I can find.

After updating to core-2021.7.3, I can not install it from the integration page.
Worked perfectly before, was installed with hacs.

Problem with 2024.4.1 - Unable to install package matplotlib

Running HAOS on RPi4, latest everything.

Log:
Logger: homeassistant.util.package
Kilde: util/package.py:123
Førs oppstått: 14:27:05 (1 hendelser)
Sist logget: 14:27:05

Unable to install package matplotlib>=3.3.3: error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> [80 lines of output] Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/, https://wheels.home-assistant.io/musllinux-index/ Collecting certifi>=2020.06.20 Downloading https://wheels.home-assistant.io/musllinux-index/certifi-2024.2.2-py3-none-any.whl (163 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 163.8/163.8 kB 728.0 kB/s eta 0:00:00 Collecting pybind11>=2.6 Downloading pybind11-2.12.0-py3-none-any.whl.metadata (9.5 kB) Collecting setuptools>=64 Downloading https://wheels.home-assistant.io/musllinux-index/setuptools-69.2.0-py3-none-any.whl (821 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 821.5/821.5 kB 795.0 kB/s eta 0:00:00 Collecting setuptools_scm>=7 Downloading setuptools_scm-8.0.4-py3-none-any.whl.metadata (6.4 kB) Collecting numpy<2.3,>=2.0.0rc1 Downloading numpy-2.0.0rc1.tar.gz (18.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.3/18.3 MB 352.2 kB/s eta 0:00:00 Installing build dependencies: started Installing build dependencies: still running... Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Installing backend dependencies: started Installing backend dependencies: still running... Installing backend dependencies: finished with status 'error' error: subprocess-exited-with-error × pip subprocess to install backend dependencies did not run successfully. │ exit code: 1 ╰─> [43 lines of output] Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/, https://wheels.home-assistant.io/musllinux-index/, https://wheels.home-assistant.io/musllinux-index/ Collecting patchelf>=0.11.0 Downloading patchelf-0.17.2.1-py2.py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl.metadata (3.3 kB) Collecting ninja>=1.8.2 Downloading ninja-1.11.1.1.tar.gz (132 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 132.4/132.4 kB 859.5 kB/s eta 0:00:00 Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Downloading patchelf-0.17.2.1-py2.py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl (381 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 381.1/381.1 kB 570.6 kB/s eta 0:00:00 Building wheels for collected packages: ninja Building wheel for ninja (pyproject.toml): started Building wheel for ninja (pyproject.toml): finished with status 'error' error: subprocess-exited-with-error × Building wheel for ninja (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [15 lines of output] /tmp/pip-build-env-a7rf3bs2/overlay/lib/python3.12/site-packages/setuptools_scm/git.py:308: UserWarning: git archive did not support describe output warnings.warn("git archive did not support describe output") /tmp/pip-build-env-a7rf3bs2/overlay/lib/python3.12/site-packages/setuptools_scm/git.py:327: UserWarning: unprocessed git archival found (no export subst applied) warnings.warn("unprocessed git archival found (no export subst applied)") Traceback (most recent call last): File "/tmp/pip-build-env-a7rf3bs2/overlay/lib/python3.12/site-packages/skbuild/setuptools_wrap.py", line 645, in setup cmkr = cmaker.CMaker(cmake_executable) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-a7rf3bs2/overlay/lib/python3.12/site-packages/skbuild/cmaker.py", line 148, in init self.cmake_version = get_cmake_version(self.cmake_executable) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-a7rf3bs2/overlay/lib/python3.12/site-packages/skbuild/cmaker.py", line 105, in get_cmake_version raise SKBuildError(msg) from err Problem with the CMake installation, aborting build. CMake executable is cmake [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for ninja Failed to build ninja ERROR: Could not build wheels for ninja, which is required to install pyproject.toml-based projects [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × pip subprocess to install backend dependencies did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.

Numpy error in HA 2022.5.0

Logger: homeassistant.setup
Source: setup.py:162
First occurred: 10:22:17 (1 occurrences)
Last logged: 10:22:17

Setup failed for custom integration norwegiantide: Unable to import component: numpy.core.multiarray failed to import

Home Assistant warning due to deprecated loop keyword argument

Warning attached here:
"Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for norwegiantide using this method at custom_components/norwegiantide/api.py, line 173: async with async_timeout.timeout(TIMEOUT, loop=asyncio.get_event_loop()):"

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.