OpenMediaVault integration

Hi,

yes, the IP is correct. But it cannot be reached via ping.
A ping and the setup via port forwarding and dyndns works.
It is probably due to the VM of OMV-KVM, since HASS uses
the network interface of OMV.
IP OMV 192.168.33.3
IP HASS 192.168.33.99
I’ll test it out.

Thanks, I hadn’t thought of a ping.

CU Jo

Hi

I’ve just installed this integration for my new OMV 6.9.11 (Sheitan) and it’s working fine… except:

  • CPU Load is always = 0
  • CPU Temp is not “available”

Happy New Year!

Hello, I just installed this fantastic hacs, works great, I want a separate user makane for home assistant, who knows what the minimum user rights are?

You have to use build in admin account. This is OMV API limitation.

1 Like

oke, thanks

Same here with OMV7. :frowning:

A workaround is to open the folder: your_homeassistant_folder\custom_components\openmediavault
With the help of Visual Studio Code or similar, search through all the files (although there are really 2 [omv_controller.py, sensor_types.py]): cpuUsage and replace with: cpuUtilization
Save and restart Home Assistant.

3 Likes

Does this workaround solve the problem of the CPU Load = 0? :frowning:

That’s, what I said. Yes.

Thanks … but I have changed cpuUsage with cpuUtilization in my omv_controller.py, sensor_types.py files, saved & restarted HA… but CPU LOAD remains 0 :frowning:

Not here, it works fine… Sorry

Hello

I cannot connect to OMV with HA

Error Message:

ome Assistant Core

2024-08-24 10:27:29.348 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry OMV for openmediavault

File “/config/custom_components/openmediavault/omv_controller.py”, line 150, in async_hwinfo_update

File “/config/custom_components/openmediavault/omv_controller.py”, line 244, in get_hwinfo

2024-08-24 11:21:53.275 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry OMV for openmediavault

File “/config/custom_components/openmediavault/omv_controller.py”, line 150, in async_hwinfo_update

File “/config/custom_components/openmediavault/omv_controller.py”, line 244, in get_hwinfo

2024-08-24 11:22:03.695 DEBUG (SyncWorker_10) [custom_components.openmediavault.omv_api] OpenMediaVault 192.168.1.10 connected

2024-08-24 11:22:03.704 DEBUG (SyncWorker_10) [custom_components.openmediavault.omv_api] OpenMediaVault 192.168.1.10 query: System, getInformation, {}, {‘updatelastaccess’: True}

2024-08-24 11:22:03.787 DEBUG (SyncWorker_10) [custom_components.openmediavault.omv_api] OpenMediaVault 192.168.1.10 query response: {‘response’: {‘ts’: 1705660847, ‘time’: ‘Fri Jan 19 10:40:47 2024’, ‘hostname’: ‘cameraopslag’}, ‘error’: None}

2024-08-24 11:22:03.788 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry OMV for openmediavault

File “/config/custom_components/openmediavault/omv_controller.py”, line 150, in async_hwinfo_update

File “/config/custom_components/openmediavault/omv_controller.py”, line 244, in get_hwinfo

I seem to connect but the integration show the below error

It worked for me, thank you! For the others, don’t miss a cpuUsage iteration, in these files there are 5 cpuUsage iterations in total.

I cannot get the intergration to configure. See my log attached. Any help would be gratefully appreciated.
@Tomaae , Would you have any suggestions?

