Home Assistant Automation - Help :)

I use conditions in my code, my triggers are simply the sensor on which a change might trigger a condition. So not sure I can help you with this way of doing it.

I guess we discover and search in the dark till we find it :slight_smile:
I’ll advise if this works on not :smiley:

Looking at your automations

I would use numeric state and not state

Pool Pump OFF by the SOC
I highly doubt your SOC will change from 98 to 0. it wont fire, ever.
If you look at the example @jykenmynie posted, your trigger is merely the SOC changing.
You condition should be that soc is below 98

Excuse the bad formatting but look at the below

id: ‘1626782260356’
alias: Pool Pump OFF by the SOC
description: This automation turns the Pool Pump Off based on Victron Battery SoC
trigger:
platform: state
entity_id: sensor.battery_soc
condition:
condition: numeric_state
entity_id: sensor.battery_soc
below: ‘95’
action:
service: switch.turn_off
data: {}
entity_id: switch.sonoff_1000d90a15
mode: single

The best way to think about it is this

Conditions: when do you want it to happen, ie SOC under 95.
Trigger: what forces HA to look at the conditions, in this case, look at every time the SOC changes, regardless of the value.

I hope that makes sense

Just going to reiterate this, but I think more thought needs to be put into simply turning the pool pump off below X% SoC. This will be immensely frustrating on nice summer days where you want to run that pump all day to create enough demand for your PV. Or when you anyways want to run the pump because it is necessary and it is winter.

The pool pump needs to run, we know that. We can try and optimise when it run, but letting it run during daylight hours and when there’s enough PV being generated to run it.

We can also prohibit your inverter from taking too much power from the batteries during those times by limiting the inverter’s capacity to the PV being generated plus some amount if you still want to discharge the batteries a little.

When I first started the whole automation thing, I thought I wanted to automate my pool pump. Then I realised all I really wanted to do was use as much PV as possible and getting the batteries full and not abuse them.

A little since I hope

Based on your advice, here is the final product (still to be tested)

I could be mistaken, but a ‘state’ is merely on or off or open or closed.

You should use ‘numeric state’ instead.

To help you guys out a bit. This forum uses markdown. You can format anything in the original format by placing three backticks before and after it. (A backtick is the one to the left of the digit 1 at the top of a qwerty keyboard).

It looks like this.

Just be careful - You might end up turning the pump on and off quite frequently.

I use state on my SoC and it works. Numeric state seems more correct, but I’m bad with yaml at the best of times so if it works, it works.

Just to add that my pool pump runs from 3 hours after sun rise and turns off 2 hours before sun set. It is automated via Apple Home (Homebridge). During the day, it runs solely on PV…I generate enough to also run the pump and charge batteries…the batteries get charged by ay 13h - 14h (4 x US3000B).

Once I get this up and running, the next condition is not to turn it off on a cloudy days :slight_smile:

You can quite easily add that into HA’s automations as well. I’d limit the amount of automation software I’m using around the house. Having it all in HA, for example, would make troubleshooting exponentially easier.

1 Like

I am so used on VB forums…this one is a bit strange…
Trying to quote someone…agh, I’ll get used on it :slight_smile:

To quote someone, open your reply box, with it open, highlight their text and click “quote”.

Agreed, I just need to get to know HA a bit better. I’m an HA noob currently :smiley:

1 Like

This is a conversation im having with a friend at the moment, but the device in question is the geyser and not the pool pump.

Trying to store as much excess energy in the geyser as possible.
But at the same time use as much pv as possible and have the batteries at 100% SOC when the sun sets.

Gets very complex

Numeric state if you want to do <>, state works fine for any state, problem would be if its a number you cater for a specific number, ie when SOC changes to 100 notify my phone the batteries are charged

To optimise PV usage in total is next to impossible unless you have a huge battery bank that you never really want to get completely full (so there’s always a demand for whatever PV is available).

What I’ve done is to match my inverter’s capacity with the PV being generated (plus some offset if I want to allow some amount of battery discharge). I’ve therefore determined the maximum abuse I want to put my batteries through, and then I just use as much power as I need. Yes, it doesn’t optimise PV usage beyond what I need, but I find that I have way too much PV available in summer anyways and not enough in winter (unless it is a nice and sunny day), so optimisation isn’t as necessary to me as not abusing my batteries.

We were all nobs at some point.
Get comfortable with yaml, it makes it so much easier, i do most things in VSCode plugin.
Then the best newbie advice that I never got, is split your config from the get go, it get very annoying if everything lands up in 1 or 2 files and you have to dig to find something.

There are many videos on the subject, and I found frenck’s config very helpful
https://github.com/frenck/home-assistant-config

1 Like

Any luck with your YAML, Bobby?