hi new to home assistant and getting hooked already. after some tips to solve the following,
i have a solar panel connected to a victron controller with an esp32 for home assistant to read the data ive got that working ok i would like a battery charger to take over and switch on between 2 set battery voltages via a smart plug. i need an automation to turn it on when its at say 11v and turn off at say 12.5v ive set up 2 automations 1 to turn on and another to turn off i was wondering if i can do in 1 automation
Yes, but being new sometimes a simpler automation that does one thing might be a better starting point.
thanks for the reply i think it might be best with 2 as you say untill i get the hang of things
Those two numeric_state triggers need the value to actually cross the line while the automation is loaded. If Home Assistant restarts while the battery is already sitting at 10.8 V, the “below 11” trigger has nothing to cross, so the charger never comes on. What I ended up doing instead, on three devices here, is a time_pattern check every 10 minutes with the voltage as a condition, plus an input_boolean latch that only clears at the opposite threshold. It is uglier to read, but it survives restarts, and one more thing to watch: above and below are strict in HA, so exactly 11.0 matches neither.
Another way than timed polling is to trigger at home assistant start and have the voltage as condition (as well as a second trigger with the voltage).
That is simpler and it does cover the restart case. The one it still misses is a reload: I changed a threshold on one of mine yesterday and used automation.reload instead of restarting, and a homeassistant start trigger would not have fired there. Small thing, but that is the exact moment you have just edited the numbers and most want it armed.