Adding internal pc sensors to Domoticz on Windows systems

From Domoticz
Jump to: navigation, search

As of version 1270 it is possible to view internal pc sensor data in Domoticz. To supply this data, open hardware monitor needs to be installed.

Download it from: [1]

Unzip the file anywhere you like (program files recommended), start the executable. Inside the preferences make sure that openhardwaremonitor starts with windows, minimized if you like, etc. When openhardwaremonitor starts to retrieve data, it is also stored in the WMI (Windows Management Instrumentation) tables. Domoticz uses those tables to retrieve the data, this way there is no need for specific pc sensor support in Domoticz; if openhardwaremonitor supports it, we can support it.

Once openhardwaremonitor is running and has added data to the WMI table, Domoticz will automatically pick up the supplied data. Then a new hardware device is added (Motherboard). On this hardware id the detected sensor devices are added, and they appear in unused devices. They can then be added to the temperature and utility (for load sensors) tabs. At anytime the hardware id or devices can be deleted, but they will be added again when Domoticz picks them up in the WMI tables. The WMI tables are static, even if openhardwaremonitor is not running the last values remain in the WMI table. Domoticz however checks if the openhardwaremonitor.exe process is present, and if so adds new data to the sensor database. This way if openhardwaremonitor.exe is not running, the sensors will go red in the interface just like any other sensor.

Supported sensors are all sensors of type "Temperature" (e.g. cpu, southbridge temp) and "Load" (e.g. percentage disk/memory used, cpu core usage).

Note: if you were an early adopter of this code (pre 1270), you might have a hardwaredevice "Internal sensors". This has later been named "Motherboard" which you should also see. Please delete the "Internal sensors" hardware device from your system.

If you want to install openhardwaremonitor as a service, it is recommended to use nssm instead of srvany. There are cases where openhardwaremonitor crashes, but srvany/instsrv does not report this to the service manager. Windows still thinks the service is ok but the app is no longer running, and the sensors go red in Domoticz. By using nssm (nssm.cc) you have the option to restart the program in case of a crash.

Edit: the WMI id's seem to change over time, on some machines after a long time on others very fast, so using the WMI id is not a good option. The code now looks at the identifier field in the WMI table, which looks like "/intelcpu/0/load/2" or "/ram/data/0". As of version 1327 these id's are used. After updating please delete all other devices from hardware "Motherboard" and use the new ones. There is no data conversion in the fix, we start from scratch, hopefully for the last time.