tomaae / homeassistant-truenas

TrueNAS integration for Home Assistant
Apache License 2.0
194 stars 19 forks source link

[Bug] Space used does not update #94

Closed anto294 closed 1 year ago

anto294 commented 1 year ago

Hello, the sensor of space used "sensor.truenas_datasets_poolx", does not update automatically. You need to reload the integration.

Theoretically it should update every minute

tomaae commented 1 year ago

check your HA log for errors

anto294 commented 1 year ago

Unfortunately, no error or warning appears in the logs. Otherwise I would have reported it

tomaae commented 1 year ago

Ok, run it in debug to see if it is actually running query every minute. Also, what is your truenas version?

anto294 commented 1 year ago

The only one error is: Ignoring invalid device info: Invalid device info {'configuration_url': 'http://192.168.178.103', 'connections': {('truenas', 'truenas')}, 'default_manufacturer': 'To Be Filled By O.E.M.', 'default_model': 'B550M PG Riptide', 'default_name': 'TrueNAS System', 'identifiers': {('truenas', 'truenas')}, 'sw_version': 'TrueNAS-SCALE-22.12.3.3', 'via_device': ('truenas', 'truenas')} for 'truenas' config entry: device info needs to either describe a device, link to existing device or provide extra information.

TrueNAS 22.12.3.3 I use this integration since November 2022, but it's always been doing that.

tomaae commented 1 year ago

that error is related to 2023.8. it will affect only entities not showing up in integrations under device. otherwise they will be available.

Always? Strange that nobody noticed that yet. Is it affecting just dataset sensors, or also pool sensors in "System" section?

jmnovak50 commented 1 year ago

Hi @tomaae,

I’m seeing similar behavior on my install. Seems that pools are refreshing but datasets are not…unless I reload the integration.

TrueNAS-SCALE-22.12.3.3

Great integration BTW!

jmnovak50 commented 1 year ago

More on this…also ran in debug…

Logger: homeassistant.components.update Source: helpers/entity_platform.py:624 Integration: Update (documentation, issues) First occurred: August 7, 2023 at 10:49:45 PM (2 occurrences) Last logged: 8:33:25 PM

Ignoring invalid device info: Invalid device info {'configuration_url': 'http://192.168.1.xxx, 'connections': {('truenas', 'habanero')}, 'default_manufacturer': 'ASUS', 'default_model': 'System Product Name', 'default_name': 'TrueNAS System', 'identifiers': {('truenas', 'habanero')}, 'sw_version': 'TrueNAS-SCALE-22.12.3.3', 'via_device': ('truenas', 'habanero')} for 'truenas' config entry: device info needs to either describe a device, link to existing device or provide extra information.

anto294 commented 1 year ago

that error is related to 2023.8. it will affect only entities not showing up in integrations under device. otherwise they will be available.

Always? Strange that nobody noticed that yet. Is it affecting just dataset sensors, or also pool sensors in "System" section?

Only dataset. I didn't report this bug first because of my lack 😅. Now I want to create a % used space sensor, and I need updated value.

tomaae commented 1 year ago

ok, thats a weird one. I think I see same issue with my install, just didnt noticed it. I was using pool info until now which works.

tomaae commented 1 year ago

I have been trying to debug this with cleanup of one dataset, went from 17.57 to 9. Dataset size didnt changed, zfs list was reporting used as 17.57 and 9 as reffered. This is due to scheduled snapshots. I deleted them and used went to 9.

Can you check on your side?

anto294 commented 1 year ago

Unfortunately, I have the new version Cobia 23.10-Beta1. R.C. is coming out tomorrow. As you already know, the integration is not compatible yet.

I assure you that the sensor did not decrease even by deleting zfs snapshots. It didn't even increase if I copied files for over a TB.

tomaae commented 1 year ago

can you test using zfs list|grep <dataset you used> and also look in UI if value changed?

anto294 commented 1 year ago

Of course!

Initial: Screenshot 2023-09-18 105312

+379GB on tank/Temp Screenshot 2023-09-18 111521

File deleted, but present on ZFS snapshot: Screenshot 2023-09-18 111849 Screenshot 2023-09-18 112018

After removed snapshot: Screenshot 2023-09-18 112107

tomaae commented 1 year ago

yup, same behavior. but it should be like this. I think this was the root cause

tomaae commented 1 year ago

image can confirm its working fine in master