Virtual sensors
Is there currently a virtual sensor implementation? If not, is anyone working on one?
Virtual sensors allow you to define a sensor as an equation atop other sensors, with each dependent sensor specifying its polling rate. For example: PeakDriveBayTemperature = Max(DriveBayTemperature[1…4,20Hz]) would poll the temperature of sensors 1-4 at 20 Hz and promote the max temperature seen.
Wilfred
Quoted 4 lines · Wilfred Smith
Is there currently a virtual sensor implementation? If not, is anyone working on one?
Virtual sensors allow you to define a sensor as an equation atop other sensors, with each dependent sensor specifying its polling rate. For example: PeakDriveBayTemperature =
Max(DriveBayTemperature[1…4,20Hz])would poll the temperature of sensors 1-4 at 20 Hz and promote the max temperature seen.
I don't believe there's anything that implements that feature exactly, but dbus-sensors has the CFM and Exit air sensors, which do essentially what you describe, watch for other sensors values, and post a value of their own after running some math on it. In the exit air case, it's looking at power readings as well as fan speeds to generate CFM and Exit air temperature sensors.
https://github.com/openbmc/dbus-sensors/blob/master/src/ExitAirTempSensor.cpp
It would be easy enough to use that as a model to add your math driven sensors above, and add the appropriate definitions to entity manager to enable it for tioga.
One thing to know, at this point none of the virtual sensors poll on a timer, they add a watch and receive all sensor updates based on that, which reduces the dbus traffic a little, as events are only sent on value change, not every time the sensor is polled.
You could certainly poll them, but I think the match expression is easier.