1# phosphor-virtual-sensor 2 3phosphor-virtual-sensor reads the configuration file 4`virtual_sensor_config.json` from one of three locations: 5 61. The current directory. 72. `/var/lib/phosphor-virtual-sensor` 83. `/usr/share/phosphor-virtual-sensor` 9 10By default the repository will install a sample config into (3). 11 12There are two types of data in this file. 13 14## virtual sensor configuration information 15 16See `virtual_sensor_config.json` in this repository for an example. Sensors 17added this way can use any expression that is accepted by exprtk. 18 19## information to get a virtual sensor configuraton from D-Bus 20 21For example: 22 23```json 24{ 25 "Desc": { 26 "Config": "D-Bus", 27 "Type": "ModifiedMedian" 28 } 29} 30``` 31 32Sensors added this way can only use a set of restricted calculations. Currently 33the only type supported is `modifiedMedian`. 34 35The virtual sensor configuration information needs to be added into the relevant 36hardware configuration file in entity-manager. This method of adding a virtual 37sensor allows a recipe that builds for different hardware configurations to have 38different virtual sensors for each configuration. 39 40The virtual sensor configuration in entity manager follows a different format to 41the JSON in `virtual_sensor_config.json` (specified in 42[entity-manager/schemas/VirtualSensor.json](https://github.com/openbmc/entity-manager/blob/master/schemas/virtual_sensor.json)). 43