Hi,
I can share a view things of the setup, sure - but most is straight ahead with the available integrations:
For NodeRed I am using a slightly modified node-red contribution (GitHub - ChristophCaina/node-red-contrib-solaredge-2: SolarEdge node for Node-RED)
So, you would need to install NodeRed throught Supervisor + NodeRed Companion (HACS)
How to Install the contribution in NodeRED:
Add the following information to the NodeRed Configuration in Supervisor:
npm_packages:
- christophcaina/node-red-contrib-solaredge-2
In NodeRed, You need to create your Sensors and flow for accessing the SolarEdge API, you can use the following JSON which is a 1:1 copy of my flow… I have only removed the SiteID and API Key…
[{"id":"4d45645a2643ba26","type":"tab","label":"SolarEdge","disabled":false,"info":""},{"id":"0e655839d02d5fc9","type":"change","z":"4d45645a2643ba26","name":"Overview.LifeTimeData.Revenue","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.overview.lifeTimeData.revenue","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":40,"wires":[["5803c57ce796a8e7"]]},{"id":"ecf5c878995a7511","type":"change","z":"4d45645a2643ba26","name":"envBenefits.GasEmissionsSaved","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.envBenefits.gasEmissionSaved","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":100,"wires":[["61510dd97197918c","425593de52254a5e","bd73612f32f8cdf7"]]},{"id":"c6d6c2db9bd1442e","type":"ha-entity","z":"4d45645a2643ba26","name":"SE_Web_lifeTimeRevenue_eur","server":"893f8903.f63a38","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"SE_Web_lifeTimeRevenue_eur"},{"property":"device_class","value":"sensor"},{"property":"icon","value":"mdi:currency-eur"},{"property":"unit_of_measurement","value":"€"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"msg","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1010,"y":40,"wires":[[]]},{"id":"e6b0c791a393aecf","type":"change","z":"4d45645a2643ba26","name":"envBenefits.TreesPlanted","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.envBenefits.treesPlanted","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":160,"wires":[["d6ba12821c19ca03"]]},{"id":"8af8073932ddf3dc","type":"ha-entity","z":"4d45645a2643ba26","name":"SE_Web_saved_co2_t","server":"893f8903.f63a38","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"SE_Web_saved_co2_t"},{"property":"device_class","value":"sensor"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"t"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"msg","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1250,"y":100,"wires":[[]]},{"id":"abca26c4b54bca87","type":"ha-entity","z":"4d45645a2643ba26","name":"SE_Web_saved_so2_t","server":"893f8903.f63a38","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"SE_Web_saved_so2_t"},{"property":"device_class","value":"sensor"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"t"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"msg","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1250,"y":160,"wires":[[]]},{"id":"47dcabfaec7e171f","type":"ha-entity","z":"4d45645a2643ba26","name":"SE_Web_saved_nox_t","server":"893f8903.f63a38","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"SE_Web_saved_nox_t"},{"property":"device_class","value":"sensor"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"t"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"msg","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1240,"y":220,"wires":[[]]},{"id":"61510dd97197918c","type":"change","z":"4d45645a2643ba26","name":"CO2","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.co2","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":100,"wires":[["2e90555fa08481ec"]]},{"id":"425593de52254a5e","type":"change","z":"4d45645a2643ba26","name":"SO2","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.so2","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":160,"wires":[["01b7d90dea1742ff"]]},{"id":"bd73612f32f8cdf7","type":"change","z":"4d45645a2643ba26","name":"NOX","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.nox","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":220,"wires":[["ac2beb88b2394070"]]},{"id":"2e90555fa08481ec","type":"function","z":"4d45645a2643ba26","name":"","func":"msg.payload = (msg.payload/1000).toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":960,"y":100,"wires":[["8af8073932ddf3dc"]]},{"id":"01b7d90dea1742ff","type":"function","z":"4d45645a2643ba26","name":"","func":"msg.payload = (msg.payload/1000).toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":960,"y":160,"wires":[["abca26c4b54bca87"]]},{"id":"ac2beb88b2394070","type":"function","z":"4d45645a2643ba26","name":"","func":"msg.payload = (msg.payload/1000).toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":960,"y":220,"wires":[["47dcabfaec7e171f"]]},{"id":"a99d32624fa7fbf1","type":"ha-entity","z":"4d45645a2643ba26","name":"SE_Web_treeplanted","server":"893f8903.f63a38","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"SE_Web_treeplanted"},{"property":"device_class","value":"sensor"},{"property":"icon","value":"mdi:forest"},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"msg","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":980,"y":280,"wires":[[]]},{"id":"d6ba12821c19ca03","type":"function","z":"4d45645a2643ba26","name":"","func":"msg.payload = msg.payload.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":740,"y":280,"wires":[["a99d32624fa7fbf1"]]},{"id":"5803c57ce796a8e7","type":"function","z":"4d45645a2643ba26","name":"","func":"msg.payload = msg.payload.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":740,"y":40,"wires":[["c6d6c2db9bd1442e"]]},{"id":"fff50b84934baf75","type":"change","z":"4d45645a2643ba26","name":"meters","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.Inventory.meters","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":480,"wires":[["c0baa6ac35156319","6455a476424f263a","f39f75e1e445e670","578cde59428a676c"]]},{"id":"c52c28d578c59349","type":"change","z":"4d45645a2643ba26","name":"sensors","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.Inventory.sensors","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":600,"wires":[[]]},{"id":"ffb7bb3a4c21e979","type":"change","z":"4d45645a2643ba26","name":"gateways","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.Inventory.gateways","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":640,"wires":[[]]},{"id":"54ebeb33c39cca9d","type":"change","z":"4d45645a2643ba26","name":"batteries","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.Inventory.batteries","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":680,"wires":[[]]},{"id":"296119cd70b4b957","type":"change","z":"4d45645a2643ba26","name":"inverters","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.Inventory.inverters","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":720,"wires":[["d010c7eab6815d9f"]]},{"id":"c0baa6ac35156319","type":"change","z":"4d45645a2643ba26","name":"0 - export meter","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.0","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":400,"wires":[["6abd57ac1f280cc0"]]},{"id":"6455a476424f263a","type":"change","z":"4d45645a2643ba26","name":"1 - import meter","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.1","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":440,"wires":[["abcb6110fe9e9429"]]},{"id":"f39f75e1e445e670","type":"change","z":"4d45645a2643ba26","name":"2 - consumtion meter","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.2","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":500,"wires":[["9b19f045380fa3d1"]]},{"id":"578cde59428a676c","type":"change","z":"4d45645a2643ba26","name":"3 - self consumtion meter","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.3","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":540,"wires":[["9a898b3cd07baa4b"]]},{"id":"6abd57ac1f280cc0","type":"ha-entity","z":"4d45645a2643ba26","name":"ExportMeter.Name","server":"893f8903.f63a38","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"SE_ExportMeter_Name"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload.name","stateType":"msg","attributes":[{"property":"Manufacturer","value":"payload.manufacturer","valueType":"msg"},{"property":"Model","value":"payload.model","valueType":"msg"},{"property":"FirmwareVersion","value":"payload.firmwareVersion","valueType":"msg"},{"property":"SerialNo","value":"payload.SN","valueType":"msg"},{"property":"ConnectedTo","value":"payload.connectedTo","valueType":"msg"},{"property":"connectedSolaredgeDeviceSN","value":"payload.connectedSolaredgeDeviceSN","valueType":"msg"},{"property":"MeterType","value":"payload.type","valueType":"msg"},{"property":"MeterForm","value":"payload.form","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":790,"y":380,"wires":[[]]},{"id":"abcb6110fe9e9429","type":"ha-entity","z":"4d45645a2643ba26","name":"ImportMeter.Name","server":"893f8903.f63a38","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"SE_ImportMeter_Name"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload.name","stateType":"msg","attributes":[{"property":"Manufacturer","value":"payload.manufacturer","valueType":"msg"},{"property":"Model","value":"payload.model","valueType":"msg"},{"property":"FirmwareVersion","value":"payload.firmwareVersion","valueType":"msg"},{"property":"SerialNo","value":"payload.SN","valueType":"msg"},{"property":"ConnectedTo","value":"payload.connectedTo","valueType":"msg"},{"property":"connectedSolaredgeDeviceSN","value":"payload.connectedSolaredgeDeviceSN","valueType":"msg"},{"property":"MeterType","value":"payload.type","valueType":"msg"},{"property":"MeterForm","value":"payload.form","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":790,"y":440,"wires":[[]]},{"id":"9b19f045380fa3d1","type":"ha-entity","z":"4d45645a2643ba26","name":"ConsumtionMeter.Name","server":"893f8903.f63a38","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"SE_ConsumptionMeter_Name"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload.name","stateType":"msg","attributes":[{"property":"Manufacturer","value":"payload.manufacturer","valueType":"msg"},{"property":"Model","value":"payload.model","valueType":"msg"},{"property":"FirmwareVersion","value":"payload.firmwareVersion","valueType":"msg"},{"property":"SerialNo","value":"payload.SN","valueType":"msg"},{"property":"ConnectedTo","value":"payload.connectedTo","valueType":"msg"},{"property":"connectedSolaredgeDeviceSN","value":"payload.connectedSolaredgeDeviceSN","valueType":"msg"},{"property":"MeterType","value":"payload.type","valueType":"msg"},{"property":"MeterForm","value":"payload.form","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":850,"y":500,"wires":[[]]},{"id":"9a898b3cd07baa4b","type":"ha-entity","z":"4d45645a2643ba26","name":"SelfConsumtionMeter.Name","server":"893f8903.f63a38","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"SE_SelfConsumptionMeter_Name"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload.name","stateType":"msg","attributes":[{"property":"Manufacturer","value":"payload.manufacturer","valueType":"msg"},{"property":"Model","value":"payload.model","valueType":"msg"},{"property":"FirmwareVersion","value":"payload.firmwareVersion","valueType":"msg"},{"property":"SerialNo","value":"payload.SN","valueType":"msg"},{"property":"ConnectedTo","value":"payload.connectedTo","valueType":"msg"},{"property":"connectedSolaredgeDeviceSN","value":"payload.connectedSolaredgeDeviceSN","valueType":"msg"},{"property":"MeterType","value":"payload.type","valueType":"msg"},{"property":"MeterForm","value":"payload.form","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":860,"y":560,"wires":[[]]},{"id":"99fc5aa640a2be24","type":"ha-entity","z":"4d45645a2643ba26","name":"Inverter.Name","server":"893f8903.f63a38","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"SE_Inverter_Name"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload.name","stateType":"msg","attributes":[{"property":"Manufacturer","value":"payload.manufacturer","valueType":"msg"},{"property":"Model","value":"payload.model","valueType":"msg"},{"property":"Communication Method","value":"payload.communicationMethod","valueType":"msg"},{"property":"SerialNo","value":"payload.SN","valueType":"msg"},{"property":"dsp1-Version","value":"payload.dsp1Version","valueType":"msg"},{"property":"dsp2-Version","value":"payload.dsp2Version","valueType":"msg"},{"property":"CPUVersion","value":"payload.cpuVersion","valueType":"msg"},{"property":"Optimizers","value":"payload.connectedOptimizers","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":840,"y":720,"wires":[[]]},{"id":"d010c7eab6815d9f","type":"change","z":"4d45645a2643ba26","name":"0 - Inverter 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.0","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":720,"wires":[["99fc5aa640a2be24"]]},{"id":"795183bd2b5292e0","type":"solaredge","z":"4d45645a2643ba26","site":"f7aecf71f8eb4631","interval":"10800","command":"overview","x":100,"y":40,"wires":[["0e655839d02d5fc9","bc524e863d41b667"]]},{"id":"1e26ac863d541626","type":"solaredge","z":"4d45645a2643ba26","site":"f7aecf71f8eb4631","interval":"10810","command":"envBenefits","x":100,"y":100,"wires":[["ecf5c878995a7511","e6b0c791a393aecf","bc524e863d41b667"]]},{"id":"8540666a798e4675","type":"solaredge","z":"4d45645a2643ba26","site":"f7aecf71f8eb4631","interval":"10820","command":"inventory","x":100,"y":480,"wires":[["fff50b84934baf75","c52c28d578c59349","ffb7bb3a4c21e979","54ebeb33c39cca9d","296119cd70b4b957","bc524e863d41b667"]]},{"id":"bc524e863d41b667","type":"debug","z":"4d45645a2643ba26","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":370,"y":280,"wires":[]},{"id":"893f8903.f63a38","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30},{"id":"f7aecf71f8eb4631","type":"solaredge-site","siteid":"","apikey":""}]
Furthermore, here are some of my configs from the yaml which do:
- calculation of Wh into kWh
- calculation of Revenues
- calculation of total export & import based on previous readings, before the export & import meter were been installed.
- SolarEdge Inverter Status
- calculation of usage, and so on
# SolarEdge Energy Sensors in kWh instead of Wh
# Todays energy in kWh
solaredge_energy_today_kwh:
friendly_name: solaredge (Energy today) [kWh]
unit_of_measurement: "kWh"
value_template: "{{ states('sensor.solaredge_api_energy_today') | float(default=0) / 1000 | round(2) }}"
icon_template: mdi:solar-power
# This months energy in kWh
solaredge_energy_this_month_kwh:
friendly_name: solaredge (Energy this month) [kWh]
unit_of_measurement: "kWh"
value_template: "{{ states('sensor.solaredge_api_energy_this_month') | float(default=0) / 1000 | round(2) }}"
icon_template: mdi:solar-power
# This years energy in kWh
solaredge_energy_this_year_kwh:
friendly_name: solaredge (Energy this year) [kWh]
unit_of_measurement: "kWh"
value_template: "{{ states('sensor.solaredge_api_energy_this_year') | float(default=0) / 1000 | round(2) }}"
icon_template: mdi:solar-power
# Lifetimes energy in kWh
solaredge_lifetime_energy_kwh:
friendly_name: solaredge (Lifetime energy) [kWh]
unit_of_measurement: "kWh"
value_template: "{{ states('sensor.solaredge_api_lifetime_energy') | float(default=0) / 1000 | round(2) }}"
icon_template: mdi:solar-power
# Exported energy in kWh
solaredge_exported_energy_kwh:
friendly_name: solaregde (Einspeisung) [kWh]
unit_of_measurement: "kWh"
value_template: "{{ states('sensor.solaredge_api_exported_energy') | float(default=0) / 1000 | round(2) }}"
icon_template: mdi:home-export-outline
# Imported Energy in kWh
solaredge_imported_energy_kwh:
friendly_name: solaregde (Bezug) [kWh]
unit_of_measurement: "kWh"
value_template: "{{ states('sensor.solaredge_api_imported_energy') | float(default=0) / 1000 | round(2) }}"
icon_template: mdi:home-import-outline
# Selfconsumed Energy in kWh
solaredge_selfconsumption_energy_kwh:
friendly_name: solaregde (Eigenverbrauch) [kWh]
unit_of_measurement: "kWh"
value_template: "{{ states('sensor.solaredge_api_selfconsumption_energy') | float(default=0) / 1000 | round(2) }}"
icon_template: mdi:lightning-bolt
# Consumed total Energy in kWh
solaredge_consumption_energy_kwh:
friendly_name: solaregde (Verbrauch) [kWh]
unit_of_measurement: "kWh"
value_template: "{{ states('sensor.solaredge_api_consumption_energy') | float(default=0) / 1000 | round(2) }}"
icon_template: mdi:lightning-bolt
# Calculate current power into kW
solaredge_current_power_kw:
friendly_name: 'Current Power kW'
unit_of_measurement: "kW"
icon_template: mdi:flash
value_template: >-
{{ states('sensor.solaredge_modbus_ac_power') | float(default=0) / 1000 | round(2) }}
# calculate the Self-sufficiency in percent
solaredge_calculated_self_sufficiency:
friendly_name: 'Autarkie-Grad'
unit_of_measurement: "%"
value_template: >-
{% if is_state('sensor.solaredge_selfconsumption_energy_kwh', '0.0') or is_state('sensor.solaredge_consumption_energy_kwh', '0.0') %}
0.0
{% else %}
{% set selfconsumption = states('sensor.solaredge_selfconsumption_energy_kwh') | float(default=0) %}
{% set consumption = states('sensor.solaredge_consumption_energy_kwh') | float(default=0) %}
{{ ((selfconsumption / consumption) * 100) | round(2) }}
{% endif %}
# calculate the usage of the solar installation in percent
solaredge_calculated_solar_usage:
friendly_name: 'Nutzungsgrad'
unit_of_measurement: "%"
value_template: >-
{% if is_state('sensor.solaredge_energy_today_kwh', '0.0') or is_state('sensor.solaredge_selfconsumption_energy_kwh', '0.0') %}
0.0
{% else %}
{% set production = states('sensor.solaredge_energy_today_kwh') | float(default=0) %}
{% set consumption = states('sensor.solaredge_selfconsumption_energy_kwh') | float(default=0) %}
{{ ((consumption / production) * 100) | round(2) }}
{% endif %}
# calculate the energy export in percent
solaredge_calculated_energy_export:
friendly_name: 'Netzeinspeisung'
unit_of_measurement: "%"
value_template: >-
{% if is_state('sensor.solaredge_energy_today_kwh', '0.0') or is_state('sensor.solaredge_exported_energy_kwh', '0.0') %}
0.0
{% else %}
{% set production = states('sensor.solaredge_energy_today_kwh') | float(default=0) %}
{% set export = states('sensor.solaredge_exported_energy_kwh') | float(default=0) %}
{{ ((export / production) * 100) | round(2) }}
{% endif %}
# kWh / kWp calculation
# calculate monthly kWh per kWp
solaredge_yearly_kwh_kwp:
friendly_name: "Yearly kWh/kWp"
unit_of_measurement: "kWh"
value_template: >-
{{ (states('sensor.solaredge_energy_this_year_kwh') | float / '13.26' | float) | float(default=0.0)|round(2) }}
# 13.26 = max kWp of the installation
# calculate monthly kWh per kWp
solaredge_monthly_kwh_kwp:
friendly_name: "Monthly kWh/kWp"
unit_of_measurement: "kWh"
value_template: >-
{{ (states('sensor.solaredge_energy_this_month_kwh') | float / '13.26' | float) | float(default=0.0)|round(2) }}
# 13.26 = max kWp of the installation
# calculate daily kWh per kWp
solaredge_daily_kwh_kwp:
friendly_name: "Daily kWh/kWp"
unit_of_measurement: "kWh"
value_template: >-
{{ (states('sensor.solaredge_energy_today_kwh') | float / '13.26' | float) | float(default=0.0)|round(2) }}
# 13.26 = max kWp of the installation
# SolarEdge Inverter Status in Readable Text
solaredge_status_text:
friendly_name: "Solaredge status text"
value_template: >-
{% if is_state('sensor.solaredge_modbus_status', '1') %}
Aus
{% elif is_state('sensor.solaredge_modbus_status', '2') %}
Ruhezustand
{% elif is_state('sensor.solaredge_modbus_status', '3') %}
fährt hoch
{% elif is_state('sensor.solaredge_modbus_status', '4') %}
Produzierend
{% elif is_state('sensor.solaredge_modbus_status', '5') %}
Gedrosselt
{% elif is_state('sensor.solaredge_modbus_status', '6') %}
fährt herunter
{% elif is_state('sensor.solaredge_modbus_status', '7') %}
Fehler
{% elif is_state('sensor.solaredge_modbus_status', '8') %}
Wartung
{% else %}
Unbekannt
{% endif %}
# can be taken from integration SolarEdge Modbus Inverter_Status -> Attributes
# SolarEdge Inverter Status_Vendor in Readable Text
# solaredge_status_vendor_text:
# friendly_name: "SolarEdge StatusVendor Text"
# value_template: >-
# {% if is_state('sensor_solaredge_modbus_status_vendo', '79') or is_state('sensor_solaredge_modbus_status_vendo', '80') or if is_state('sensor_solaredge_modbus_status_vendo', '81') %}
# AC Frequenz zu hoch!
# {% if is_state('sensor_solaredge_modbus_status_vendo', '82') or is_state('sensor_solaredge_modbus_status_vendo', '83') or if is_state('sensor_solaredge_modbus_status_vendo', '84') %}
# AC Frequenz zu niedrig!
# {% if is_state('sensor_solaredge_modbus_status_vendo', '104') %}
# Temperatur zu hoch!
# {% else %}
# Unbekannt
# {% endif %}
# Calculate revenue / kWh
solaredge_revenue_kwh:
friendly_name: "Ertrag pro kWh"
unit_of_measurement: "€"
icon_template: mdi:currency-eur
value_template: >-
{% set revenue = states('sensor.SE_Web_LifeTimeRevenue_EUR') | float(default=0) %}
{% set lifetimeenergy = states('sensor.solaredge_modbus_ac_energy_kwh') | float(default=0) %}
{{ (revenue / lifetimeenergy) | round(4) }}
# Calculation of Revenue and Savings based on additional information (Export / Import)
# calculation of total import since installation
solaredge_total_import_kwh:
friendly_name: 'Total Import kWh'
unit_of_measurement: 'kWh'
icon_template: mdi:home-import-outline
value_template: >-
{% set imported_since_meter_installation = states('sensor.solaredge_modbus_m1_imported_kwh') | float(default=0) %}
{% set imported_before_meter_installation = 296 | float(default=0) %}
{{ imported_before_meter_installation + imported_since_meter_installation | round(2) }}
# Installation Modbus-meter: 21.09.2021 start counting = 0
# imported engery till 30.09.2021 : 320 kWh (Import) [needs to substract measurements from 21.09. till 30.09]
# calculation of total export since installation
solaredge_total_export_kwh:
# state_class: measurement
# device_class: energy
friendly_name: 'Total Export kWh'
unit_of_measurement: 'kWh'
icon_template: mdi:home-export-outline
value_template: >-
{% set exported_since_meter_installation = states('sensor.solaredge_modbus_m1_exported_kwh') | float(default=0) %}
{% set exported_before_meter_installation = 7050 | float(default=0) %}
{{ exported_before_meter_installation + exported_since_meter_installation | round(2) }}
# Installation Modbus-meter: 21.09.2021 start counting = 0
# exported energy till 30.09.2021 : 7.470 kWh (Export) [needs to substract measurements from 21.09. till 30.09]
# calculation of self consumption since installation
solaredge_total_selfconsumption_kwh:
friendly_name: 'Total SelfConsumption kWh'
unit_of_measurement: 'kWh'
value_template: >-
{% set produced = states('sensor.solaredge_modbus_ac_energy_kwh') | float(default=0) %}
{% set exported = states('sensor.solaredge_total_export_kwh') | float(default=0) %}
{% set selfconsumed = produced - exported |float(default=0) %}
{{ selfconsumed | round(2) }}
# Calculation of Total Savings in €
solaredge_total_savings:
friendly_name: 'Total Savings €'
unit_of_measurement: '€'
value_template: >-
{{ (states('sensor.solaredge_total_selfconsumption_kwh')|float(default=0) * 28.80 / 100) | round(2) }}
# self consumption * current price per kWh / 100