tomaae / homeassistant-truenas

TrueNAS integration for Home Assistant
Apache License 2.0
187 stars 17 forks source link

[Feature] Add switches to the integration to e.g. shutdown / reboot #21

Closed Sesshoumaru-sama closed 2 years ago

Sesshoumaru-sama commented 2 years ago

Describe the solution you'd like

The TrueNAS integration should add switches to the home asisstant to stop / reboot the system and maybe also to start stop VMs, Serives and the like.

Describe alternatives you've considered

Alternatively it would be possible to use IMPI tools (for server hardware) to stop (even start) the server. Also it could be possible to use the TrueNAS restful API to trigger these actions - the API documentation is a bit fuzzy though.

Additional context

This all is in remote management of all server from a central plattform, using HA as prosumer management tool. Starting the server would also be cool, maybe using something trivial like WakeOnLan (even if I would prefer IPMI, but there is also not HA integration for IPMI :/ ---but I made a request).

tomaae commented 2 years ago

Reboot and shutdown should be possible via api, but I would be worried about it. Since there are no confirmation options, simple miss click in HA can trigger it. But why would you want reboot or even shutdown in HA? I dont see the use outside of truenas update.

There is a service to start/stop vm already.

IPMI is out of scope of this integration. There are so many different ones, it would be impossible for me to do, even if every IPMI had an API. Actually integration for ipmitools directly could be an good idea for various servers, but that is not in scope of this integration.

Sesshoumaru-sama commented 2 years ago

I am doing this for Unraid already, so I thought its a good idea for TrueNAS as well. And yes.. I am using Restriction-Cards in the Dashboard to avoid accidental triggering of critical actions. Yes... IPMI would be nice in general :)

MEfinger commented 2 years ago

I would love this feature to be added. I control my UPS with HA and want to shutdown the TrueNAS machine if there is a power outage. I know that there are most likely other ways but still I would like to have this option.

antontanderup commented 2 years ago

I have the same usecase as MEfinger. It would be awesome to be able to shutdown my TrueNAS machine from homeassistant, as my ups is connected homeassistant and not my NAS.