mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-07 17:36:50 +00:00
Update pvoutput.markdown (#11965)
* Update pvoutput.markdown
Replaced some single quotes with double quotes in the pvoutput template. Current template throwing errors similar to these (line numbers will vary based on configuration.yaml file:
```
Configuration invalid
CHECK CONFIG
Error loading /config/configuration.yaml: while parsing a block mapping
in "/config/configuration.yaml", line 408, column 9
expected <block end>, but found '<scalar>'
in "/config/configuration.yaml", line 408, column 56
```
Updated template configuration fixes these errors.
* ✏️ Tweak
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
109f51dc4f
commit
25f42c7745
@ -47,6 +47,8 @@ It's recommended to set `scan_interval:` according to a value greater than 60 se
|
||||
|
||||
To format the PVoutput sensor it's recommended to use the [template component](/topics/templating/). For example:
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
sensor:
|
||||
- platform: pvoutput
|
||||
@ -56,19 +58,21 @@ sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
power_consumption:
|
||||
value_template: {% raw %}'{% if is_state_attr("sensor.pvoutput", "power_consumption", "NaN") %}0{% else %}{{ state_attr('sensor.pvoutput', 'power_consumption') }}{% endif %}'{% endraw %}
|
||||
value_template: '{% if is_state_attr("sensor.pvoutput", "power_consumption", "NaN") %}0{% else %}{{ state_attr("sensor.pvoutput", "power_consumption") }}{% endif %}'
|
||||
friendly_name: 'Using'
|
||||
unit_of_measurement: 'Watt'
|
||||
energy_consumption:
|
||||
value_template: {% raw %}'{{ "%0.1f"|format(state_attr('sensor.pvoutput', 'energy_consumption')|float/1000) }}'{% endraw %}
|
||||
value_template: '{{ "%0.1f"|format(state_attr("sensor.pvoutput", "energy_consumption")|float/1000) }}'
|
||||
friendly_name: 'Used'
|
||||
unit_of_measurement: 'kWh'
|
||||
power_generation:
|
||||
value_template: {% raw %}'{% if is_state_attr("sensor.pvoutput", "power_generation", "NaN") %}0{% else %}{{ state_attr('sensor.pvoutput', 'power_generation') }}{% endif %}'{% endraw %}
|
||||
value_template: '{% if is_state_attr("sensor.pvoutput", "power_generation", "NaN") %}0{% else %}{{ state_attr("sensor.pvoutput", "power_generation") }}{% endif %}'
|
||||
friendly_name: 'Generating'
|
||||
unit_of_measurement: 'Watt'
|
||||
energy_generation:
|
||||
value_template: {% raw %}'{% if is_state_attr("sensor.pvoutput", "energy_generation", "NaN") %}0{% else %}{{ "%0.2f"|format(state_attr('sensor.pvoutput', 'energy_generation')|float/1000) }}{% endif %}'{% endraw %}
|
||||
value_template: '{% if is_state_attr("sensor.pvoutput", "energy_generation", "NaN") %}0{% else %}{{ "%0.2f"|format(state_attr("sensor.pvoutput", "energy_generation")|float/1000) }}{% endif %}'
|
||||
friendly_name: 'Generated'
|
||||
unit_of_measurement: 'kWh'
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user