Author: Vijay Khemka vijaykhemka@fb.com; <vijay!>
Primary assignee: Vijay Khemka vijaykhemka@fb.com; <vijay!>
Created: 2020-05-13
There are some sensors in the system whose values are derived from actual sensor data and some other factor like fan speed for temperature sensors, some complex and non standard scale factors or some other algorithmic calculations. Some of Virtual sensor examples are:
This design will allow to generate a new virtual sensors which are defined to be specific manipulation/function of existing sensors.
None.
This should implement a new virtual sensor for every given sensor and update them as per changes in existing sensors. This implementation should provide
Create a D-bus service "xyz.openbmc_project.VirtualSensor" with object paths for each sensor: "/xyz/openbmc_project/sensor/temperature/sensor_name"
There is a JSON configuration file for name, old path and algorithm. For example,
{ "Name": "Virtual_Inlet_Temp", "Algo": "P1 + P2 + 5 - P3 * 0.1", "Params": { "P1": "/xyz/openbmc_project/sensor/temperature/"Inlet_Temp", "P2": "/xyz/openbmc_project/sensor/fan/fan_0", "P3": "200" }, "Thresholds": { "CriticalHigh": 90, "CriticalLow": 20, "WarningHigh": 70, "WarningLow": 30 } } Name: Name of virtual sensor Algo: An algorithm to be used to calculate value Params: It can be an existing/virtual sensor dbus path to read value or it can be a value to be used in calculation Thresholds: It has critical and warning high/low value to monitor sensor value and used as per sensor interface defined in phosphor-dbus-interfaces.
None
This application is monitoring existing sensors whenever they change values then only it will update this sensors so impact should be very minimal.
Testing can be done by monitoring data read from dbus interface over a period of time and also can see these data if it changes by comparing with given sensors.