home-assistant.io/source/_components/sensor.random.markdown
Robin 8b990582dd Clarify distribution of random values (#4614)
Clarify that values drawn produce a discrete uniform distribution, and not for example a normal (or bell shaped) distribution. I intend to implement a random physics sensor which will return a bell distribution and this edit will avoid confusion.
2018-02-15 18:47:16 +01:00

1.5 KiB

layout, title, description, date, sidebar, comments, sharing, footer, logo, ha_category, ha_iot_class, ha_release
layout title description date sidebar comments sharing footer logo ha_category ha_iot_class ha_release
page Random Sensor Instructions how to integrate random number sensors into Home Assistant. 2016-10-30 12:10 true false true true home-assistant.png Sensor Local Polling 0.32

The random sensor platform is creating random sensor values (integers) out of a given range. Returned values form a discrete uniform distribution, meaning that each integer value in the range configured is equally likely to be drawn. This can be useful if you want to test automation rules. It generates a new value every time it is polled.

To enable the random sensor, add the following lines to your configuration.yaml:

# Example configuration.yaml entry
sensor:
  - platform: random

{% configuration %} name: description: Name to use in the frontend. required: false type: string default: Random Sensor minimum: description: Lower limit for the values. required: false type: string default: 0 maximum: description: Upper limit for the values. required: false type: int default: 20 unit_of_measurement: description: Defines the units of measurement of the sensor, if any. required: false type: string {% endconfiguration %}

See the entity component options to control how often the main component polls the random sensor. The default is 30 seconds.