Custom Component - ESXi Stats

Any chance we can change the values it reports for memory for each VM? Right now, it shows memory allocated and memory used. Neither value is really that important. What would really be useful is the current active memory.

Yes. Submit an issue request via github please.

1 Like

You can find configuration steps in documentation. https://github.com/wxt9861/esxi_stats#configuration-options

yeah I know that page.
Ok apparently there was something wrong and I didnā€™t found the ESXi stats in the integration page but now I do.

Hi there,

is it possible to get all vm ipā€™s and not only the one on the primary nic?

greetings

hi all - no bug or question ā€¦ just wanted to give an headsup i tested this component with vCenter 8.0 and so far it works ā€¦ i get sensor information in HAā€¦didnt test the power controls yet ā€¦but i assume APIā€™s stay the same so functionality should workā€¦

3 Likes

Hello,

Great job with these components.
Just a question (Iā€™m new to home assistant, Iā€™m really a beginner) and I would like to know if itā€™s possible to have ā€œused_space_gbā€ for datastores?

I want to create a graph with the remaining space on the datastore but for that I need to have the information of the space already used. Or is there another way to do it?

Thank you for your help ! :slight_smile:

Yes, integration provides sensor sensor.esxi_datastore_xxx (where xxx is the name of datastore from ESXi host) that gives a lot of information about datastore usage via attributes). Here is example from my config:

Thank you for this answer.

But there is no ā€œused_space_gbā€ attribute for datastores.
Is there any way to get it OR to get it using a formula (total - free = used) and if so, where and how can I do it?

Thanks !

Yes, you need to create template sensor for this. Here is the sample of sensor I created for my datastore (and sensors I use to provide some usage data directly as state, instead of attirbutes and with additional convertion to GB):

sensor:
  - platform: template
    sensors:
      esx_datastore_used_space_gb_1:
        friendly_name: "ESXi Host LocalDatastore Used"
        value_template: >-
          {{ states['sensor.esxi_datastore_local'].attributes.total_space_gb - states['sensor.esxi_datastore_local'].attributes.free_space_gb }}
        icon_template: mdi:harddisk                      
      esx_datastore_total_space_gb_1:
        friendly_name: "ESXi Host Local Datastore Total"
        value_template: >-
          {{ states['sensor.esxi_datastore_local'].attributes.total_space_gb }}
        icon_template: mdi:harddisk                      
      esx_datastore_used_space_1:
        friendly_name: "ESXi Host Local Datastore % Used"
        value_template: >-
          {{ (states('sensor.esx_datastore_used_space_gb_1') |float(default=0) / states('sensor.esx_datastore_total_space_gb_1') | float(default=0) * 100) | round(0) }}
        icon_template: mdi:harddisk 

Ok nice ! thank you!

Can I ask you a huge favor.
If I give you the following information, can you write me the template that would allow me to get ā€œused_space_gbā€.
I will use this first template as a learning base to understand how it works.

Thank you for your help

This would be:

sensor:
  - platform: template
    sensors:
      esx_datastore_used_space_gb_1:
        friendly_name: "ESXi Host LocalDatastore Used"
        value_template: >-
          {{ states['sensor.esxi_datastore_datastorewv'].attributes.total_space_gb - states['sensor.esxi_datastore_datastorewv'].attributes.free_space_gb }}
        icon_template: mdi:harddisk      

Ok je comprends, un tout grand merci pour ton aide !

I think this is what state_attr is for no?

sensor:
  - platform: template
    sensors:
      esx_datastore_used_space_gb_1:
        friendly_name: "ESXi Host LocalDatastore Used"
        value_template: >-
          {{ state_attr('sensor.esxi_datastore_datastorewv','total_space_gb') - state_attr('sensor.esxi_datastore_datastorewv','free_space_gb') }}
        icon_template: mdi:harddisk

Yes, just different notationā€¦ I created that sensors looong time ago :slight_smile:

1 Like

Hi

First, thanks for this excelent Component it really makes sense with APC USB SAI with NUT Server and NUT Client to do this automation:

Now the question:

Is it possible to shutdown the ESXI HOST with or without delay? It would be beatiful to turn off the vmā€™s and then the host.

Host shutdown service is added in 0.7beta (along with other additions / improvements).

2 Likes

thanks!!

Iā€™m still newb with HA, its possible to install 0.7beta with HACS?

Go to HACS and click on integration tile. From upper right corner 3-dots icon choos Redownload and activate Show beta versions:
Screenshot 2023-05-02 at 10.57.37

1 Like

done, thanks a lot!!