tomaae / homeassistant-openmediavault

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

Update sensor shows false unless there are updates available #109

Closed BebeMischa closed 1 year ago

BebeMischa commented 1 year ago

Describe the issue

There are updates available within OMV, but HA update sensor says FALSE

How to reproduce the issue

Difficult to say, as you are running OMV virtually

Expected behavior

OMV sensor in HA woud say TRUE, if there are updates available

Screenshots

afbeelding afbeelding

Software versions

Diagnostics data

config_entry-openmediavault-98524fbac0980bbe729327fa06f337d1.json(1).txt

Traceback/Error logs

home-assistant_openmediavault_2023-04-25T18-48-46.282Z.log

Additional context

In the error log there is clearly stated, that there are 27 updates, the same amount, as can be seen on the OMV machine self. So the info is correctly read by OMV integration, just the sensor does not change its state.

Thank you again for digging in to it ;-)

tomaae commented 1 year ago

Yes, integration correctly gets info from API and it should work for you. can you screenshot whole OMV System device like this? image Also make sure you dont have 2 of them under the integration.

BebeMischa commented 1 year ago

afbeelding

afbeelding

afbeelding

tomaae commented 1 year ago

this is not right. you are probably not on latest master. you should see network sensors. Also KVM and compose if you are using them. image

Ignore "OMV VM", I renamed it to KVM to keep in line with OMV plugin naming

BebeMischa commented 1 year ago

I've selected re-download in HACS and there selected MASTER just today again, before all testing. Is it possible that this method does not get the latest?

I already noticed, that I also do not see the shutdown/restart services ;-)

tomaae commented 1 year ago

yea, something could be stuck there. maybe try to remove integration in hacs, make sure all files are gone and reinstall. I seen that happen once before.

BebeMischa commented 1 year ago

Still ending up with 1.3.0 even when selecting master.

tomaae commented 1 year ago

weird, it should work

tomaae commented 1 year ago

you may always try to copy it from github

BebeMischa commented 1 year ago

third try (patient people always win) i got the master.

But with that version - 9a1fcee

OMV integration cannot be setup:

Error setting up entry OMV for openmediavault

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/openmediavault/__init__.py", line 30, in async_setup_entry
    await controller.async_update()
  File "/config/custom_components/openmediavault/omv_controller.py", line 183, in async_update
    await self.hass.async_add_executor_job(self.get_smart)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/openmediavault/omv_controller.py", line 386, in get_smart
    tmp_data = parse_api(
  File "/config/custom_components/openmediavault/apiparser.py", line 137, in parse_api
    data = fill_vals(data, entry, uid, vals)
  File "/config/custom_components/openmediavault/apiparser.py", line 269, in fill_vals
    data[uid][_name] = from_entry(entry, _source, default=_default)
  File "/config/custom_components/openmediavault/apiparser.py", line 43, in from_entry
    ret = int(ret)
ValueError: invalid literal for int() with base 10: '394 (Average 431)'
tomaae commented 1 year ago

try now

BebeMischa commented 1 year ago

e78254f

Error setting up entry OMV for openmediavault

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/openmediavault/__init__.py", line 30, in async_setup_entry
    await controller.async_update()
  File "/config/custom_components/openmediavault/omv_controller.py", line 183, in async_update
    await self.hass.async_add_executor_job(self.get_smart)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/openmediavault/omv_controller.py", line 387, in get_smart
    tmp_data = parse_api(
  File "/config/custom_components/openmediavault/apiparser.py", line 137, in parse_api
    data = fill_vals(data, entry, uid, vals)
  File "/config/custom_components/openmediavault/apiparser.py", line 269, in fill_vals
    data[uid][_name] = from_entry(entry, _source, default=_default)
  File "/config/custom_components/openmediavault/apiparser.py", line 43, in from_entry
    ret = int(ret)
ValueError: invalid literal for int() with base 10: '394 (Average 431)'
BebeMischa commented 1 year ago

Could this be a problem? No closing sign?

afbeelding

tomaae commented 1 year ago

no, thats not a problem. last line is the issue. I think that is coming from smart.

tomaae commented 1 year ago

ok, give it a try now some vendors dont follow smart standard, so it can be pain to workaround everything. I had similar issues with smart before

tomaae commented 1 year ago

added one more check so we dont run into issues with correct responses

BebeMischa commented 1 year ago

9f6c75d

still not better

tomaae commented 1 year ago

ah, my bad. try now

BebeMischa commented 1 year ago

was the same, now going to try the new without CPU temp...

tomaae commented 1 year ago

nah, cpu temp does not matter there, it was my mistake

BebeMischa commented 1 year ago

3542deb

afbeelding

tomaae commented 1 year ago

looks good to me beschikbaar is available, right?

BebeMischa commented 1 year ago

exactly

BebeMischa commented 1 year ago

lot of sensors changed name, so dashboard has to be reworked a bit, but that does not bother me... ;-)

tomaae commented 1 year ago

yea, I standardized lot of sensor names and some uuid for sensors changed because of new implementation

BebeMischa commented 1 year ago

Thank you again for all the love... ;-)

BebeMischa commented 1 year ago

Houston, we got a problem. The update thing is fixed, I even updated OMV now, to check, if the sensor changes state. Works fine.

But now CPU load and Memory sensors don't update...

afbeelding

afbeelding

tomaae commented 1 year ago

weird, check debug if it keeps updating every minute.

BebeMischa commented 1 year ago

home-assistant_openmediavault_2023-04-26T00-26-40.951Z.log

BebeMischa commented 1 year ago

The new RX/TX sensors also don't work, always 0.0

tomaae commented 1 year ago

yea, you really have low cpu usage. often sub 1%

BebeMischa commented 1 year ago

yeah, always between 1-13 %. But even with updating, it raised to 13 % in OMV dashboard, but no any change in HA.

After restart of HA it picked up 5 % and stays like that, even when OMV changes.

BebeMischa commented 1 year ago

afbeelding

afbeelding

BebeMischa commented 1 year ago

going to try 23da0c1

BebeMischa commented 1 year ago

23da0c1

it still picks up a initial value after HA restart and never changes again.

I can't continue testing for now, have to go sleep, other ways tomorrow I will be a zombie ;-)

tomaae commented 1 year ago

yea, same. its too late. attributes are updated, but main value is not. I will have to look deeper into this

BebeMischa commented 1 year ago

good night, nice working with you! ;-)

tomaae commented 1 year ago

fixed, also added new features for sensors like suggested unit of measurement and precision

BebeMischa commented 1 year ago

dcc8a9b

seems to run good.

here is a log for you, just to check for things, I would not see. ;-)

home-assistant_openmediavault_2023-04-27T09-30-11.800Z.log