Home Assistant integration for monitoring and controlling ESXi hosts and vCenter environments. Provides comprehensive VM and host management with individual devices for clean organization.
Key Features:
- ✅ Full vCenter multi-host support
- ✅ VM/Host power control with smart safety logic
- ✅ VM snapshot management
- ✅ Host power policy control
- ✅ Individual devices for better organization
- ✅ Real-time monitoring with proper units
Per ESXi Host: Version, uptime, CPU/memory usage, power policy, maintenance mode, VM count Per Virtual Machine: Power state, CPU/memory usage, guest OS, IP address, VMware Tools status, snapshots Per Datastore: Type, free/total space, connected hosts, VM count License Information: Status, expiration, product type (requires admin permissions)
Device Organization: Creates individual devices per ESXi host and VM. Datastore and license info grouped in main ESXi Stats device.
- Open HACS > Settings
- Add custom repository:
https://github.com/wxt9861/esxi_stats
(Integration) - Install ESXi Stats
- Restart Home Assistant
- Go to Configuration > Integrations > Add Integration > ESXi Stats
- Copy
custom_components/esxi_stats/
to your Home Assistantcustom_components/
directory - Restart Home Assistant
- Add integration via UI
During setup, select which data types to monitor:
Option | Data Collected | Permission Level |
---|---|---|
Hosts | CPU/memory usage, uptime, power policy | Read-Only |
Datastores | Free/total space, type, VM count | Read-Only |
VMs | Power state, usage, guest OS, snapshots | Read-Only |
Licenses | Status, expiration dates | Administrator |
Configuration Options:
Parameter | Required | Default | Description |
---|---|---|---|
host |
Yes | - | ESXi host or vCenter IP/hostname |
username |
Yes | - | Username for authentication |
password |
Yes | - | Password for authentication |
verify_ssl |
No | false |
SSL certificate verification (use false for self-signed certs) |
💡 Tip: Uncheck "Licenses" if you only need monitoring permissions
Option 1: Administrator Role (Easiest)
- Full access to all features
- Works for both vCenter and standalone ESXi
- Assign built-in Administrator role to your service account
Option 2: Read-Only + VM Power User (Balanced)
- Good for VM management with host monitoring
- Use VM Power User role for vCenter
- Use Administrator for standalone ESXi (no VM Power User equivalent)
Option 3: Read-Only Only (Monitoring)
- Safe monitoring-only access
- Use built-in Read-Only role
- Cannot control power or access license info
If you prefer minimal permissions, create a custom role with these exact privileges as they appear in the UI:
For Monitoring Only:
Datastore > Browse
Global > Licenses
Add for VM Power Control:
Virtual Machine > Interact > Power On
Virtual Machine > Interact > Power Off
Virtual Machine > Interact > Reset
Virtual Machine > Interact > Suspend
Add for Host Power Control:
Host > Config > Power
Add for VM Snapshots:
Virtual Machine > State > Create Snapshot
Virtual Machine > State > Remove Snapshot
Full Control (All Features):
Datastore > Browse datastore
Global > Licenses
Host > Configuration > Power
Virtual machine > Interaction > Power On
Virtual machine > Interaction > Power Off
Virtual machine > Interaction > Reset
Virtual machine > Interaction > Suspend
Virtual machine > Snapshot management > Create snapshot
Virtual machine > Snapshot management > Remove snapshot
For Monitoring Only:
System > View
System > Read
Datastore > Browse datastore
Global > Licenses
Add for VM Power Control:
VirtualMachine > Interact > PowerOn
VirtualMachine > Interact > PowerOff
VirtualMachine > Interact > Reset
VirtualMachine > Interact > Suspend
Add for Host Power Control:
Host > Config > Power
Add for VM Snapshots:
VirtualMachine > State > CreateSnapshot
VirtualMachine > State > RemoveSnapshot
Full Control (All Features):
System > View
System > Read
Datastore > Browse datastore
Global > Licenses
Host > Config > Power management
Virtual machine > Interaction > Power On
Virtual machine > Interaction > Power Off
Virtual machine > Interaction > Reset
Virtual machine > Interaction > Suspend
Virtual machine > Snapshot management > Create snapshot
Virtual machine > Snapshot management > Remove snapshot
vCenter:
- Create service account in your identity source
- Add user to vCenter: Administration > SSO > Users and Groups
- Assign role: Administration > Access Control > Global Permissions
- Test login with service account
Standalone ESXi:
- Create local user: Host > Manage > Security & Users > Users
- Assign role to user
- Test login with service account
Feature | vCenter Permissions | ESXi Standalone |
---|---|---|
Monitor hosts/VMs/datastores | Datastore > Browse datastore | Read-Only role |
View license information | Global > Licenses | Administrator role |
Control VM power | Virtual Machine > Interact > Power* permissions | Administrator role |
Control host power | Host > Config > Power | Administrator role |
Change power policies | Host > Config > Power | Administrator role |
Manage snapshots | Virtual Machine > State > *Snapshot permissions | Administrator role |
Customize what datastore and license sensors display as their state:
- Go to Configuration > Integrations > ESXi Stats > Options (gear icon)
- Enter the attribute name you want as the sensor state
- Restart Home Assistant
VM Management:
- Power switches - Smart shutdown (graceful when VMware Tools available, hard power off otherwise)
- Reboot buttons - Smart reboot (graceful when VMware Tools available, hard reset otherwise)
- Snapshot buttons - Create timestamped snapshots, remove all/first/last snapshots
Host Management:
- Power switches - Graceful host shutdown
- Reboot buttons - Safe host restart
- Power policy selectors - Change power management policy (static, dynamic, low, custom)
All controls include safety features and automatic status updates.
Requires full ESXi license. Available services:
Host Management:
esxi_stats.host_power
- shutdown/reboot hostsesxi_stats.host_power_policy
- change power policyesxi_stats.list_hosts
- list vCenter hostsesxi_stats.list_power_policies
- list available policies
VM Management:
esxi_stats.vm_power
- control VM power stateesxi_stats.create_snapshot
- create VM snapshotesxi_stats.remove_snapshot
- remove VM snapshots
Example:
{
"host": "vcenter.domain.com",
"target_host": "esxi01.domain.com",
"command": "shutdown"
}
Several dashboard options work well with the individual sensor structure:
- Use Custom flex-table-card
- Example lovelace yaml can be found here
- Use Custom flex-horseshoe-card paired with Custom decluttering-card
- Example lovelace yaml can be found here
- This example is valid for flex-horseshoe-card 0.8.2 and declutering-card 0.2.0
- Use Custom button-card
- Example lovelace yaml can be found here
Connection Issues:
- Verify credentials and network connectivity
- Check SSL verification setting (use
false
for self-signed certs) - Ensure vCenter/ESXi API is accessible on port 443
Missing Features:
- Service calls require full ESXi license
- UI controls need appropriate permissions (see Permissions Setup)
- Check Home Assistant logs for permission errors
Debug Logging:
logger:
logs:
custom_components.esxi_stats: debug
Support: GitHub Issues