From 5276a78d6c46d7a2b97b0e8e1be58691130c0939 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 2 Jun 2018 15:04:33 +0200 Subject: [PATCH] Update layout (#5480) --- source/_components/sensor.simulated.markdown | 97 ++++++++++---------- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/source/_components/sensor.simulated.markdown b/source/_components/sensor.simulated.markdown index 4667b9ff396..652d11b7dad 100644 --- a/source/_components/sensor.simulated.markdown +++ b/source/_components/sensor.simulated.markdown @@ -13,7 +13,7 @@ ha_iot_class: "Local Polling" ha_release: 0.65 --- -This component provides a simulated sensor that generates a time-varying signal ```V(t)``` given by the [function](https://en.wikipedia.org/wiki/Sine_wave): +The `simulated` sensor platform provides a simulated sensor that generates a time-varying signal ```V(t)``` given by the [function](https://en.wikipedia.org/wiki/Sine_wave): ``` V(t) = M + A sin((2 pi (t - t_0) / w) + P) + N(s) @@ -29,14 +29,61 @@ where: - **P** = the [phase](https://en.wikipedia.org/wiki/Phase_(waves)) offset to add to the periodic contribution, in units of degrees - **N(s)** = the random [Gaussian noise](https://en.wikipedia.org/wiki/Gaussian_noise) with spread **s** -A simulated sensor with default values can be added to home-assistant using the following config: +## {% linkable_title Configuration %} + +To add a simulated sensor to your installation, add the following to your `configuration.yaml` file: ```yaml sensor: - platform: simulated ``` -To give an example of simulating real world data, a simulated relative humidity sensor (in %) can be added using the following config: +{% configuration %} +name: + description: The name of the sensor. + required: false + default: simulated + type: string +unit: + description: The unit to apply. + required: false + default: value + type: string +amplitude: + description: The amplitude of periodic contribution. + required: false + default: 1 + type: float +mean: + description: The mean level of the sensor. + required: false + default: 0 + type: float +period: + description: The time in seconds for one complete oscillation of the periodic contribution. + required: false + default: 0 + type: seconds +phase: + description: The phase offset (in degrees) to apply to the periodic component. + required: false + default: 0 + type: float +seed: + description: The [seed](https://docs.python.org/3.6/library/random.html#random.seed) value for the random noise component. + required: false + default: 999 + type: int +spread: + description: The spread is the range of the randomly distributed values about their mean. This is sometimes referred to as the Full Width at Half Maximum ([FWHM](https://en.wikipedia.org/wiki/Full_width_at_half_maximum)) of the random distribution. + required: false + default: None + type: float +{% endconfiguration %} + +## {% linkable_title Example %} + +To give an example of simulating real world data, a simulated relative humidity sensor (in %) can be added using the following configuration: ```yaml sensor: @@ -48,47 +95,3 @@ sensor: spread: 10 seed: 999 ``` - -Configuration variables: -{% configuration %} -name: - description: The name of the sensor - required: false - default: Defaults to 'simulated' - type: string -unit: - description: The unit to apply - required: false - default: Defaults to 'value' - type: string -amplitude: - description: The amplitude of periodic contribution - required: false - default: 1 - type: float -mean: - description: The mean level of the sensor - required: false - default: 0 - type: float -period: - description: The time in seconds for one complete oscillation of the periodic contribution - required: false - default: 0 - type: seconds -phase: - description: The phase offset (in degrees) to apply to the periodic component - required: false - default: 0 - type: float -seed: - description: The [seed](https://docs.python.org/3.6/library/random.html#random.seed) value for the random noise component - required: false - default: 999 - type: int -spread: - description: The spread is the range of the randomly distributed values about their mean. This is sometimes referred to as the Full Width at Half Maximum ([FWHM](https://en.wikipedia.org/wiki/Full_width_at_half_maximum)) of the random distribution - required: false - default: None - type: float -{% endconfiguration %}