Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] HA integration is not working with OMV 7 #149

Open
sharn25 opened this issue Mar 14, 2024 · 24 comments
Open

[Bug] HA integration is not working with OMV 7 #149

sharn25 opened this issue Mar 14, 2024 · 24 comments
Labels
bug Something isn't working

Comments

@sharn25
Copy link

sharn25 commented Mar 14, 2024

Describe the issue

The OMV 7 version showing in all entries as unknown.

How to reproduce the issue

  1. Add the Integration.
  2. Enter the OMV server IP address and credentials.
  3. It will show some entities for assigning the area.
  4. check the status of the entities. It will be unknown.

Expected behavior

The Entities should show the values like CPU usages, RAM usages.

Screenshots

image

Software versions

  • Home Assistant Core version: 2023.12.1
  • openmediavault integration version: v1.4.2
  • openmediavault software version: 7
@sharn25 sharn25 added the bug Something isn't working label Mar 14, 2024
@akyjoe
Copy link

akyjoe commented Mar 16, 2024

Unable to connect with the HOST (OMV 7) from Home Assistant (2024.3.1). Upon "Submit", error message throws above the host input field "No response from host."

Is it because OMV 7 is not fully supported yet?

@BebeMischa
Copy link

Just for reference: yesterday I did the upgrade from OMV 6 to OMV 7 and except the CPU load (which is known bug) everything works fine here.

@akyjoe
Copy link

akyjoe commented Mar 17, 2024

May be some permission is still missing. Steps followed were:

  • Install OpenMediaVault from HACS. Restart HomeAssistant.

  • Add OpenMediaVault from Integrations

image

  • At the Configuration, it does not find OMV host.
    image

Tried, with/without SSL, verify SSL, Hostname and IP Address. Error persists.

@tomaae
Copy link
Owner

tomaae commented Mar 18, 2024

make sure you can access omv from your ha instance and that you are using build in admin account.

@sharn25
Copy link
Author

sharn25 commented Mar 18, 2024

Hi,

I downloaded the diagnostics information, the values is being updated there.

Below Screenshots showing the change in values over time.
image

but the values under entities are still showing unknown.

@tomaae
Copy link
Owner

tomaae commented Mar 18, 2024

that most likely means something is crashing before entities are updated. look into your ha log.

Copy link

github-actions bot commented Apr 2, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Apr 2, 2024
@sharn25
Copy link
Author

sharn25 commented Apr 6, 2024

Hi Everyone, I just completed the Home assistant upgrade to 2024.4.1 and tried to re-add the OMV server.
But still not working. All the entities are unknown. Following error is coming in Home Assistant logs:

2024-04-06 21:49:31.137 INFO (MainThread) [homeassistant.components.sensor] Setting up openmediavault.sensor
2024-04-06 21:49:31.142 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.openmediavault entity: sensor.omv_system_cpu_load
2024-04-06 21:49:31.152 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.openmediavault entity: sensor.omv_system_memory
2024-04-06 21:49:31.165 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.openmediavault entity: sensor.omv_system_uptime
2024-04-06 21:49:31.172 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.openmediavault entity: sensor.omv_filesystem
2024-04-06 21:49:31.179 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.openmediavault entity: sensor.omv_filesystem_2
2024-04-06 21:49:31.195 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.openmediavault entity: sensor.omv_filesystem_3
2024-04-06 21:49:31.202 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.openmediavault entity: sensor.omv_filesystem_4
2024-04-06 21:49:31.209 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.openmediavault entity: sensor.omv_disk
2024-04-06 21:49:31.219 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.openmediavault entity: sensor.omv_disk_2
2024-04-06 21:49:31.225 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.openmediavault entity: sensor.omv_disk_3
2024-04-06 21:49:31.231 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up openmediavault.binary_sensor
2024-04-06 21:49:31.238 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.openmediavault entity: binary_sensor.omv_system_update_available
2024-04-06 21:49:31.242 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.openmediavault entity: binary_sensor.omv_system_reboot_pending
2024-04-06 21:49:31.246 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.openmediavault entity: binary_sensor.omv_system_config_dirty
2024-04-06 21:50:17.313 WARNING (MainThread) [homeassistant.components.command_line] Updating Command Line Sensor Internet Usage took longer than the scheduled update interval 0:00:05
2024-04-06 21:50:37.201 WARNING (SyncWorker_36) [custom_components.openmediavault.omv_api] OpenMediaVault 192.168.43.54 unable to fetch data (500)
2024-04-06 21:50:49.462 WARNING (MainThread) [homeassistant.components.command_line] Updating Command Line Sensor Internet Usage took longer than the scheduled update interval 0:00:05
2024-04-06 21:51:42.514 WARNING (SyncWorker_28) [custom_components.openmediavault.omv_api] OpenMediaVault 192.168.43.54 unable to fetch data (500)