2024-11-18 22:09:42.861 DEBUG (SyncWorker_42) [custom_components.openmediavault.omv_api] OpenMediaVault 192.168.7.94 connected
2024-11-18 22:09:42.862 DEBUG (SyncWorker_42) [custom_components.openmediavault.omv_api] OpenMediaVault 192.168.7.94 query: System, getInformation, {}, {'updatelastaccess': True}
2024-11-18 22:09:44.120 DEBUG (SyncWorker_42) [custom_components.openmediavault.omv_api] OpenMediaVault 192.168.7.94 query response: {'response': [{'name': 'Hostname', 'value': 'OMVNAS.local', 'type': 'string', 'index': 0}, {'name': 'Version', 'value': '4.1.23-1 (Arrakis)', 'type': 'string', 'index': 1}, {'name': 'Processor', 'value': 'n/a', 'type': 'string', 'index': 2}, {'name': 'Kernel', 'value': 'Linux 4.1.17', 'type': 'string', 'index': 3}, {'name': 'System time', 'value': 'Mon 18 Nov 2024 10:09:44 PM GMT', 'type': 'string', 'index': 4}, {'name': 'Uptime', 'value': '132 days 6 hours 35 minutes 21 seconds', 'type': 'string', 'index': 5}, {'name': 'Load average', 'value': '0.46, 0.32, 0.28', 'type': 'string', 'index': 6}, {'name': 'CPU usage', 'value': {'text': '2%', 'value': 2.2842639593909}, 'type': 'progress', 'index': 7}, {'name': 'Memory usage', 'value': {'text': '15% of 730.10 MiB', 'value': 15}, 'type': 'progress', 'index': 8}], 'error': None}
2024-11-18 22:09:44.121 DEBUG (SyncWorker_42) [custom_components.openmediavault.apiparser] Processing source [{'name': 'Hostname', 'value': 'OMVNAS.local', 'type': 'string', 'index': 0}, {'name': 'Version', 'value': '4.1.23-1 (Arrakis)', 'type': 'string', 'index': 1}, {'name': 'Processor', 'value': 'n/a', 'type': 'string', 'index': 2}, {'name': 'Kernel', 'value': 'Linux 4.1.17', 'type': 'string', 'index': 3}, {'name': 'System time', 'value': 'Mon 18 Nov 2024 10:09:44 PM GMT', 'type': 'string', 'index': 4}, {'name': 'Uptime', 'value': '132 days 6 hours 35 minutes 21 seconds', 'type': 'string', 'index': 5}, {'name': 'Load average', 'value': '0.46, 0.32, 0.28', 'type': 'string', 'index': 6}, {'name': 'CPU usage', 'value': {'text': '2%', 'value': 2.2842639593909}, 'type': 'progress', 'index': 7}, {'name': 'Memory usage', 'value': {'text': '15% of 730.10 MiB', 'value': 15}, 'type': 'progress', 'index': 8}]
2024-11-18 22:09:44.121 DEBUG (SyncWorker_42) [custom_components.openmediavault.apiparser] Processing entry {'name': 'Hostname', 'value': 'OMVNAS.local', 'type': 'string', 'index': 0}
2024-11-18 22:09:44.121 DEBUG (SyncWorker_42) [custom_components.openmediavault.apiparser] Processing entry {'name': 'Version', 'value': '4.1.23-1 (Arrakis)', 'type': 'string', 'index': 1}
2024-11-18 22:09:44.121 DEBUG (SyncWorker_42) [custom_components.openmediavault.apiparser] Processing entry {'name': 'Processor', 'value': 'n/a', 'type': 'string', 'index': 2}
2024-11-18 22:09:44.121 DEBUG (SyncWorker_42) [custom_components.openmediavault.apiparser] Processing entry {'name': 'Kernel', 'value': 'Linux 4.1.17', 'type': 'string', 'index': 3}
2024-11-18 22:09:44.121 DEBUG (SyncWorker_42) [custom_components.openmediavault.apiparser] Processing entry {'name': 'System time', 'value': 'Mon 18 Nov 2024 10:09:44 PM GMT', 'type': 'string', 'index': 4}
2024-11-18 22:09:44.121 DEBUG (SyncWorker_42) [custom_components.openmediavault.apiparser] Processing entry {'name': 'Uptime', 'value': '132 days 6 hours 35 minutes 21 seconds', 'type': 'string', 'index': 5}
2024-11-18 22:09:44.121 DEBUG (SyncWorker_42) [custom_components.openmediavault.apiparser] Processing entry {'name': 'Load average', 'value': '0.46, 0.32, 0.28', 'type': 'string', 'index': 6}
2024-11-18 22:09:44.121 DEBUG (SyncWorker_42) [custom_components.openmediavault.apiparser] Processing entry {'name': 'CPU usage', 'value': {'text': '2%', 'value': 2.2842639593909}, 'type': 'progress', 'index': 7}
2024-11-18 22:09:44.121 DEBUG (SyncWorker_42) [custom_components.openmediavault.apiparser] Processing entry {'name': 'Memory usage', 'value': {'text': '15% of 730.10 MiB', 'value': 15}, 'type': 'progress', 'index': 8}
2024-11-18 22:09:44.122 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry OMV for openmediavault
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 635, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openmediavault/__init__.py", line 34, in async_setup_entry
    await controller.async_hwinfo_update()
  File "/config/custom_components/openmediavault/omv_controller.py", line 150, in async_hwinfo_update
    await self.hass.async_add_executor_job(self.get_hwinfo)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openmediavault/omv_controller.py", line 244, in get_hwinfo
    if int(self.data["hwinfo"]["version"].split(".")[0]) > 5:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'unknown'
