home-assistant.io/source/_components/sensor.random.markdown
wildcomputations c83d11a0b4 Describe when the random sensor changes value (#3064)
* Document update frequency

Documented that the random number changes every 30 seconds
according to http://fabian-affolter.ch/blog/random-sensor/

* Learned the source of the 30s polling frequency
2017-07-27 11:39:02 +02:00

1.2 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. 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 variables:

  • name (Optional): Name of the sensor to use in the frontend. Defaults to Random Sensor.
  • minimum (Optional): Lower limit for the values. Defaults to 0.
  • maximum (Optional): Upper limit for the values. Defaults to 20.
  • unit_of_measurement (Optional): Defines the units of measurement of the sensor, if any.

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