The way I measure solar is inverter output - inverter input which is normally find during the day, but I have a limited AC source so at night it could be 2.5kw - 2kw because of my inverter's AC load assist which limits incoming AC if the load get too high and uses the battery power instead. Because of how the helper works, both solar and AC load assist look exactly the same. I'm trying to figure out if there's a way to make a sensor ignore values between a certain time when I know there's no solar.
#Stopping solar input at night
1 messages · Page 1 of 1 (latest)
I dont understand your question. THere is no solar at night
if you mean your template goes negative, put a max(x,0) into it
yes that's the point
my inverter has two hybrid modes
DC support - Extra solar is used to power the loads so it backs off the incoming AC
AC support - AC is limited so if loads are higher, it draws up to the max limit and draws the rest from the batteries
the way I have it set up, they both look exactly the same. Incoming AC > Outgoing AC
I'm trying to make a sensor that outputs 0 when it's night and I know there's no sun coming in so it doesn't show up as solar in HA
I got help getting
{% if states("binary_sensor.is_sun_above_horizon") -%}
{% set inverter_output = states("sensor.inverter_output_active_power") -%}
{% set wall_input = states("sensor.inverter_grid_input_active_power") -%}
{{ max(inverter_output - wall_input, 0) -}}
{% else -%}
0
{%- endif %}
but it's not working
if the sun is above the horizon it shows as "on", otherwise it's off
if it's on, I want it to do that math
otherwise, show 0
the problem is, that code only shows the value (0) at the end no matter what
{% set inverter_output = states("sensor.inverter_output_active_power") | float -%}
{% set wall_input = states("sensor.inverter_grid_input_active_power") | float -%}
{% if states("binary_sensor.is_sun_above_horizon") | bool -%}
{{ max(inverter_output - wall_input, 0) -}}
{% else -%}
0
{%- endif %}
try this