Read sensors through IPMI

Thanks for the answer…
I saw that option, but I am absolutely not sure about how to integrate it…
And… I found pretty strange nobody is using IPMI with HA…

Use the search function.

Thanks for the answer. What does it mean?

It means go to the top of this page and use the search function, there are at least 3 other threads here mentioning ipmi.

Now a sensor senses one thing. Create a command line for each quantity you want to measure. Then use the commandline sensor for each one.

If you have python experience you could write a IPMI (custom) component. There is python ipmi library that you could use. https://github.com/kontron/python-ipmi


Heiko

thanks guys!
I reached this result as suggested by nickrout:
ipmitool -I lanplus -H 192.168.2.97 -U ADMIN -P ADMIN sdr entity 8.1

with this output:
VcpuVRM Temp | 10h | ok | 8.1 | 52 degrees C

but
i am not able to just take the number of the temp: 52.
the template i am using:
value_template: ‘{{value | truncate (20) | multiply(0.001) | round(1) }}’

is giving me this result:
CPU Temperature ‘VcpuVRM Temp …’ °C

that means that i am able to truncate some part of the result but I cannot get what i want… the number of the temperature!!! :sob:

Any idea on how to do it? do I need to pass through a file?

@hthiery: I am really NOT familiar at all with python ipmi library… i could try… does it work also form extracting ipmi value from another server different from the one in which i run HA?

thanks very much guys…

Luca

How about adding the following to the end of the ipmitool line

|cut -d '|' -f 5|cut -d ' ' -f1

Or something like that! See https://linux.die.net/man/1/cut

Or if you want to do it in the template, take a look at this example

Guys… it woooooooooorks!!! exactly using cut and getting of all template!
Here the code in HA:

  • platform: command_line
    name: CPU temp
    command: ipmitool -I lanplus -H 192.168.2.97 -U ADMIN -P ADMIN sdr entity 3.1 | cut -c 38-40
    unit_of_measurement: “°C”

@nickrout thanks for all suggestion, now i will start having dun with some automation!!!
I will bother you again if I need help!

Luca

Not sure what will happen if temp goes under 10 or over 99.

I think is going to recognize it because i took 3 characters and the value is a number… actually I ask myself the same question… but I will test it and let you know…

Hello all, I know this is a old thread but I am not able to get ipmitool running through YAML. It works if I download it via apk and run in a terminal or SSH to the addon, not core. I read that Home Assistant runs in it own docker but I do not see where I can load the ipmitool so that it can run with automation. I get command not found in the server logs.

Thanks for anyone still out there and has this working.

What does it mean “running through YAML”?

Use the addon “ssh and web terminal”

In this setting line put the apk packages you need:

packages: []

Then the package will be installed into home assistant and you can use them in a commandline sensor.

When I try to add a sensor using the command_line platform it does not work. in the logs it says command not found. If I run the same command from a normal ssh or terminal session it works fine.

Trying now to see if I can call a script and pull the value into HA.

Thanks for the type but I still get

/bin/sh: ipmitool: not found

in the System ->Core Log Provider

Added to Terminal & SSH Configuration

packages:
  - ipmitool

Now I get this in the Server Supervisor log
21-01-11 15:30:09 WARNING (MainThread) [supervisor.addons.validate] Unknown options packages

and same for Core error ipmitool: not found

Thanks
Derek

and this in Terminal when trying to just test there

bash: ipmitool: command not found

There may have been some changes in the recent HA updates, but after giving up on trying to get ipmitool installed along side HA, I just created a MQTT client and wrote a script to update the sensors from another container.

an IPMI Integration would be awesome!

2 Likes

Hi!

I have implemented an ipmi connector integration for HAAS: GitHub - ateodorescu/home-assistant-ipmi: IPMI connector for Home Assistant

Enjoy!

1 Like