Giter Club home page Giter Club logo

viva's Introduction

ViVa Coastal Weather

viva hacs_badge Validate with hassfest Maintenance viva_downloads viva_downloads

ViVa Integration for Home Assistant

This integration will display weather and sealevel information around the Swedish coast from Sjöfartsverket (Swedish Maritime Administration).

Installation

Preferred download method

  • Use HACS, search for viva integration and download it.
  • Restart Home Assistant

Manual download method

  • Copy all files from custom_components/viva in this repo to your config custom_components/viva
  • Restart Home Assistant

Setup

Clear browser cache. (Just to be safe - not always needed)

Goto Integrations->Add and select viva

Follow instructions to select the location you want to monitor.

Disclaimer

The package and its author are not affiliated with ViVa or Sjöfartsverket. Use at your own risk.

License

The package is released under the MIT license.

viva's People

Contributors

astrandb avatar dependabot[bot] avatar moorgrove avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

moorgrove

viva's Issues

Sensor type Sight can not handle "greater than" (>) sign

The problem

If the sight is greater than 20 000 meters ViVa reports it as >20000 which is not convertible into a float value.

2023-10-20 10:37:00.037 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 588, in state
    numerical_value = int(value)
                      ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '>20000'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 591, in state
    numerical_value = float(value)
                      ^^^^^^^^^^^^
ValueError: could not convert string to float: '>20000'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 233, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 389, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 172, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 469, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 779, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 879, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 820, in _async_generate_attributes
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 785, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 595, in state
    raise ValueError(
ValueError: Sensor sensor.tan_sikt has device class 'distance', state class 'None' unit 'm' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: '>20000' (<class 'str'>)

Version of viva integration having the issue?

1.0.3

Version of Home Assistant Core having the issue?

2023.10.3

Anything in the logs that might be useful for us?

No response

Additional information

No response

ValueError exception when a normally numeric sensor gets a "-" as value

The problem

The API sometimes returns "-" for an unavailable value e.g. a sealevel measurement. This results in a ValueError exception with complete stack trace.

Expected is sensor marked as unknown/temporarily unavailable

Version of viva integration having the issue?

1.0.4

Version of Home Assistant Core having the issue?

2023.11.0

Anything in the logs that might be useful for us?

No response

Additional information

No response

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.