Slightly clarify that the Integration inputs must be of device_class: power in order to create a device_class: energy integration (#22325)

This commit is contained in:
Daniel O'Connor 2022-04-10 20:51:37 +09:30 committed by GitHub
parent 078ba3b452
commit 534bb1a402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,7 +101,7 @@ The unit of `source` together with `unit_prefix` and `unit_time` is used to gene
An integration sensor is quite useful in energy billing scenarios since energy is generally billed in kWh and many sensors provide power in W (Watts).
If you have a sensor that provides you with power readings in Watts (uses W as `unit_of_measurement`), then you can use the `integration` sensor to track how much energy is being spent. Take the next manual YAML configuration as an example:
If you have a sensor that provides you with power readings in Watts (uses W as `unit_of_measurement`, `device_class` of `power`), then you can use the `integration` sensor to track how much energy is being spent. Take the next manual YAML configuration as an example:
```yaml
sensor:
@ -112,4 +112,4 @@ sensor:
round: 2
```
This configuration will provide you with `sensor.energy_spent` which will have your energy in kWh.
This configuration will provide you with `sensor.energy_spent` which will have your energy in kWh, as a `device_class` of `energy`.