Simulated
The simulated
integration has been deprecated and will be removed in 2025.1
The simulated
sensor platform provides a simulated sensor that generates a time-varying signal V(t)
given by the function
V(t) = M + A sin((2 pi (t - t_0) / w) + P) + N(s)
where:
-
M = the mean
value of the sensor -
A = the amplitude
of the periodic contribution - t = the time when a value is generated
- t_0 = the time when the sensor is started
-
w = the time period
in seconds for a single complete cycle of the periodic contribution -
P = the phase
offset to add to the periodic contribution, in units of degrees -
N(s) = the random Gaussian noise
with spread s
The output will be limited to 3 decimals.
Configuration
To add a simulated sensor to your installation, add the following to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file:
sensor:
- platform: simulated
Configuration Variables
The time in seconds for one complete oscillation of the periodic contribution.
The phase offset (in degrees) to apply to the periodic component.
The seed
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
Example
To give an example of simulating real world data, a simulated relative humidity sensor (in %) can be added using the following configuration:
sensor:
- platform: simulated
name: "simulated relative humidity"
unit: "%"
amplitude: 0 # Turns off the periodic contribution
mean: 50
spread: 10
seed: 999
relative_to_epoch: false