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* `factor` - double (Optional)
21  * 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.
22* `offset` - integer (Optional)
23  * 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.
24
25## Example
26<pre><code>
27{
28  "fans": [
29    {
30      "inventory": "/system/chassis/motherboard/fan0",
31      "allowed_out_of_range_time": 30,
32      "functional_delay": 5,
33      "deviation": 15,
34      "num_sensors_nonfunc_for_fan_nonfunc": 1,
35      "monitor_start_delay": 30,
36      "fan_missing_error_delay": 20,
37      "nonfunc_rotor_error_delay": 0,
38      <b><i>"sensors": [
39        {
40          "name": "fan0_0",
41          "has_target": true,
42          "target_interface": "xyz.openbmc_project.Control.FanPwm"
43        },
44        {
45          "name": "fan0_1",
46          "has_target": false,
47          "factor": 1.45,
48          "offset": -909
49        }
50      ]</i></b>
51    }
52  ]
53}
54</code></pre>
55