birdwing / proxmoxve

Proxmox VE Custom Integration Home Assistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proxmox VE Custom Integration Home Assistant

Proxmox VE is an open-source server virtualization environment. This integration allows you to poll various data and controls from your instance.

After configuring this integration, the following information is available:

  • Binary sensor entities with the status of node and selected virtual machines/containers.
  • Sensor entities of the selected node and virtual machines/containers. Some sensors are created disabled by default, you can enable them by accessing the entity's configuration.
  • Entities button to control selected virtual machines/containers (see about Proxmox user permissions below). By default, the entities buttons to control virtual machines/containers are created disabled.

image

Installation

If you use HACS:

  1. Click on HACS in the Home Assistant menu

  2. Click on the 3 dots in the top right corner.

  3. Select "Custom repositories"

  4. Add the URL to the repository.

  5. Select the Integration category.

  6. Click the "ADD" button.

  7. Click on HACS in the Home Assistant menu

  8. Click on Integrations

  9. Click the EXPLORE & DOWNLOAD REPOSITORIES button

  10. Search for Proxmox VE

  11. Click the DOWNLOAD button

  12. Restart Home Assistant

Manually:

  1. Copy proxmoxve folder from latest release to custom_components folder. in your config folder.
  2. Restart Home Assistant

Configuration

Adding Proxmox VE to your Home Assistant instance can be done via the user interface, by using this My button:

image

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

  • Browse to your Home Assistant instance.
  • In the sidebar click on Settings.
  • From the configuration menu select: Devices & Services.
  • In the bottom right, click on the Add Integration button.
  • From the list, search and select “Proxmox VE”.
  • Follow the instruction on screen to complete the set up.

Proxmox Permissions

To be able to retrieve the status of VMs and containers, the user used to connect must minimally have the VM.Audit privilege. To be able to controls the VMs and containers, the user used to connect must have the PVEVMAdmin role. Below is a guide to how to configure a new user with the minimum required permissions.

Create Home Assistant Group

Before creating the user, we need to create a group for the user. Privileges can be either applied to Groups or Roles.

  1. Click Datacenter
  2. Open Permissions and click Groups
  3. Click the Create button above all the existing groups
  4. Name the new group (e.g., HomeAssistant)
  5. Click Create

Add Group Permissions to all Assets

For the group to access the VMs we need to grant it the auditor role

  1. Click Datacenter
  2. Click Permissions
  3. Open Add and click Group Permission
  4. Select "/" for the path
  5. Select your Home Assistant group (HomeAssistant)
  6. Select the Auditor role (PVEAuditor)
  7. Make sure Propagate is checked

For the group to control the VMs, we need to grant the admin role.

  1. Click Datacenter
  2. Click Permissions
  3. Open Add and click Group Permission
  4. Select "/" for the path
  5. Select your Home Assistant group (HomeAssistant)
  6. Select the VM Admin role (PVEVMAdmin)
  7. Make sure Propagate is checked

Create Home Assistant User

Creating a dedicated user for Home Assistant, limited to only to the access just created is the most secure method. These instructions use the pve realm for the user. This allows a connection, but ensures that the user is not authenticated for SSH connections.

  1. Click Datacenter
  2. Open Permissions and click Users
  3. Click Add
  4. Enter a username (e.g., homeassistant)
  5. Set the realm to "Proxmox VE authentication server"
  6. Enter a secure password (it can be complex as you will only need to copy/paste it into your Home Assistant configuration)
  7. Select the group just created earlier (HomeAssistant) to grant access to Proxmox
  8. Ensure Enabled is checked and Expire is set to "never"
  9. Click Add

In your Home Assistant configuration, use homeassistant@pve for the username and your chosen password for the password.

About

Proxmox VE Custom Integration Home Assistant

License:Apache License 2.0


Languages

Language:Python 100.0%