homeassistant-openmediavault icon indicating copy to clipboard operation
homeassistant-openmediavault copied to clipboard

Change the way the Disk sensors are created in HA [Feature]

Open thanomichalis opened this issue 1 year ago • 6 comments

Is your feature request related to a problem? Please describe.

Everytime the OMV is restarting, the drive letters are changing for each ssd disk. So if disk with serial X has a letter sda and disk with serial Y has sdb, in the next restart, the X is assigned the sdb and the Y assigned the sda. The integration however, is taking into consideration the sda and sdb to identify and keep the records from s.m.a.r.t. for each disk. Therefore, the history and the statistics data kept in HA, are mixing the two disks.

Describe the solution you'd like

We need to change the way HA identify and create the sensor to look not the letter that OMV assigns to the disks, but the their serial number which is unique.

thanomichalis avatar Dec 07 '23 12:12 thanomichalis

serial number is a no-go. some controllers or usb dont provide serial. same for mc which dont have serial at all. it has to be something that is unique and is always provided.

tomaae avatar Dec 08 '23 11:12 tomaae

@tomaae i see. However it is an issue, cause it is not only the history and statistics, but also the fact that in HA any automation regarding the disks, cannot be reliable since the sensors, are becoming unavailable or they have the wrong data. We may use the UUID though.

thanomichalis avatar Dec 11 '23 07:12 thanomichalis

yes, I was thinking of UUID too, but it needs confirming and testing that UUID stays the same while dev changes.

tomaae avatar Dec 11 '23 09:12 tomaae

@tomaae I am not a programmer nor familiar with what exactly should i do, but if you give me some script to add it in my HA installation on rpi4, i might be able to run some tests.

thanomichalis avatar Dec 11 '23 09:12 thanomichalis

I can confirm my UUID stays the same, as I use OMV and docker, and all my Docker Volumes use the /dev/disk-by-UUID path, hardcoded by me. Unless I don't understand correctly what you @tomaae meant by 'while dev changes' I think its a good idea to use UUID.

SamJongenelen avatar Dec 14 '23 09:12 SamJongenelen

It for sure stays the same. I also would like UUID instead. The current implementation doesn't make it possible to rename the drives to what they actually are. I for instance can't name the OS drive as SSD since it may go from sda to sdd upon reboot.

Speaking of this, the same issue is the case with containers running. Would be nice if "OMV Compose" could be removed from the name so it only display what service is running, would make it more clean as "OMV Compose" takes up so much space. Can't really hardcode any since the container running a given service may go from omv_compose_5 to omv_compose_3 upon reboot.

Henkow avatar May 09 '24 22:05 Henkow