xref: /openbmc/phosphor-power/phosphor-regulators/docs/config_file/sensor_monitoring.md (revision 6151c286a8737f22e5297ff556f7304bd548ed0a)
1# sensor_monitoring
2
3## Description
4
5Defines how to read the sensors for a voltage rail, such as voltage output,
6current output, and temperature. Sensor values are measured, actual values
7rather than target values.
8
9Sensors will be read once per second. The sensor values will be stored on D-Bus
10on the BMC, making them available to external interfaces like Redfish.
11
12The [pmbus_read_sensor](pmbus_read_sensor.md) action is used to read one sensor.
13To read multiple sensors, multiple "pmbus_read_sensor" actions need to be
14executed.
15
16The "pmbus_read_sensor" actions can be specified in two ways:
17
18- Use the "rule_id" property to specify a standard rule to run.
19- Use the "actions" property to specify an array of actions that are unique to
20  this device.
21
22## Properties
23
24| Name     |      Required       | Type                          | Description                                                 |
25| :------- | :-----------------: | :---------------------------- | :---------------------------------------------------------- |
26| comments |         no          | array of strings              | One or more comment lines describing the sensor monitoring. |
27| rule_id  | see [notes](#notes) | string                        | Unique ID of the [rule](rule.md) to execute.                |
28| actions  | see [notes](#notes) | array of [actions](action.md) | One or more actions to execute.                             |
29
30### Notes
31
32- You must specify either "rule_id" or "actions".
33
34## Examples
35
36```json
37{
38  "comments": ["Read all sensors supported by the IR35221 regulator"],
39  "rule_id": "read_ir35221_sensors_rule"
40}
41```
42
43```json
44{
45  "comments": [
46    "Only read sensors if version register 0x75 contains 2.",
47    "Earlier versions produced invalid sensor values."
48  ],
49  "actions": [
50    {
51      "if": {
52        "condition": {
53          "i2c_compare_byte": { "register": "0x75", "value": "0x02" }
54        },
55        "then": [{ "run_rule": "read_sensors_rule" }]
56      }
57    }
58  ]
59}
60```
61