Skip to content

ALArvi019/moderntides

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modern Tides - Home Assistant Integration

GitHub Release GitHub Activity License hacs

A modern Home Assistant custom integration that provides real-time tide information and beautiful visualizations from Spanish tide stations. This integration fetches data from the Instituto Hidrográfico de la Marina (IHM) and provides sensors for current tide height, next high/low tide times, and a visual camera entity showing tide charts.

Modern Tides Logo

Features

  • Real-time tide data from official Spanish maritime institute
  • Beautiful tide charts as camera entities (SVG format)
  • Multi-day tide plots: Automatically generates plots for 1-7 days
  • Dual visualization modes: Light and dark theme support with automatic dual camera entities
  • Multiple sensors for current height and next tide times
  • Easy configuration through the UI
  • Automatic updates every 30 minutes
  • Support for multiple stations simultaneously
  • Modern UI integration with optimized color palettes for both light and dark interfaces
  • Flexible plot selection: Choose from 1-day to 7-day tide predictions in your dashboards

Installation

HACS (Recommended)

  1. Make sure you have HACS installed
  2. Go to HACS → Integrations
  3. Click the three dots in the top right corner and select "Custom repositories"
  4. Add this repository URL: https://github.com/ALArvi019/moderntides
  5. Select "Integration" as the category
  6. Click "Add"
  7. Search for "Modern Tides" and install it
  8. Restart Home Assistant

Manual Installation

  1. Download the latest release from the releases page
  2. Extract the contents to your custom_components directory:
    custom_components/
    └── moderntides/
        ├── __init__.py
        ├── manifest.json
        ├── config_flow.py
        ├── const.py
        ├── sensor.py
        ├── camera.py
        ├── tide_api.py
        ├── plot_manager.py
        └── strings.json
    
  3. Restart Home Assistant

Configuration

  1. Go to SettingsDevices & Services
  2. Click Add Integration
  3. Search for "Modern Tides"
  4. Select your desired tide station from the dropdown list
  5. Click Submit

The integration will automatically create all necessary entities for your selected station.

For each configured tide station, the following entities will be created:

  • Station information sensor: General information about the tide station
  • Current height sensor: Current tide height in meters
  • Next high tide sensor: Time and height of the next high tide
  • Next low tide sensor: Time and height of the next low tide
  • Tide plot cameras: 14 camera entities for different time ranges and themes

Available Entities

After adding a station, you'll have access to these entities (replace STATION_NAME with your station's name):

  • sensor.STATION_NAME_tide_station_info - Station information
  • sensor.STATION_NAME_current_tide_height - Current tide height in meters
  • sensor.STATION_NAME_next_high_tide_time - Next high tide time
  • sensor.STATION_NAME_next_low_tide_time - Next low tide time
  • camera.STATION_NAME_tide_plot - Tide chart visualization (light mode)
  • camera.STATION_NAME_tide_plot_dark - Tide chart visualization (dark mode)

Camera Entities

