Created
January 26, 2026 17:31
-
-
Save UglyBob79/e3712e17e59493b479d9501569b884a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| homeassistant: | |
| name: Victron Helper Sensors | |
| template: | |
| - sensor: | |
| # ----------------------------- | |
| # Grid Power (IMPORT positive, EXPORT negative) | |
| # ----------------------------- | |
| - name: "Victron Grid Power" | |
| unique_id: victron_grid_power | |
| unit_of_measurement: "W" | |
| device_class: power | |
| state_class: measurement | |
| state: > | |
| {{ states('sensor.victron_mqtt_system_0_system_grid_power_l1') | float(0) | |
| + states('sensor.victron_mqtt_system_0_system_grid_power_l2') | float(0) }} | |
| # ----------------------------- | |
| # Grid Power mirrored (IMPORT negative, EXPORT positive) | |
| # ----------------------------- | |
| - name: "Victron Grid Power (mirrored)" | |
| unique_id: victron_grid_power_mirrored | |
| unit_of_measurement: W | |
| state_class: measurement | |
| device_class: power | |
| state: > | |
| {{ states('sensor.victron_grid_power') | float(0) * -1 }} | |
| # ----------------------------- | |
| # Consumption (sum per phase) | |
| # ----------------------------- | |
| - name: "Victron Consumption" | |
| unique_id: victron_consumption | |
| unit_of_measurement: "W" | |
| device_class: power | |
| state_class: measurement | |
| state: > | |
| {{ states('sensor.victron_mqtt_system_0_system_consumption_power_l1') | float(0) | |
| + states('sensor.victron_mqtt_system_0_system_consumption_power_l2') | float(0) }} | |
| # ----------------------------- | |
| # Grid Import Power (always >= 0) | |
| # ----------------------------- | |
| - name: "Victron Grid Import Power" | |
| unique_id: victron_grid_import_power | |
| unit_of_measurement: "W" | |
| device_class: power | |
| state_class: measurement | |
| state: > | |
| {% set v = states('sensor.victron_grid_power') | float(0) %} | |
| {{ max(v, 0) }} | |
| # ----------------------------- | |
| # Grid Export Power (always >= 0) | |
| # ----------------------------- | |
| - name: "Victron Grid Export Power" | |
| unique_id: victron_grid_export_power | |
| unit_of_measurement: "W" | |
| device_class: power | |
| state_class: measurement | |
| state: > | |
| {% set v = states('sensor.victron_grid_power') | float(0) %} | |
| {{ max(-v, 0) }} | |
| # ----------------------------- | |
| # Battery Discharge Power (always >= 0) | |
| # ----------------------------- | |
| - name: "Victron Battery Discharge Power" | |
| unique_id: victron_battery_discharge_power | |
| unit_of_measurement: "W" | |
| device_class: power | |
| state_class: measurement | |
| state: > | |
| {% set v = states('sensor.victron_mqtt_system_0_system_dc_battery_power') | float(0) %} | |
| {{ max(v, 0) }} | |
| # ----------------------------- | |
| # Battery Charge Power (always >= 0) | |
| # ----------------------------- | |
| - name: "Victron Battery Charge Power" | |
| unique_id: victron_battery_charge_power | |
| unit_of_measurement: "W" | |
| device_class: power | |
| state_class: measurement | |
| state: > | |
| {% set v = states('sensor.victron_mqtt_system_0_system_dc_battery_power') | float(0) %} | |
| {{ max(-v, 0) }} | |
| sensor: | |
| - platform: integration | |
| name: "Victron Solar PV Energy Total" | |
| source: sensor.victron_mqtt_system_0_system_dc_pv_power | |
| unit_prefix: k | |
| round: 2 | |
| unit_time: h | |
| method: trapezoidal | |
| - platform: integration | |
| name: "Victron Grid Energy Total" | |
| source: sensor.victron_grid_power | |
| unit_prefix: k | |
| round: 2 | |
| unit_time: h | |
| method: trapezoidal | |
| - platform: integration | |
| name: "Victron Grid Import Energy Total" | |
| source: sensor.victron_grid_import_power | |
| unit_prefix: k | |
| round: 2 | |
| unit_time: h | |
| method: trapezoidal | |
| - platform: integration | |
| name: "Victron Grid Export Energy Total" | |
| source: sensor.victron_grid_export_power | |
| unit_prefix: k | |
| round: 2 | |
| unit_time: h | |
| method: trapezoidal | |
| - platform: integration | |
| name: "Victron Consumption Energy Total" | |
| source: sensor.victron_consumption | |
| unit_prefix: k | |
| round: 2 | |
| unit_time: h | |
| method: trapezoidal | |
| - platform: integration | |
| name: "Victron Battery Charge Energy Total" | |
| source: sensor.victron_battery_charge_power | |
| unit_prefix: k | |
| round: 2 | |
| unit_time: h | |
| method: trapezoidal | |
| - platform: integration | |
| name: "Victron Battery Discharge Energy Total" | |
| source: sensor.victron_battery_discharge_power | |
| unit_prefix: k | |
| round: 2 | |
| unit_time: h | |
| method: trapezoidal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment