You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add section to ReadMe.md for setting up for energy dashboard (#79)
* Update README.md
* Update TOC of ReadMe.md
* Changed chapter name in Readme
* Formal changes in enegry section in ReadMe
* Formal changes in energy section in ReadMe #2
Copy file name to clipboardExpand all lines: README.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,8 @@ Power sensors can be created for `light`, `switch`, `fan`, `binary_sensor`, `inp
24
24
-[Light model library](#light-model-library)
25
25
-[LUT data files](#lut-data-files)
26
26
-[Supported models](#supported-models)
27
+
-[Setting up for energy dashboard](#setting-up-for-energy-dashboard)
28
+
-[Creating energy groups](#creating-energy-groups)
27
29
-[Debug logging](#debug-logging)
28
30
29
31
## Installation
@@ -307,6 +309,51 @@ python3 measure.py
307
309
308
310
See the [list](docs/supported_models.md) of supported lights which don't need any manual configuration
309
311
312
+
## Setting up for energy dashboard
313
+
If you want to use this power sensors with the new [energy integration](https://www.home-assistant.io/blog/2021/08/04/home-energy-management/), you have to create a energy sensor which utilizes the power of the powercalc sensor. This can be done with the [Riemann integration integration](https://www.home-assistant.io/integrations/integration/), which calculates the energy and since release 2021.8 this integration can natively be used in the energy dashboard. An example configuration, which you have to copy into your `configuration.yaml`, can be seen below (assuming you have a powercalc sensor with entity_id `sensor.kingkong_power`:
314
+
315
+
````yaml
316
+
sensor:
317
+
- platform: integration
318
+
source: sensor.kingkong_power
319
+
name: kingkong_power_kWh
320
+
unit_prefix: k
321
+
round: 2
322
+
````
323
+
If you are tired of writing out all these configuration, you can use the template below. Just copy the template into the template section in the developer tools. Then this template creates the configuration of all the power sensors you have (so not just the powercalc ones) which you can copy to your `configuration.yaml` (or only the parts you need).
324
+
325
+
````yaml
326
+
{% for state in states -%}
327
+
{%- if state.attributes.unit_of_measurement == "W" and state.attributes.device_class == "power" -%}
328
+
- platform: integration
329
+
source: {{ state.entity_id }}
330
+
unit_prefix: k
331
+
round: 2
332
+
{% endif -%}
333
+
{%- endfor -%}
334
+
````
335
+
336
+
### Creating energy groups
337
+
If you want to sum up all energy usage from one category e.g. all of your servers, then create a powercalc sensor and an integration sensor for each of these servers like described in the section before. Then you create a template energy usage sensor which sums up all values of the energy sensors (a example sensor can be found below). It's essential to add the attributes `last_reset`, `state_class` and `device_class` because these are needed for the sensor to be compatible with the energy integration.
> **Don't** create a template sensor which sums up all values from the power sensors and use this sensor to create a energy sensor because this won't work as you would expect. It
354
+
> wouldn't update in regular bases and as a consequence wont be shown in the energy dashboard in the right timeslots.
0 commit comments