diff --git a/packages/electricity.yaml b/packages/electricity.yaml index d00da02..e7b4608 100644 --- a/packages/electricity.yaml +++ b/packages/electricity.yaml @@ -154,7 +154,7 @@ template: {% set i1_dc_power = states('sensor.solaredge_i1_dc_power') | float(0) %} {% if (i1_ac_power <= -25 and b1_dc_power > 0) %} {#added -25 instead of 0#} - {{ i1_dc_power|abs }} {# Changed to i1_dc_power #} + {{ i1_dc_power * -1 }} {# Changed to i1_dc_power #} {% else %} 0 {% endif %} @@ -275,4 +275,4 @@ sensor: source: sensor.solar_house_consumption_w method: left unit_prefix: k - name: solar_house_consumption_kwh \ No newline at end of file + name: solar_house_consumption_kwh diff --git a/packages/energy_stats.yaml b/packages/energy_stats.yaml index 33aa938..5832d5f 100644 --- a/packages/energy_stats.yaml +++ b/packages/energy_stats.yaml @@ -55,7 +55,7 @@ template: {% set b1_dc_power = states('sensor.solaredge_b1_dc_power') | float(0) %} {% set battery_effectiveness = states('sensor.solar_battery_effectiveness') %} - {% if (is_state('sensor.solar_battery_effectiveness', 'unknown') or (solar_battery_effectiveness == 0)) %} + {% if (is_state('sensor.solar_battery_effectiveness', 'unavailable') or is_state('sensor.solar_battery_effectiveness', 'unknown') or (battery_effectiveness == 0)) %} 1 {% elif (i1_dc_power + b1_dc_power <= 0) %} {% if (b1_dc_power >= 0 or i1_dc_power <= 0) %} @@ -144,4 +144,4 @@ sensor: sampling_size: 1200 max_age: hours: 24 - entity_id: sensor.solar_inverter_effectiveness \ No newline at end of file + entity_id: sensor.solar_inverter_effectiveness