home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.16k stars 29.84k forks source link

Unable to create mvglive sensors #121866

Open dorancemc opened 2 months ago

dorancemc commented 2 months ago

The problem

I am configuring a sensor for a station, according to the documentation I validated that the station exists but it still generates an error.

What version of Home Assistant Core has the issue?

core-2024.7.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

mvglive

Link to integration documentation on our website

https://www.home-assistant.io/integrations/mvglive

Diagnostics information

No response

Example YAML snippet

sensor:
  - platform: mvglive
    nextdeparture:
      - station: Dasing

Anything in the logs that might be useful for us?

Registrador: homeassistant
Fuente: components/sensor/__init__.py:655
Ocurrió por primera vez: 7:03:33 p.m. (1 ocurrencias)
Último inicio de sesión: 7:03:33 p.m.

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 648, in state
    numerical_value = int(value)
                      ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '-'

During handling of the above exception, another exception occurred:

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

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1048, in _async_update_entity_states
    await entity.async_update_ha_state(True)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 962, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1133, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1068, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1013, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 655, in state
    raise ValueError(
ValueError: Sensor sensor.dasing has device class 'None', state class 'None' unit 'min' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: '-' (<class 'str'>)


### Additional information

_No response_
home-assistant[bot] commented 2 months ago

mvglive documentation mvglive source

joshuajeschek commented 4 weeks ago

Same here, on core-2024.8.2 :)

felixbaumgaertner commented 3 weeks ago

Same here

Core 2024.8.2 Supervisor 2024.08.0 Operating System 13.1 Frontend 20240809.0

Logger: homeassistant.components.mvglive.sensor Source: components/mvglive/sensor.py:197 integration: MVG (documentation, issues) First occurred: 3:18:34 PM (11 occurrences) Last logged: 3:23:34 PM Returned data not understood

joostlek commented 3 weeks ago

MVGLive has been disabled because it was using non open source code to operate in 2024.8.0

felixbaumgaertner commented 5 days ago

MVGLive has been disabled because it was using non open source code to operate in 2024.8.0

Will it be enabled in the future? If not, will it be removed from the integration website? I find it misleading that it is visible there but it is not possible to set it up.

joostlek commented 5 days ago

If someone steps up and either get the library licensed correctly or someone who creates a new library and then it can be enabled.

That's a good point, I'll check if we can automate such check