mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 00:36:49 +00:00
[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:
parent
4a9e3258f5
commit
28a2cba709
@ -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 %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user