[Utility Meter] Add template sensors to DSMR example (#9602)

* Add template sensors to DSMR example

Add a daily and monthly template sensor to DSMR example that sum peak and off peak usage

* Try new syntax

* Surround jinja in yaml with raw
This commit is contained in:
Robert 2019-06-19 08:12:09 +02:00 committed by Franck Nijhof
parent 4a9e3258f5
commit 28a2cba709

View File

@ -184,3 +184,23 @@ utility_meter:
source: sensor.gas_consumption
cycle: monthly
```
Additionally, you can add template sensors to compute daily and monthly total usage.
{% raw %}
```yaml
sensor:
- platform: template
sensors:
daily_power:
friendly_name: Daily Power
icon: mdi:counter
unit_of_measurement: kWh
value_template: {{ states('sensor.daily_power_offpeak')|float + states('sensor.daily_power_peak')|float }}
monthly_power:
friendly_name: Monthly Power
icon: mdi:counter
unit_of_measurement: kWh
value_template: {{ states('sensor.monthly_power_offpeak')|float + states('sensor.monthly_power_peak')|float }}
```
{% endraw %}