ateodorescu / home-assistant-ipmi

IPMI connector for Home Assistant
MIT License
39 stars 10 forks source link

Feature Request: ability to control fan speeds. #16

Closed Adumbbird closed 1 year ago

Adumbbird commented 1 year ago

Hello! Using the home-assistant-ipmi and ipmi-server, I'm able to pull infromation from idrac 8 on my dell r730xd.

I'm looking for a way to control the fan speeds as it's tooo loud. I know the commands to use, I'm just wanting a way to use hassio to manage the speeds manually.

source: https://www.dell.com/community/en/conversations/poweredge-hardware-general/how-to-quiet-r730xd-fans-lower-idle-fan-speed/647fa279f4ccf8a8de7fd4ad

ateodorescu commented 1 year ago

Hi! I could change the ipmi-server addon to allow running any ipmitool commands. This way you could just create your own entities in hass (ie rest entities) that would run those commands. Would that help you out?

Adumbbird commented 1 year ago

That would be perfect!

ateodorescu commented 1 year ago

So, if you use the latest code of the ipmi-server then you will be able to run such queries on the webserver: http://YOUR_HASS_SERVER_IP:9595/command?params=-I%20lanplus%20-H%20YOUR_IPMI_SERVER_IP%20-U%20ADMIN%20-P%20YOUR_PASSWORD%20bmc%20info which translates to ipmitool -I lanplus -H YOUR_IPMI_SERVER_IP -U YOUR_USER -P YOUR_PASSWORD bmc info. %20 stands for space (url encoding). You get back a json with success and output keys. Basically you can provide any params you want to ipmitool. Hope this helps you. Let me know if it works for you.

Adumbbird commented 1 year ago

perfect! just so its in this thread, I utilized the rest_command to use the queries and put this in my config.yaml

rest_command:
  disable_dell_cooling:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20%20raw%200x30%200xce%200x00%200x16%200x05%200x00%200x00%200x00%200x05%200x00%200x01%200x00%200x00"
  enable_rpm_cooling:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20%20raw%200x30%200x30%200x01%200x00"
  set_rpm_eighty:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20%20raw%200x30%200x30%200x02%200xff%200x50"
  set_rpm_fifty:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20%20raw%200x30%200x30%200x02%200xff%200x32"
  set_rpm_thirty:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20%20raw%200x30%200x30%200x02%200xff%200x1E"
  set_rpm_twentyfive:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20%20raw%200x30%200x30%200x02%200xff%200x19"
  set_rpm_twenty:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20%20raw%200x30%200x30%200x02%200xff%200x14"
  set_rpm_seventeen:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20%20raw%200x30%200x30%200x02%200xff%200x11"
  set_rpm_fifteen:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20%20raw%200x30%200x30%200x02%200xff%200xF"
  set_rpm_twelve:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20%20raw%200x30%200x30%200x02%200xff%200xC"
  set_rpm_ten:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20%20raw%200x30%200x30%200x02%200xff%200xA"
  set_rpm_seven:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20raw%200x30%200x30%200x02%200xff%200x7"
  set_rpm_five:
    url: "http://{hassip}:9595/command?params=-I%20lanplus%20-H%20{idracip}%20-U%20{idracadmin}%20-P%20{idracpwinurlencoded}%20%20raw%200x30%200x30%200x02%200xff%200x5"
deltamelter commented 11 months ago

{hassip} {idracip} {idracadmin}

are these built in variables, taken from he integration or need to e added someplace? I have several dell devices than all respond to these commands

ateodorescu commented 11 months ago

{hassip} {idracip} {idracadmin}

are these built in variables, taken from he integration or need to e added someplace? I have several dell devices than all respond to these commands

In order to control your server's fans you need to create your own rest commands which you can attach to switches. @Adumbbird has shown us how to define those rest commands and if you want to use that then you need to replace {hassip}, {idracip} and {idracadmin} with your own values.

deltamelter commented 11 months ago

In order to control your server's fans you need to create your own rest commands which you can attach to switches. @Adumbbird has shown us how to define those rest commands and if you want to use that then you need to replace {hassip}, {idracip} and {idracadmin} with your own values.

OK, So they need to be duplicated for each dell server I add...