Please help
I’m running HA in Synology Docker and Synology was running as a VM in ESXI.
I have setup BMC and able to access via Web to read all sensor data.
And also I have tried to create a CentOS Linux in VM and install IPMITool and able to get the sensor data by using the following command.
ipmitool -I lanplus -H 192.168.0.170 -U ADMIN -P ADMIN sdr entity 3.1 | cut -c 38-40
Now my questions is how can I let HA to read the sensor data.
I have tried to use Command line Sensor but failed.
And Synology cannot install IPMItools, docker container also cannot install IPMItools.
I’m also think how to get the sensor data on CentOS and then send to mqtt server on Synology.
But not sure how to write the script.
Anyone has any solutions?
Thanks
Hello, did you ever find a solution? I am having the same issue. I can run it manually but does not run as a command_line sensor via YAML
Hi
Yes. I installed mqtt client in Linux and create a script to read sensor data via IPMI and send to MQTT server on synology.
Then create a CORN job to auto do this every 5 seconds
Thanks for the reply. Would you mind sharing your script with me? Any help would be greatly appreciated.
Thanks
#!/bin/bash
SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin
MQTT=‘192.168.0.100’
TOPIC1=‘cpu’
TOPIC2=‘PCH’
TOPIC3=‘System’
TOPIC4=‘VRM’
PAYLOAD1=$(ipmitool -I lanplus -H 192.168.0.110 -U ADMIN -P 1111111 sdr entity 3.1 | cut -c 38-40)
PAYLOAD2=$(ipmitool -I lanplus -H 192.168.0.110 -U ADMIN -P 1111111 sdr entity 7.3 | cut -c 38-40)
PAYLOAD3=$(ipmitool -I lanplus -H 192.168.0.110 -U ADMIN -P 1111111 sdr entity 7.1 | cut -c 38-40)
PAYLOAD4=$(ipmitool -I lanplus -H 192.168.0.110 -U ADMIN -P 1111111 sdr entity 8.1 | cut -c 38-40)
mosquitto_pub -r -t “$TOPIC1” -m “$PAYLOAD1” -h “$MQTT” -u “rex” -P “22222222”
mosquitto_pub -r -t “$TOPIC2” -m “$PAYLOAD2” -h “$MQTT” -u “rex” -P “22222222”
mosquitto_pub -r -t “$TOPIC3” -m “$PAYLOAD3” -h “$MQTT” -u “rex” -P “22222222”
mosquitto_pub -r -t “$TOPIC4” -m “$PAYLOAD4” -h “$MQTT” -u “rex” -P “22222222”
22222 is your mqtt server password
Cron Job
#Edit crontab file
sudo crontab -e
#below example request to run every 1 min
*/1 * * * * cd /home/admin/Desktop && sh ipmi-mqtt.sh>>impi-contab.log
1 Like
Perfect, thanks for the help. Ok I have Ubuntu install MQTT client and looks like I can send the data and run the script.
Now how do I get it into a sensor in HA ?
Thanks
Nevermind, that was the easy part, I have a new Entity CPU Temp. Now for the rest. Search before Typing, I know Thanks again!
- platform: mqtt
name: "CPU"
state_topic: "cpu"
unit_of_measurement: '°C'
- platform: mqtt
name: "PCH"
state_topic: "PCH"
unit_of_measurement: '°C'
- platform: mqtt
name: "System"
state_topic: "System"
unit_of_measurement: '°C'
- platform: mqtt
name: "VRM"
state_topic: "VRM"
unit_of_measurement: '°C'