-
Notifications
You must be signed in to change notification settings - Fork 7
Sensor Examples
Some example sensor configurations to get you started with the Wibeee integration in Home Assistant.
Wibeee exposes wibeee_active_power_l<n>
(a non-negative number) and wibeee_power_factor_l<n>
(ranging from -1 to 1) separately. If we want a single sensor that has positive (when importing from the grid) and negative (when exporting to
the grid) we need to create a new Template sensor.
We also create two separate sensors for integrations that expect non-negative numbers, one for importing from the grid and another for exporting to the grid. We will end up with three sensors::
-
grid_import_export_power
is the active power (+/- depending on energy flow from or to the grid) -
grid_import_power
is the active power being imported from the grid (always a non-negative number) -
grid_export_power
is the active power being exported to the grid (always a non-negative number)
In the examples below make sure to substitute _l4
(L4) for the desired line depending on the clamp that is being used (L1, L2, L3, or L4 for the "virtual" clamp containing the totals for three-phase power).
template:
sensor:
- unique_id: grid_import_export_power
device_class: power
unit_of_measurement: 'W'
state_class: measurement
state: >-
{% if states('sensor.wibeee_power_factor_l4') | float < 0 %}
{{ states('sensor.wibeee_active_power_l4') | float * -1 | round(0) }}
{% else %}
{{ states('sensor.wibeee_active_power_l4') | float | round(0) }}
{% endif %}
availability: "{{ not states('sensor.wibeee_active_power_l4') in ('unavailable', 'unknown') and not states('sensor.wibeee_power_factor_l4') in ('unavailable', 'unknown') }}"
attributes:
friendly_name: "Grid import(+) or export(-) power"
- unique_id: grid_import_power
device_class: power
unit_of_measurement: 'W'
state_class: measurement
state: "{{ [states('sensor.template_grid_import_export_power') | float, 0] | max | round(0) }}"
availability: "{{ not states('sensor.template_grid_import_export_power') in ('unavailable', 'unknown') }}"
attributes:
friendly_name: "Grid import power"
- unique_id: grid_export_power
device_class: power
unit_of_measurement: 'W'
state_class: measurement
state: "{{ [states('sensor.template_grid_import_export_power') | float, 0] | min | abs | round(0) }}"
availability: "{{ not states('sensor.template_grid_import_export_power') in ('unavailable', 'unknown') }}"
attributes:
friendly_name: "Grid export power"
Power sensors give us an instant value of power being imported or exported but not the total amount
of energy in kWh. To calculate the energy we will use the integration
platform
to calculate the Riemann Sum of the power series.
sensor:
########################
# Energy sensors (kWh) #
########################
- platform: integration
source: sensor.template_grid_import_power
name: grid_import_energy
unit_prefix: k
method: left
round: 2
- platform: integration
source: sensor.template_grid_export_power
name: grid_export_energy
unit_prefix: k
method: left
round: 2
The above sensors can be used in the your Energy Configuration to integrate with Home Energy Management.
If your solar inverter does not provide power and energy sensors you can use one of the clamps on the Wibeee to measure production. The configuration is the same as Power Sensors and Energy sensors above. You need to find out which of L1/L2/L3 measuring output of the solar inverter(s).