The integration automatically creates 14 camera entities for each station, giving you complete flexibility:

  • Light Mode Camera (camera.STATION_NAME_tide_plot): Traditional white background with blue tide curves, perfect for light-themed dashboards

  • camera.STATION_NAME_tide_plot - 1 day (default, backwards compatible)

  • camera.STATION_NAME_tide_plot_2d - 2 days

  • camera.STATION_NAME_tide_plot_3d - 3 days

  • camera.STATION_NAME_tide_plot_4d - 4 days

  • camera.STATION_NAME_tide_plot_5d - 5 days

  • camera.STATION_NAME_tide_plot_6d - 6 days

  • camera.STATION_NAME_tide_plot_7d - 7 days (1 week)

  • Dark Mode Camera (camera.STATION_NAME_tide_plot_dark): Dark background (#1e1e1e) with green tide curves and enhanced contrast, optimized for dark-themed interfaces

  • camera.STATION_NAME_tide_plot_dark - 1 day (default)

  • camera.STATION_NAME_tide_plot_2d_dark - 2 days

  • camera.STATION_NAME_tide_plot_3d_dark - 3 days

  • camera.STATION_NAME_tide_plot_4d_dark - 4 days

  • camera.STATION_NAME_tide_plot_5d_dark - 5 days

  • camera.STATION_NAME_tide_plot_6d_dark - 6 days

  • camera.STATION_NAME_tide_plot_7d_dark - 7 days (1 week)

Visual Specifications

All colors and fonts are customizable. See Custom Colors Example for details.

Light Mode (camera.STATION_NAME_tide_plot)

  • Background: White (#FFFFFF)
  • Tide curve: Cornflower blue (#6495ED)
  • Fill area: Light blue (#ADD8E6) with 30% opacity
  • Grid lines: Light gray (#D3D3D3)
  • High tide markers: Dark red (#CC0000) - improved contrast
  • Low tide markers: Dark blue (#0000CC) - improved contrast
  • Text: Black (#000000)

Dark Mode (camera.STATION_NAME_tide_plot_dark)

  • Background: Dark gray (#1E1E1E)
  • Tide curve: Green (#4CAF50)
  • Fill area: Green with 20% opacity
  • Grid lines: Dark gray (#404040)
  • High tide markers: Orange (#FF5722)
  • Low tide markers: Light blue (#2196F3)
  • Text: White (#FFFFFF) and light gray (#CCCCCC)

Both visualizations are generated as scalable SVG files and update automatically with new tide data.

Customization

You can customize colors and font sizes directly from the Home Assistant UI:

  1. Go to SettingsDevices & Services
  2. Find Modern Tides and click Configure
  3. Select Customize colors and fonts
  4. Adjust colors for light/dark modes and font sizes
  5. Click Submit

Color Customization

Dashboard Examples

Explore our collection of dashboard examples to get the most out of your Modern Tides integration. Each example includes detailed instructions, YAML code, and visual previews.

Example Description Features
Basic Entity Card Basic Entity Card Simple list format with all tide information
Picture Elements Picture Elements with Overlays Interactive overlays on tide chart
Glance Card Glance Card Compact three-column view
Mushroom Cards Mushroom Cards Modern design with Mushroom components
Preferred Panel Preferred Panel Configuration Most informative and visually appealing setup
Dark Mode Dark Mode Visualization Automatic theme switching and dual cameras
Comprehensive Weather Comprehensive Weather & Tides Complete weather and tide monitoring dashboard
Multiple Stations Multiple Stations Side-by-side comparison dashboard
Multi-Day Plots Multi-Day Plots 1-7 day forecasts with automatic generation
Custom Colors Customize colors and fonts from the UI (v1.1.6+)

Quick Start

  1. Choose an example that fits your needs
  2. Click on the example link to view detailed instructions
  3. Replace STATION_NAME with your actual station name (e.g., cadiz, barcelona)
  4. Copy the provided YAML code to your Home Assistant dashboard
  5. Enjoy your beautiful tide visualizations!

Requirements

  • Modern Tides integration installed and configured
  • For Mushroom card examples: Mushroom cards custom component
  • At least one tide station configured

Example Automation

You can create automations based on tide data:

automation:
  - alias: "High tide warning"
    trigger:
      - platform: template
        value_template: >
          {% set high_tide = states('sensor.STATION_NAME_next_high_tide_time') %}
          {% set time_diff = (as_timestamp(high_tide) - as_timestamp(now())) / 60 %}
          {{ time_diff > 59 and time_diff < 61 }}
    action:
      - service: notify.mobile_app
        data:
          title: "Tide Alert"
          message: "Approximately one hour until the next high tide at STATION_NAME"

Data Source

This component uses the public API of the Instituto Hidrográfico de la Marina (IHM):

  • Stations API: https://ideihm.covam.es/api-ihm/getmarea?request=getlist&format=json
  • Daily tides API: https://ideihm.covam.es/api-ihm/getmarea?request=gettide&id=STATION_ID&format=json&date=YYYYMMDD
  • Monthly tides API: https://ideihm.covam.es/api-ihm/getmarea?request=gettide&id=STATION_ID&format=json&month=YYYYMM

Troubleshooting

If you encounter any issues with the integration:

  1. Check Home Assistant logs for specific error messages
  2. Make sure your Home Assistant instance has an Internet connection
  3. Verify that the integration is properly installed
  4. If the problem persists, open an issue in the GitHub repository

Contributing

Contributions are welcome! If you want to improve this component:

  1. Fork the repository
  2. Create a branch for your feature (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push the changes to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


Developed by ALArvi019 - 2025

About

Modern Home Assistant integration for real-time tide information from Spanish maritime stations

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages