Add more clear description of unit (#15370)

it was not clear from this documentation how the unit of the derivative sensor is set if the "unit" parameter is not set. This PR should fix that
This commit is contained in:
blissarts 2020-10-23 22:54:40 +02:00 committed by GitHub
parent be15ab6d55
commit 4f7ea4d127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,12 +49,12 @@ unit_prefix:
default: None
type: string
unit_time:
description: SI unit of time of the derivative. Available units are s, min, h, d.
description: SI unit of time of the derivative. Available units are s, min, h, d. If this parameter is set, the attribute **unit_of_measurement** will be set like x/y where x is the unit of the sensor given via the **source** parameter and y is the value given here.
required: false
default: h
type: string
unit:
description: Unit of Measurement to be used for the derivative.
description: Unit of Measurement to be used for the derivative. This will overwrite the automatically set **unit_of_measurement** as explained above.
required: false
type: string
time_window:
@ -78,6 +78,6 @@ sensor:
source: sensor.temperature
name: Temperature change per hour
round: 1
unit_time: h
unit_time: h # the resulting "unit_of_measurement" will be °C/h if the sensor.temperate has set °C as it's unit
time_window: "00:30:00" # we look at the change over the last half hour
```