From acf396456ad4bc25644fefe047d4332da03f38a4 Mon Sep 17 00:00:00 2001 From: sdesalve Date: Fri, 17 Sep 2021 17:17:17 +0200 Subject: [PATCH] fix --- README.md | 145 +++++++++++++++++++++++++++++++++++++++++++++++------- info.md | 145 +++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 254 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 5c1b1f9..50fb91a 100644 --- a/README.md +++ b/README.md @@ -18,46 +18,155 @@ sensor: ``` -## Example for extract sensor +## Example for extract sensor ``` +sensor: + - platform: integration + name: power_generating_spent_zcs + source: sensor.power_generating_zcs + unit_prefix: k + round: 2 + unit: kWh + method: left + +##### current template: - sensor: + - name: "Potenza Istantanea" + unit_of_measurement: "W" + state: > + {% set power = states.sensor.fotovoltaico.attributes.current.powerGenerating | int | default (0) %} + {{ power }} + state_class: measurement + device_class: power + icon: mdi:solar-power - - name: "Energy Generating ZCS" + - name: "Batteria" + unit_of_measurement: "%" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.current.batterySoC | float | default (0) %} + {{ energy | round(2) }} + state_class: measurement + device_class: energy + icon: mdi:battery-90 + + - name: "Consumo Giorno Casa" unit_of_measurement: "kWh" state: > - {% set energy = states.sensor.zcsazzurro.attributes.current.energyGenerating | float | default (0) %} + {% set energy = states.sensor.fotovoltaico.attributes.current.energyConsuming | float | default (0) %} {{ energy | round(2) }} state_class: measurement device_class: energy - icon: mdi:solar-power - - - name: "Power Generating ZCS" - unit_of_measurement: "W" + icon: mdi:power-socket-it + + - name: "Autoconsum Giorno" + unit_of_measurement: "kWh" state: > - {% set power = states.sensor.zcsazzurro.attributes.current.powerGenerating | int | default (0) %} - {{ power }} + {% set energy = states.sensor.fotovoltaico.attributes.current.energyAutoconsuming | float | default (0) %} + {{ energy | round(2) }} state_class: measurement - device_class: power - icon: mdi:solar-power - - - name: "Energy Exporting ZCS" + device_class: energy + icon: mdi:power-plug-outline + + - name: "Scarica" unit_of_measurement: "kWh" state: > - {% set energy = states.sensor.zcsazzurro.attributes.current.energyExporting | float | default (0) %} + {% set energy = states.sensor.fotovoltaico.attributes.current.energyDischarging | float | default (0) %} {{ energy | round(2) }} state_class: measurement device_class: energy - icon: mdi:solar-power - - - name: "Energy Importing ZCS" + icon: mdi:battery-low + + - name: "Carica" unit_of_measurement: "kWh" state: > - {% set energy = states.sensor.zcsazzurro.attributes.current.energyImporting | float | default (0) %} + {% set energy = states.sensor.fotovoltaico.attributes.current.energyCharging | float | default (0) %} + {{ energy | round(2) }} + state_class: measurement + device_class: energy + icon: mdi:battery-high + + - name: "Produzione" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.current.energyGenerating | float | default (0) %} {{ energy | round(2) }} state_class: measurement device_class: energy icon: mdi:solar-power + + - name: "Prelievo" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.current.energyImporting | float | default (0) %} + {{ energy | round(2) }} + state_class: measurement + device_class: energy + icon: mdi:transmission-tower + + - name: "Immissione" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.current.energyExporting | float | default (0) %} + {{ energy | round(2) }} + state_class: measurement + device_class: energy + icon: mdi:solar-power + +##### total + - name: "Produzione Totale" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.total.energyGenerating | float | default (0) %} + {{ energy | round(2) }} + state_class: total_increasing + device_class: energy + icon: mdi:weather-sunny + + - name: "Prelievo Totale" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.total.energyImporting | float | default (0) %} + {{ energy | round(2) }} + state_class: total_increasing + device_class: energy + icon: mdi:transmission-tower + + - name: "Immissione Totale" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.total.energyExporting | float | default (0) %} + {{ energy | round(2) }} + state_class: total_increasing + device_class: energy + icon: mdi:flash-circle + + - name: "Autoconsum Totale" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.total.energyAutoconsuming | float | default (0) %} + {{ energy | round(2) }} + state_class: total_increasing + device_class: energy + icon: mdi:power-plug-outline + + - name: "Scarica Totale" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.total.energyDischarging | float | default (0) %} + {{ energy | round(2) }} + state_class: total_increasing + device_class: energy + icon: mdi:battery-low + + - name: "Carica Totale" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.total.energyCharging | float | default (0) %} + {{ energy | round(2) }} + state_class: total_increasing + device_class: energy + icon: mdi:battery-high ``` ## Example sensor for energy panel diff --git a/info.md b/info.md index 5c1b1f9..50fb91a 100644 --- a/info.md +++ b/info.md @@ -18,46 +18,155 @@ sensor: ``` -## Example for extract sensor +## Example for extract sensor ``` +sensor: + - platform: integration + name: power_generating_spent_zcs + source: sensor.power_generating_zcs + unit_prefix: k + round: 2 + unit: kWh + method: left + +##### current template: - sensor: + - name: "Potenza Istantanea" + unit_of_measurement: "W" + state: > + {% set power = states.sensor.fotovoltaico.attributes.current.powerGenerating | int | default (0) %} + {{ power }} + state_class: measurement + device_class: power + icon: mdi:solar-power - - name: "Energy Generating ZCS" + - name: "Batteria" + unit_of_measurement: "%" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.current.batterySoC | float | default (0) %} + {{ energy | round(2) }} + state_class: measurement + device_class: energy + icon: mdi:battery-90 + + - name: "Consumo Giorno Casa" unit_of_measurement: "kWh" state: > - {% set energy = states.sensor.zcsazzurro.attributes.current.energyGenerating | float | default (0) %} + {% set energy = states.sensor.fotovoltaico.attributes.current.energyConsuming | float | default (0) %} {{ energy | round(2) }} state_class: measurement device_class: energy - icon: mdi:solar-power - - - name: "Power Generating ZCS" - unit_of_measurement: "W" + icon: mdi:power-socket-it + + - name: "Autoconsum Giorno" + unit_of_measurement: "kWh" state: > - {% set power = states.sensor.zcsazzurro.attributes.current.powerGenerating | int | default (0) %} - {{ power }} + {% set energy = states.sensor.fotovoltaico.attributes.current.energyAutoconsuming | float | default (0) %} + {{ energy | round(2) }} state_class: measurement - device_class: power - icon: mdi:solar-power - - - name: "Energy Exporting ZCS" + device_class: energy + icon: mdi:power-plug-outline + + - name: "Scarica" unit_of_measurement: "kWh" state: > - {% set energy = states.sensor.zcsazzurro.attributes.current.energyExporting | float | default (0) %} + {% set energy = states.sensor.fotovoltaico.attributes.current.energyDischarging | float | default (0) %} {{ energy | round(2) }} state_class: measurement device_class: energy - icon: mdi:solar-power - - - name: "Energy Importing ZCS" + icon: mdi:battery-low + + - name: "Carica" unit_of_measurement: "kWh" state: > - {% set energy = states.sensor.zcsazzurro.attributes.current.energyImporting | float | default (0) %} + {% set energy = states.sensor.fotovoltaico.attributes.current.energyCharging | float | default (0) %} + {{ energy | round(2) }} + state_class: measurement + device_class: energy + icon: mdi:battery-high + + - name: "Produzione" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.current.energyGenerating | float | default (0) %} {{ energy | round(2) }} state_class: measurement device_class: energy icon: mdi:solar-power + + - name: "Prelievo" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.current.energyImporting | float | default (0) %} + {{ energy | round(2) }} + state_class: measurement + device_class: energy + icon: mdi:transmission-tower + + - name: "Immissione" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.current.energyExporting | float | default (0) %} + {{ energy | round(2) }} + state_class: measurement + device_class: energy + icon: mdi:solar-power + +##### total + - name: "Produzione Totale" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.total.energyGenerating | float | default (0) %} + {{ energy | round(2) }} + state_class: total_increasing + device_class: energy + icon: mdi:weather-sunny + + - name: "Prelievo Totale" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.total.energyImporting | float | default (0) %} + {{ energy | round(2) }} + state_class: total_increasing + device_class: energy + icon: mdi:transmission-tower + + - name: "Immissione Totale" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.total.energyExporting | float | default (0) %} + {{ energy | round(2) }} + state_class: total_increasing + device_class: energy + icon: mdi:flash-circle + + - name: "Autoconsum Totale" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.total.energyAutoconsuming | float | default (0) %} + {{ energy | round(2) }} + state_class: total_increasing + device_class: energy + icon: mdi:power-plug-outline + + - name: "Scarica Totale" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.total.energyDischarging | float | default (0) %} + {{ energy | round(2) }} + state_class: total_increasing + device_class: energy + icon: mdi:battery-low + + - name: "Carica Totale" + unit_of_measurement: "kWh" + state: > + {% set energy = states.sensor.fotovoltaico.attributes.total.energyCharging | float | default (0) %} + {{ energy | round(2) }} + state_class: total_increasing + device_class: energy + icon: mdi:battery-high ``` ## Example sensor for energy panel