Skip to content

Commit 4f7ea4d

Browse files
authored
Add more clear description of unit (home-assistant#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
1 parent be15ab6 commit 4f7ea4d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/_integrations/derivative.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ unit_prefix:
4949
default: None
5050
type: string
5151
unit_time:
52-
description: SI unit of time of the derivative. Available units are s, min, h, d.
52+
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.
5353
required: false
5454
default: h
5555
type: string
5656
unit:
57-
description: Unit of Measurement to be used for the derivative.
57+
description: Unit of Measurement to be used for the derivative. This will overwrite the automatically set **unit_of_measurement** as explained above.
5858
required: false
5959
type: string
6060
time_window:
@@ -78,6 +78,6 @@ sensor:
7878
source: sensor.temperature
7979
name: Temperature change per hour
8080
round: 1
81-
unit_time: h
81+
unit_time: h # the resulting "unit_of_measurement" will be °C/h if the sensor.temperate has set °C as it's unit
8282
time_window: "00:30:00" # we look at the change over the last half hour
8383
```

0 commit comments

Comments
 (0)