Custom Component - ESXi Stats

Have this now:

  default: warning
  logs:
    custom_components.esxi_stats: error

But the error persists :thinking:

I used this to stop the warning messges:

logger:
  default: warning
  logs:
    homeassistant.util.async_: critical
1 Like

Hi,
i am not sure if i am just too stupid…
After intalling the repository in HACS and restarting, ESXi Stats is not listed in my integration list…
Did i miss something?

Press F5 while in the integrations menu, then press the +

Hi. I did some testing, and I can not get it to work with vCenter 7. I believe they made changes to how the API works, but I am not sure. I would really appreciate it if you could fix this.
Thanks,
Christian

Hi wrt9861 and team,

I’ve setup the sensors and used your button card template in a grid card. I cannot for the life of me figure out how to shift the main sensor info more to the left so the full figures can be seen. Hopefully the screenshot helps show what i mean here…

Any ideas?

Thanks!

I am trying to use the esxi_stats.vm_power to shut down a VM.
I just receive the error “Make sure the name is correct”
Am I missing something obvious ? Thank You. Chris

2021-01-20 15:12:13 DEBUG (MainThread) [custom_components.esxi_stats] Getting stats for vm: nakivobackup
2021-01-20 15:12:13 DEBUG (MainThread) [custom_components.esxi_stats.esxi] {'name': 'nakivobackup', 'status': 'green', 'state': 'running', 'uptime_hours': 94.7, 'cpu_count': 2, 'cpu_use_pct': 0.7, 'memory_allocated_mb': 4096, 'memory_used_mb': 1780, 'used_space_gb': 8.33, 'tools_status': 'toolsOk', 'guest_os': 'Ubuntu Linux (64-bit)', 'guest_ip': '192.168.1.245', 'snapshots': 0}
2021-01-20 15:12:13 DEBUG (MainThread) [custom_components.esxi_stats.esxi] Logged out - session 52f4a939-8603-b640-85e9-265ce8de5198
2021-01-20 15:12:37 DEBUG (MainThread) [custom_components.esxi_stats.esxi] Logged in - session 52a54b0a-91bf-5efc-8c1a-aac9c1bdbbcd
2021-01-20 15:12:37 INFO (MainThread) [custom_components.esxi_stats.esxi] VM nakivobackup on host 192.168.1.242 not found. Make sure the name is correct
2021-01-20 15:12:37 DEBUG (MainThread) [custom_components.esxi_stats.esxi] Logged out - session 52a54b0a-91bf-5efc-8c1a-aac9c1bdbbcd

Nice integration but…
Found also the error with the " - "
if you have for instance 2 vm’s running. vm1: hass.io and vm2 hass.io-2.
If you use the ‘esxi_stats.remove_snapshot’ to remove the snapshot for hass.io-2 it will actually remove the snapshot from hass.io. it seems the integration cannot handle the “-” !

and it would be nice if the error log spamming could be solved.

Hello,
Nice integration, i love it !! :slight_smile:

but can esxi server be shut down from this integration?

I would like that when my ups is at 10% load, it does a shutdown of the esxi server.

is it possible?

nice day

Hi @whitwocb, try to add justify-self: end for this sensor.

Is ESXi Stats work for you after upgrade to 2021.4? For me integration seems to load, but none of entities are available.

For me it works, there were some updates for esxi, but not relevant for 2021.4, they were for the loop fix

1 Like

Make sure to update to the latest version, should be 0.6.1

1 Like

Yeap, I completely removed integration (previously had it installed manually) and re-added from HACS. Now everything back to normal!

1 Like

Hi @deliwyn I"m really not sure where to place that in here for the middle tile showing datastore capacity. Any clues please?

  esxi_stats_datastores:
    icon: 'mdi:harddisk'
    aspect_ratio: 1/1
    template: esxi_stats_general
    styles:
      grid:
        - grid-template-areas: '"i free" "n n" "capacity capacity" "hosts hosts" "vms vms"'
      custom_fields:
        capacity:
          - font-size: 12px
          - padding-bottom: 2px
          - align-self: middle
          - justify-self: start
        hosts:
          - font-size: 12px
          - padding-bottom: 2px
          - align-self: middle
          - justify-self: start
        vms:
          - font-size: 12px
          - padding-bottom: 2px
          - align-self: middle
          - justify-self: start

Thanks for this integration; great work.
Just wondering how to get temperature sensor and fan speed readings. These are available in vCenter/host/monitor/hardware, can they be accessed via this integration?
Cheers

Hi, Would you mind sharing the code for this card?

Sure thing:

template: vm_entity_template
type: custom:decluttering-card
variables:
  - entity: sensor.esxi_vm_pxe_boot_2
  - name: PXE Boot

Here’s the decluttering template:

decluttering_templates:
  vm_entity_template:
    card:
      entities:
        - entities:
            - attribute: state
              name: Status
            - attribute: uptime_hours
              name: Uptime
              unit: hr(s)
            - attribute: snapshots
              name: Snapshots
          entity: '[[entity]]'
          icon: mdi:server
          name: '[[name]]'
          secondary_info:
            attribute: guest_os
          show_state: false
          type: custom:multiple-entity-row
        - entities:
            - attribute: cpu_use_pct
              name: Usage
              unit: '%'
            - attribute: memory_used_mb
              name: Memory Usage
              unit: MB
            - attribute: cpu_count
              name: Cores
          entity: '[[entity]]'
          icon: mdi:speedometer
          name: '[[name]] Performance'
          show_state: false
          type: custom:multiple-entity-row
        - entities:
            - attribute: cpu_use_pct
              decimal: '0'
              entity: '[[entity]]'
              height: 15px
              max: '100'
              min: '0'
              name: CPU Usage
              severity:
                - color: var(--label-badge-green)
                  from: '0'
                  to: '40'
                - color: orange
                  from: '40'
                  to: '65'
                - color: var(--label-badge-red)
                  from: '65'
                  to: '100'
              unit_of_measurement: '%'
          entity_row: true
          positions:
            icon: 'off'
            indicator: inside
          style: |-
            bar-card-name {
              font-weight: bold; 
              text-shadow: 2px 2px 2px black;
            }
            bar-card-value {
              font-weight: bold;   
              text-shadow: 2px 2px 2px black;
            } 
              animation:
                state: 'on'    
          type: custom:bar-card
        - attribute: guest_ip
          entity: '[[entity]]'
          icon: mdi:ip
          name: Guest IP
          type: attribute
        - attribute: used_space_gb
          entity: '[[entity]]'
          icon: mdi:harddisk
          name: Diskspace Used
          suffix: GB
          type: attribute
      title: '[[name]]'
      type: entities
2 Likes

Hi @wxt9861 and team. Since a few weeks now I seem to be missing all attributes except the default one. See below my version of default datastore entity.

Mine:

Expected as per that found here https://github.com/wxt9861/esxi_stats

Can anyone shed any light on why this might be? This issue is causing my custom cards to go all loopy:

Thanks for your help!

just a small message to say thanks - im using this integration now with my vcenter environment. works really well … ive setup multiple automations to shutdown vms or start them only when needed (security scanning / backup servers) . Ive built based on the APC UPS monitoring card also a card for monitoring my ESX servers:

If anyone is interested in the YAML let me know.

on my wishlist: could we include host power control as well - eg extending more of the vmware api ? :wink: my goal is to standby hosts which are not needed for saving power but spinning up as i start my day.

1 Like