tomaae / homeassistant-openmediavault

OpenMediaVault integration for Home Assistant
Apache License 2.0
109 stars 15 forks source link

Sensors not working with SMART enabled [Bug] #143

Closed rlewis187 closed 10 months ago

rlewis187 commented 10 months ago

Describe the issue

All OMV Sensors showing as unavailable, but very briefly appearing with correct values, and then going unavailable again. Started happening after I updated my OMV to 6.9.10-4

If I disable S.M.A.R.T then all sensors become available again and everything works as expected, apart from the HDD temps which all read 0°C

How to reproduce the issue

Steps to reproduce the behavior: Update to latest OMV Version, make sure that S.M.A.R.T is enabled

Expected behavior

Sensors to be available and showing the correct value with S.M.A.R.T enabled

Screenshots

image

Software versions

Home Assistant version: 2023.12.3 openmediavault integration version: 1.4.2 openmediavault software version: 6.9.10-4

Diagnostics data

config_entry-openmediavault-93de8c64700efb2495cf83f10489aed8.json.txt

Traceback/Error logs

This error originated from a custom integration.

Logger: custom_components.openmediavault.omv_api Source: custom_components/openmediavault/omv_api.py:302 Integration: OpenMediaVault (documentation, issues) First occurred: 13:36:14 (62 occurrences) Last logged: 13:53:21

OpenMediaVault 10.109.1.72 unable to fetch data (500)

Logger: homeassistant Source: /usr/src/homeassistant/homeassistant/runner.py:145 First occurred: 13:36:14 (192 occurrences) Last logged: 13:54:54

Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 1190, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType

Additional context

tomaae commented 10 months ago

try using master, it is most likely related to already solved issue

rlewis187 commented 10 months ago

That hasn't fixed it. It seems that every time it polls it shows the values for 3-4 seconds, then they dissappear again.

tomaae commented 10 months ago

can you run it in debug to capture the error? using master version

rlewis187 commented 10 months ago

I have had Debug running for a while, the whole log is now 185MB, heres a section of it debug log.txt

tomaae commented 10 months ago

I see only radarr integration and one of your template sensors crashing. OMV integration works normally. Try to solve those, it could be messing up something in HA.

rlewis187 commented 10 months ago

I have removed the radarr integration completely as I wasn't using it anyway. I tried disabling all of my template sensors and still the same behaviour. I have this error in my log that increases about 5 times per minute :

This error originated from a custom integration.

Logger: custom_components.openmediavault.omv_api
Source: custom_components/openmediavault/omv_api.py:302
Integration: OpenMediaVault (documentation, issues)
First occurred: December 16, 2023 at 14:21:23 (4812 occurrences)
Last logged: 10:05:54

OpenMediaVault 10.109.1.72 unable to fetch data (500)

It goes away if I disable the OMV integrationand restart.

I still have this one though:

Logger: homeassistant
Source: /usr/src/homeassistant/homeassistant/runner.py:145
First occurred: 10:36:22 (12 occurrences)
Last logged: 10:36:22

Error doing job: Fatal write error on datagram transport
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 1190, in sendto
    self._sock.sendto(data, addr)
TypeError: str, bytes or bytearray expected, not NoneType

I don't know if it is related

tomaae commented 10 months ago

ok, can you run debug now? I need it to capture above error from omv integration.

rlewis187 commented 10 months ago

Here you are:

home-assistant_openmediavault_2023-12-17T11-04-42.990Z.log

tomaae commented 10 months ago

I see, API behavior changed again. OMV changes API so often, its getting messy.

rlewis187 commented 10 months ago

Thanks for all your efforts mate, I really appreciate it. For now I have found a workaround using command line sensors to extract HDD temps and I can just disable SMART data so I am not in need of an urgent fix.

tomaae commented 10 months ago

is fd27480 not working?

rlewis187 commented 10 months ago

Sorry, I hadn't actually downloaded the latest version after you updated. Yes, it has fixed it. Thank you very much for such a quick turn-around!!!

Dinth commented 10 months ago

Hi. Im experiencing the same issue and i was wondering if it would be possible to merge the PR above?

fillilutten commented 10 months ago

I got the same issue. How do I update to the working version? I tried to replace the file above but it didn't help. Sorry for being such a newbie.

tomaae commented 10 months ago

its not PR, its in master already. you can switch branch to master in HACS if you want to use it right away.