1# sensors
2
3## Description
4An array of sensor objects that make up the fan enclosure object. The sensors are what's monitored to determine the functional state of the fan.
5
6A sensor's functional range is determined by the following equation(where *[target]* is current requested target of the fan):
7* Minimum = ([target] * (100 - [`deviation`](deviation.md)) / 100) * `factor` + `offset`
8* Maximum = ([target] * (100 + [`deviation`](deviation.md)) / 100) * `factor` + `offset`
9
10Therefore, a fan sensor must be above the minimum and less than the maximum to be deemed functional.
11
12## Attribute Value(s)
13* `name` - string
14  * The name of the fan tach sensors located under the
15`/xyz/openbmc_project/sensors/fan_tach` D-Bus path.
16* `has_target` - boolean
17  * Whether this sensor D-Bus object contains the `Target` property or not.
18* `target_interface` - string (Optional)
19  * The D-Bus interface containing the `Target` property. This defaults to `xyz.openbmc_project.Control.FanSpeed` for RPM controlled fans or can be set to `xyz.openbmc_project.Control.FanPwm` for PWM controlled fans.
20* `target_path` - string (Optional)
21  * The D-Bus full object path containing the `Target` property. This defaults to `/xyz/openbmc_project/sensors/fan_tach`+`name`.
22* `factor` - double (Optional)
23  * A value to multiply the current target by to adjust the monitoring of this sensor due to how the hardware works. This sensor attribute is optional and defaults to 1.0.
24* `offset` - integer (Optional)
25  * A value to shift the current target by to adjust the monitoring of this sensor due to how the hardware works. This sensors attribute is optional and defaults to 0.
26
27## Example
28<pre><code>
29{
30  "fans": [
31    {
32      "inventory": "/system/chassis/motherboard/fan0",
33      "allowed_out_of_range_time": 30,
34      "functional_delay": 5,
35      "deviation": 15,
36      "num_sensors_nonfunc_for_fan_nonfunc": 1,
37      "monitor_start_delay": 30,
38      "fan_missing_error_delay": 20,
39      "nonfunc_rotor_error_delay": 0,
40      <b><i>"sensors": [
41        {
42          "name": "fan0_0",
43          "has_target": true,
44          "target_interface": "xyz.openbmc_project.Control.FanPwm",
45          "target_path": "/xyz/openbmc_project/control/fanpwm/PWM0"
46        },
47        {
48          "name": "fan0_1",
49          "has_target": false,
50          "factor": 1.45,
51          "offset": -909
52        }
53      ]</i></b>
54    }
55  ]
56}
57</code></pre>
58