@sejrbajer
Copy link

Any info on how to fix it or what the issue is?
Getting the same "unable to fetch data (500)"

@sharn25
Copy link
Author

sharn25 commented May 2, 2024

No able to fix it. Still same issue

@xxLeoxx93
Copy link

xxLeoxx93 commented May 15, 2024

@akyjoe Did you manage to fix your issue? I'm having the same problem...

Update: Fixed it, was a network error. But I still have missing CPU Temp and CPU Usage stays at 0 :(

@kdw2060
Copy link

kdw2060 commented Jun 8, 2024

@tomaae as I'm having the same issue I started to write my own script to make the rpc api calls. This is working fine, but one issue I do have is that I can't figure out how to keep a session alive.
As you're more familiar with the OMV api and there's no official documentation (only still the old 4.0 docs): Could you please explain the process one should use to keep a login session alive?

When executing the Session.login request you get a sessionid value back in the response.
I guess that with subsequent requests like the System.getInformation I need to pass this value as a header or a param? And do you need to renew this acquired sessionid every x minutes? And if so, how?

@akyjoe
Copy link

akyjoe commented Jun 21, 2024

@akyjoe Did you manage to fix your issue? I'm having the same problem...

Update: Fixed it, was a network error. But I still have missing CPU Temp and CPU Usage stays at 0 :(

Yes, it managed to create the various entities in my HA v2024.6.2. But still no luck in updating sensor data. Here's the debug info from logger:

`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: 11:43:40 AM (58 occurrences)
Last logged: 12:18:06 PM

OpenMediaVault xx.xx.xx.xx unable to fetch data (500)`

image

@tomaae
Copy link
Owner

tomaae commented Jun 22, 2024

@tomaae as I'm having the same issue I started to write my own script to make the rpc api calls. This is working fine, but one issue I do have is that I can't figure out how to keep a session alive. As you're more familiar with the OMV api and there's no official documentation (only still the old 4.0 docs): Could you please explain the process one should use to keep a login session alive?

When executing the Session.login request you get a sessionid value back in the response. I guess that with subsequent requests like the System.getInformation I need to pass this value as a header or a param? And do you need to renew this acquired sessionid every x minutes? And if so, how?

Yea, you need to save cookie after login in and and resend it every time. Also send in options {"updatelastaccess": True} when sending a query. Not sure what a connection timeout is tho. No documentation is really causing issues with OMV.

For disappearing entities, just look into HA log. You will see where it fails.

@nasked
Copy link

nasked commented Jun 26, 2024

I have the same problem. Integration is connected with OMV without no problem.
Este error se originó a partir de una integración personalizada.

Log Detail:

Registrador: custom_components.openmediavault.omv_api
Fuente: custom_components/openmediavault/omv_api.py:302
integración: OpenMediaVault (documentación, problemas)
Ocurrió por primera vez: 25 de junio de 2024, 01:39:54 (3599 ocurrencias)
Último inicio de sesión: 15:32:58

OpenMediaVault xx.xx.xx.xx unable to fetch data (500)
OpenMediaVault xx.xx.xx.xx unable to fetch data (504)

I can use Glances docker but i prefer omv ha integration. We'll wait for a while...

@sezlony
Copy link

sezlony commented Jul 15, 2024

just installed this integration and I can confirm, that it does not work with omv7

2024-07-15 10:00:51.689 DEBUG (SyncWorker_22) [custom_components.openmediavault.omv_api] OpenMediaVault 192.168.1.2 connected
2024-07-15 10:00:51.897 DEBUG (SyncWorker_8) [custom_components.openmediavault.omv_api] OpenMediaVault 192.168.1.2 connected
2024-07-15 10:00:51.899 DEBUG (SyncWorker_8) [custom_components.openmediavault.omv_api] OpenMediaVault 192.168.1.2 query: System, getInformation, {}, {'updatelastaccess': True}
2024-07-15 10:00:51.942 DEBUG (SyncWorker_8) [custom_components.openmediavault.omv_api] OpenMediaVault 192.168.1.2 query response: {'response': {'ts': 1721030451, 'time': 'Mon 15 Jul 2024 10:00:51 AM CEST', 'hostname': 'redacted'}, 'error': None}
2024-07-15 10:00:51.943 DEBUG (SyncWorker_8) [custom_components.openmediavault.apiparser] Processing source [{'ts': 1721030451, 'time': 'Mon 15 Jul 2024 10:00:51 AM CEST', 'hostname': 'redacted'}]
2024-07-15 10:00:51.943 DEBUG (SyncWorker_8) [custom_components.openmediavault.apiparser] Processing entry {'ts': 1721030451, 'time': 'Mon 15 Jul 2024 10:00:51 AM CEST', 'hostname': 'redacted'}
2024-07-15 10:00:51.945 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 504, in async_setup
    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'

Copy link
Owner

tomaae commented Jul 17, 2024

can you post debugs?

@sharn25
Copy link
Author

sharn25 commented Jul 23, 2024

Attached the debug logs.
2024-07-23_OMV_debug.log

@github-actions github-actions bot removed the stale label Jul 26, 2024
@kdw2060
Copy link

kdw2060 commented Jul 28, 2024

~~ For those that run a HA installation that allows for the installation of add-ons: you can try the workaround omvConsumer script I made (because sadly still experiencing this issue with the integration) via my api consumer add-on.

Upon installing the add-on a file called example-omvConsumer.js should be found in the share folder of your Home Assistant installation. You need to fill in your url, username and password for OMV on lines 12-14. If wanted you can adapt the different api-calls further down in the file to your liking as well.
Next set example-omvConsumer or whatever name you gave the file in the api consumer add-on configuration.

If all works well you will get a bunch of sensors starting with omv_ that contain the OMV information in a data attribute.
You need knowledge of HA's templating syntax to use that data. Either use a template string (e.g. {{states['sensor.omv_info'].attributes.data.uptime}}) directly inside a card or create template sensors / helpers to translate a data attribute value to a sensor if you need this for the card you want to use.

btw, I cannot provide support, I presume you're familiar with HA templating and some javascript ~~

UPDATE/EDIT
Actually, forget all off the above. Feel stupid to not have tested this earlier. To get my workaround script to work I needed to create a bridge network in OMV because HA is running inside a VM. Creating that bridge network also solved the issue with the integration because of course it ran into the same issue of not being able to communicate outside the VM otherwise.
I guess this might be the root cause for other users here too.

Consult the OMV-extras manual section on creating a br0 bridge network

@sezlony
Copy link

sezlony commented Jul 29, 2024

meanwhile I managed to install it (did nothing differently than before) and works fine!

only problem is that CPU load constantly shows 0%, although loadavarage1/5/15 attributes have their respective values

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Aug 13, 2024
@sharn25
Copy link
Author

sharn25 commented Aug 13, 2024

Hi Everyone, My issue was resolved.

I did reinstallation of OMV and it started working

Thanks

@sezlony
Copy link

sezlony commented Aug 13, 2024

I did reinstallation of OMV and it started working

does the CPU load sensor work also?

@github-actions github-actions bot removed the stale label Aug 14, 2024
@rofo69
Copy link

rofo69 commented Aug 17, 2024

I'm running latest HA (2024.8.2) and OMV HACs verision 1.4.2.
It kinda works. Every 60 seconds I see a tiny blip in my entity history with the correct value, but it only last about a second or so, before the entity goes to unavailable for the remaining 59 seconds:-

image

I can work around it by creating a template sensor to hide the unavailable ones, but would be far less work to see if this can be fixed ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants