Closed micky-bamboleo closed 1 year ago
Hi Micky,
thanks for letting me know about the warning.
I may have a solution for you.
Could you replace the following things in your config and tell me if the warning is gone?
Both you have to change in the sensors.yaml. Please pay attention to the correct indentation!
e3dc_battery_charge_power:
unique_id: e3dc_battery_charge_power
friendly_name: E3DC Battery Charging Power
unit_of_measurement: W
device_class: power
value_template: >
{% set power = states('sensor.e3dc_battery_power') | float(0) %}
{% if power >= 0 %}
{{ power }}
{% else %}
{% set charge_power = states('sensor.e3dc_battery_charge_power') | float(0) + power %}
{{ charge_power if charge_power > 0 else 0 }}
{% endif %}
and
e3dc_battery_discharge_power:
unique_id: e3dc_battery_discharge_power
friendly_name: E3DC Battery Discharging Power
unit_of_measurement: W
device_class: power
value_template: >
{% set power = states('sensor.e3dc_battery_power') | float(0) %}
{% if power <= 0 %}
{{ power | abs }}
{% else %}
{% set discharge_power = states('sensor.e3dc_battery_charge_power') | float(0) - power %}
{{ discharge_power if discharge_power > 0 else 0 }}
{% endif %}
Best regards Julian
Hi Julian, Thank you so much for your quick response and individual help here, wow! 😀 I just made your suggested changes and for the moment it looks really good! I guess you could consider this as solved. 😉👍 Best regards, Micky
Do you mind quickly explaining what was the idea of that change? I don't fully get it. Wouldn't it be also possible tu just use {% else %} 0
so that it always has a value?
Hello there,
I am pretty happy about your integration, thank you very much. One little issue though: I'm constantly getting this Warning for the battery_discharge_power sensor (only for that one as far as I see):
Interesting thing is, that the sensor does nevertheless send data:
Is this thus a warning to be ignored?
Sorry I wrote that in the issues, I don't know where else to put it best.
Best regards Micky