UNAS Pro integration - monitoring and fan control

Hmm yeah, I can see why. SSH connection fails and it doesn’t try to automatically reconnect. Reloading does and thus fixes it. I’ll push a fix for this once I’m able to reboot my UNAS and actually test it, most likely some time around Saturday/Sunday.

And don’t take this the wrong way, but just curious as to how come you’re rebooting your devices this often? It really is valuable input given that I did try to cover most cases of UNAS/HA reboot combinations, but apparently not all of them, so it’s good to have someone point these issues out. But just wondering… :smiley:

Thanks for having a look!

I installed the UNAS but I’m still waiting for my drives to arrive.
So I inserted the one drive I have and started playing with the home assistant integration. And since it’s not doing anything I turn it off after playing with it :grin:

1 Like

Haha, alright makes sense. Since you’re already playing around and rebooting often anyway, would you be up for trying the fix since I can’t verify it myself right now? It would definitely help figure out if there are any issues with it quicker + you’d potentially have a working/fixed version. I pushed it to the develop branch, it just requires installing manually instead of via HACS: GitHub - cardouken/homeassistant-unifi-unas at develop

I’m happy to try but I’m not so familiar with HA so sorry for these basic questions.

I downloaded the ZIP via the green <> Code button on Github and located the custom_components/unifi_unas folder.
That folder seems to contain many more files than what I downloaded.
Should I delete all the content and replace it with the downloaded files?

It should be the same minus the __pycache__ directory on the HA instance.

Might be simpler if you just take the __init__.py and manifest.json files from the downloaded archive (only files that changed, the rest is the same) and overwrite those files on your HA instance in config/custom_components/unifi_unas. Then reboot HA and it should show version 0.8.2-dev.

But deleting is otherwise fine too, I’m just not 100% sure what you’re seeing, but if it’s the pycache directory files you meant then yes, all good to delete and just copy everything over as well.

I replaced the two files (it showed version 0.8.2-dev) and I ran the test 3 times.
Every time the UNAS sensor reading showed up when starting the UNAS after the HA reboot. Nice!

I also observed a new behavior: After the HA reboot when the UNAS was still off the sensors were showing the last readings again. Even when these were at “unavailable” (UNAS is off) when HA was rebooted. These go back to the expected “unavailable” after 2-3 minutes.

Good to hear!

Could you expand on this part a bit more, just so I fully understand:

I also observed a new behavior: After the HA reboot when the UNAS was still off the sensors were showing the last readings again. Even when these were at “unavailable” (UNAS is off) when HA was rebooted. These go back to the expected “unavailable” after 2-3 minutes.

You mean all sensors (not just fan control/curve parameters) were showing old values for 2-3 minutes after HA restart? Were those readings the last values reported from when the UNAS was on? And you were definitely not experiencing this with v0.8.0 or v0.8.1?

If so, then I probably have an idea as to what’s happening. It’s now allowing MQTT subscriptions even when it can’t connect to the UNAS via SSH to allow for sensor data to start coming in once the UNAS comes up, so I’ll have to tweak it a bit more then. :slight_smile:

This has been running successfully through a few cycles (I’ve manually kicked it off)… now I just have an issue with the Proxmox integration not starting the LXC properly

1 Like

Yes, all values like CPU usage, CPU temperature and so on (also for the disk).
I can’t say if they are identical to the values at shutdown but they are sensible values.
I am pretty sure that this was not the case in the older versiosns

Can you try now? Same develop branch, but need to replace the mqtt_client.py file this time. It will still show as 0.8.2-dev after HA reboot, but it will apply the change which should fix it I think.

I replaced the mqtt_client.py file, did a few runs and it worked!
No old values showed up after rebooting HA and it reconnected to the UNAS automatically after the NAS booted up.
Many thanks!

1 Like

Great! I’ll be able to run some tests myself later tonight hopefully and if all is good, push a new release today/tomorrow. You should just see a new version update via HACS to update to with these changes included.

1 Like