![{A32032C7-5925-4A55-9563-8618698CD9A8}|652x181]

(upload://799wZmny2wAWmsdwBeXt3UQmNHt.png)

Is anyone getting smart data for their disks with this integration ?
I can see disk temperature and space used in the disks and file system sections, but no smart data.
I do not have ‘disable smart’ ticked in the setup.

I realised I was looking in the wrong place for the smart data, they are attributes of the Disk sensor which I missed.

I also noticed that the one bit of smart data I really wanted was the overall status of the drive. I saw in the debug logs this was coming through in the calls to OMV, but not showing up in HA, so I figured I’d have a go at getting it. Turns out its only a few lines of code;-

Add the following to sensor_types.py at line 45:-

"overallstatus",

This is just below the line:-

DEVICE_ATTRIBUTES_DISK = [

Next go to omv_controller.py and add these lines:-

line 297:-

{"name": "overallstatus", "default": "unknown"},

Which is just underneath:-

vals=[

And finally, on line 339 add this:-

{"name": "overallstatus", "default": "unknown"},

which is just underneath:-

{"name": "temperature", "default": 0},

Restart home assistant and you have a new attibute under the disk with your overall smart status:-

Note that if your disk cannot report smart data, the value will be ‘BAD_STATUS’. This does not mean the disk has gone bad. (This shows on one of my virtual disks).

Hope that helps for some ppl.

1 Like

I’ve also added power on hours to the integration, as that is also something I commonly find useful. To do this its similar to the above, but the changes you make are:-

Add the following to sensor_types.py at the end of

DEVICE_ATTRIBUTES_DISK_SMART

on line 67 or 68 add:-

"Power_On_Hours"

Then in file omv_controller.py add the following:-

at the end of

ensure_vals=[

on line 319 or 320 add to the end of the list

{"name": "Power_On_Hours", "default": 0},

then at the end of

vals = [

add

"Power_On_Hours",

which will be line 380 or 381

restart home assistant and you’ll now get power on hours as well in the disk attributes :wink:

I had the same issue with this myself but realised that when doing my search replace (in BB Edit) I hadn’t set it to case sensitive. SO in sensor_types.py this meant I accidentally changed
DEVICE_ATTRIBUTES_CPUUSAGE
to
DEVICE_ATTRIBUTES_cpuUtilization
On lines 27 and 130.
This lead to me getting ‘unavailable’ rather than 0% but changing just these back to
DEVICE_ATTRIBUTES_CPUUSAGE
has now given me an actual varying reading.


TNX!

1 Like

Hey all- new here and firstly want to say thank you! This integration is pretty cool.

I’m having an issue where all of my OMV entities say unavailable. HomeAssistant is collecting data from OMV and when I click on my Memory graph, for example, I see a chart of usage over time. Same with disk temperatures, etc. But the current data all reads unavailable.

I also noticed in the OMV System Logbook, I’ll see notices every minute (it’s setup to refresh every minute), like “OMV System Config dirty turned off”, but then 3 seconds later it will say Config dirty became unavailable. My debug logs show no errors; just a warning about my USB boot drive not being able to read smart data. Is this normal / a known bug or something I can tweak to get my system to stop showing unavailable for everything?

I’m on the latest version of OMV, fully updated.

Thanks for the help!