summaryrefslogtreecommitdiff
path: root/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor
diff options
context:
space:
mode:
Diffstat (limited to 'meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor')
-rw-r--r--meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/config-virtual-sensor.json123
-rw-r--r--meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace16
2 files changed, 139 insertions, 0 deletions
diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/config-virtual-sensor.json b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/config-virtual-sensor.json
new file mode 100644
index 000000000..6e729108a
--- /dev/null
+++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/config-virtual-sensor.json
@@ -0,0 +1,123 @@
+[
+ {
+ "Desc": {
+ "Name": "i2cool_0",
+ "SensorType": "temperature"
+ },
+ "Threshold": {
+ "CriticalHigh": 35,
+ "CriticalLow": 0,
+ "WarningHigh": 35,
+ "WarningLow": 0
+ },
+ "Params": {
+ "DbusParam": [
+ {
+ "ParamName": "inlet",
+ "Desc": {
+ "Name": "inlet",
+ "SensorType": "temperature"
+ }
+ },
+ {
+ "ParamName": "fan0",
+ "Desc": {
+ "Name": "fan0",
+ "SensorType": "fan_tach"
+ }
+ },
+ {
+ "ParamName": "fan1",
+ "Desc": {
+ "Name": "fan1",
+ "SensorType": "fan_tach"
+ }
+ }
+ ]
+ },
+ "Expression": "round(inlet - 1 - (1.8 * 3700 / avg(fan0, fan1)))"
+ },
+ {
+ "Desc": {
+ "Name": "i2cool_1",
+ "SensorType": "temperature"
+ },
+ "Threshold": {
+ "CriticalHigh": 70,
+ "CriticalLow": 0,
+ "WarningHigh": 70,
+ "WarningLow": 0
+ },
+ "Params": {
+ "DbusParam": [
+ {
+ "ParamName": "outlet_0",
+ "Desc": {
+ "Name": "outlet_0",
+ "SensorType": "temperature"
+ }
+ },
+ {
+ "ParamName": "fan0",
+ "Desc": {
+ "Name": "fan0",
+ "SensorType": "fan_tach"
+ }
+ },
+ {
+ "ParamName": "fan1",
+ "Desc": {
+ "Name": "fan1",
+ "SensorType": "fan_tach"
+ }
+ }
+ ]
+ },
+ "Expression": "round(outlet_0 - if(avg(fan0, fan1) >= 7400, 3 * 9558 / avg(fan0, fan1), 7 * 3700 / avg(fan0, fan1) - 2))"
+ },
+ {
+ "Desc": {
+ "Name": "i2cool_2",
+ "SensorType": "temperature"
+ },
+ "Threshold": {
+ "CriticalHigh": 70,
+ "CriticalLow": 0,
+ "WarningHigh": 70,
+ "WarningLow": 0
+ },
+ "Params": {
+ "DbusParam": [
+ {
+ "ParamName": "outlet_1",
+ "Desc": {
+ "Name": "outlet_1",
+ "SensorType": "temperature"
+ }
+ },
+ {
+ "ParamName": "fb_fan0",
+ "Desc": {
+ "Name": "fb_fan0",
+ "SensorType": "fan_tach"
+ }
+ },
+ {
+ "ParamName": "fb_fan1",
+ "Desc": {
+ "Name": "fb_fan1",
+ "SensorType": "fan_tach"
+ }
+ },
+ {
+ "ParamName": "fb_fan2",
+ "Desc": {
+ "Name": "fb_fan2",
+ "SensorType": "fan_tach"
+ }
+ }
+ ]
+ },
+ "Expression": "round(outlet_1 - if(avg(fb_fan0, fb_fan1, fb_fan2) >= 7400, 1 * 9558 / avg(fb_fan0, fb_fan1, fb_fan2), 1))"
+ }
+]
diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace
new file mode 100644
index 000000000..8068d3bd2
--- /dev/null
+++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace
@@ -0,0 +1,16 @@
+[Unit]
+Description=Virtual sensors
+Wants=obmc-mapper.target
+After=obmc-mapper.target
+
+[Service]
+ExecStartPre=mapper wait /xyz/openbmc_project/sensors/temperature/inlet
+ExecStartPre=mapper wait /xyz/openbmc_project/sensors/temperature/outlet_0
+ExecStartPre=mapper wait /xyz/openbmc_project/sensors/temperature/outlet_1
+ExecStart=/usr/bin/virtual-sensor
+Type=dbus
+BusName=xyz.openbmc_project.VirtualSensor
+SyslogIdentifier=phosphor-virtual-sensor
+
+[Install]
+WantedBy=multi-user.target