YOUR BFF WHEN IT COMES TO THE BEST LINUX & OPEN SOURCE NEWS & RESOURCES

News

I control my Proxmox home lab from Home Assistant, here’s how

Capable of controlling a myriad of smart devices and IoT gizmos, Home Assistant is one of the best services you can self-host on your workstation. If you’re as much of a fan of Proxmox as I am, you may already have configured a HASS virtual machine on top of your PVE host.

Typically, you’d use the Console tab on Proxmox’s UI to manage your Home Assistant server. But have you ever wanted to flip the (metaphorical) script by overseeing your Proxmox Virtual Environment’s operations from your HASS server? For tinkerers who find this wacky idea intriguing, here’s a detailed guide on how you can control your Proxmox workstation from your Home Assistant hub.

What you’ll need for this project

From the title alone, you may have guessed that a Proxmox server and a Home Assistant instance are the centerpieces of the project, and you’re free to virtualize the latter inside your PVE war machine. Speaking of, there are a couple of ways to deploy HASS on Proxmox, but I suggest ditching the container route and going with a virtual machine for your Home Assistant hub. You could technically set up the necessary HACS add-on regardless of your virtual guest, but VMs make the installation process a lot simpler.

Configuring the HACS integration in Home Assistant

Once you’ve got a Proxmox server and an HASS instance up and running, it’s time to arm the latter with Home Assistant Community Store. To do so,

  1. Head to the official HACS page, click on my link, and tap Open LinkÂto add the Get HACSÂadd-on to your Home Assistant instance.
    Opening the Get HACS page in HASS
  2. Tap Add when the browser displays the Missing add-on repository pop-up.
    Adding the Get HACS repo to HASS
  3. Press the Install button before tapping Start.
    Starting the Get HACS add-on
  4. The add-on will automatically stop once it has installed HACS, and that’s your cue to reboot your HASS instance by heading to the Developer Tools section and pressing the Restart button.
    Restarting HASS
  5. When your Home Assistant virtual machine restarts, navigate to the SettingsÂtab and select Devices & services.
    Selecting the Devices & services header
  6. Click on the Add Integration button and choose HACS.
    Adding the HACS integration to HASS
  7. Agree to the Acknowledgments and tap Submit.
    Agreeing to the HASS acknowledgements
  8. Enter your GitHub account details when prompted by HACS and click on the Authorize hacs button to grant it access to your account.
    Authorizing HACS

Setting up the Proxmox integration on Home Assistant

Now that you’ve installed HACS on your Home Assistant server, you can use it to configure the Proxmox VE integration.

  1. Navigate to the HACS tab, tap the menu button (:) in the top right corner of the window, and select Custom repositories.
    Adding Custom repositories to HACS
  2. Enter the following URLÂinto the Repository bar, set Integration as the Type, and hit Add.
    https://github.com/dougiteixeira/proxmoxve
    Adding the Proxmox VE Integration to HACS
  3. Find the Proxmox VEÂintegration using the Search Bar and click on it.
    Finding the Proxmox VE integration
  4. Press the Download button in the bottom right corner of the page before pressing it again inside the pop-up window.
    Downloading the Proxmox VE integration
  5. Head back to the Settings tab, click on the Restart required notification, and press the Submit button.
    Restarting the HASS instance

Creating an access token in Proxmox

While the Home Assistant instance restarts, you’d want to create an API token for the Proxmox VE integration inside your PVE server.

  1. Click on the Datacenter tab inside the Proxmox UI.
    Selecting the Datacenter tab in Proxmox
  2. Switch to the API Tokens submenu and press Add.
    Adding a new API Token in Proxmox
  3. Pick the UserÂyou wish to connect to the Proxmox VE integration on HASS, enter a Token ID, uncheck the Privilege separation box, and tap the Add button.
    Creating an API Token

    For maximum security, you’d want to use a new user to create the API Token instead of relying on the root user.

  4. Copy the secret key somewhere safe.

Connecting the Proxmox server to Home Assistant

With both the Proxmox workstation and HASS instance configured, it’s time to pair them together.

  1. Switch to the Home AssistantÂweb UI, head to the Settings header, and choose Devices & services.
    Selecting the Devices & services header
  2. Tap on the Add Integration button once again and select Proxmox VE from the list.
    Adding the Proxmox VE integration
  3. Enter the IP address of your Proxmox server under the HostÂoption and type the Username associated with the API token you created earlier before adding the Token nameÂand the secret value.
    Connecting to the Proxmox host from HASS

    Replace pam with pve if the user of the API token has Proxmox VE authentication server as the realm. Likewise, if your PVE server doesn’t feature an SSL certification, uncheck the Verify SSL Certificate box.

  4. Select the Proxmox Nodes, VMs, Containers, and Storage devices you wish to access from the Home Assistant interface and hit Submit.
    Adding the nodes, VMs, and containers to HASS
  5. Tap Finish once HASS detects your Proxmox workstation.
    Connecting Proxmox with HASS

Control your Proxmox server from Home Assistant

If you’ve followed all the steps correctly, Home Assistant will display the resource consumption, specs, virtual guests, and other details of your Proxmox system in the Overview section. For folks who want even more control over their Proxmox VMs and containers, you can select them inside the Devices section of the Devices & services tab and enable the Start, Stop, Restart, and other togglesÂinside the Services panel.

While it’s a fun project, I recommend creating the API token for a non-root user to increase the security of your Proxmox server. Likewise, you can further reduce the attack surface of your Home Assistant-Proxmox combo by isolating your insecure IoT paraphernalia inside a VLAN connection.

Source: XDA Developers Forum

Show More

getFOSSD

https://t.me/getfoss

Related Articles

Leave a Reply

Back to top button
Get Support