Request for assistance with Automation linked to Inverter values

Good day,

I am new to Home Assistant and have integrated my Solar system into Home Assistant via MQTT.

I would like to have an automation setup which would allow my pool pump to only switch on when the solar batteries are charging (more than 50Watts charging) and the battery state of charge is above 74% and for the pool pump to turn off as soon as more than 700Watts of solar battery power is consumed.

I have created the following automations which are working to some extent. My challenge is that the automation to turn the pool pump on only trigger when the value of 50Watts charging is crossed and does not trigger when the charging is above 50Watt whilst the solar battery state of charge is above 74%

The automation for the switching off of the pool pump is working as required.

Could the members kindly please assist me to fine-tune the automation to turn the pool pump on when the solar batteries are charging (more than 50Watts charging)

Pool Pump on Automation YAML:

alias: Pool Pump on if Battery Power is >50Watt & SoC >75
description: Turn on Pool Pump if Battery Power is >50Watt & Battery SoC >75
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.battery_power
    above: "50"
condition:
  - condition: sun
    after: sunrise
  - condition: numeric_state
    entity_id: sensor.battery_state_of_charge
    above: "74"
  - condition: sun
    before: sunset
action:
  - type: turn_on
    device_id: dfdecabb5649013065514d6c74b5f481
    entity_id: switch.sonoff_10017447ea
    domain: switch
mode: single

Pool Pump off Automation YAML:

alias: Pool Pump off if Battery Power  is >-700Watt
description: Turn off Pool Pump if Battery Power  is >-700Watt
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.battery_power
    above: -700
condition:
  - condition: sun
    after: sunrise
  - condition: sun
    before: sunset
action:
  - type: turn_off
    device_id: dfdecabb5649013065514d6c74b5f481
    entity_id: switch.sonoff_10017447ea
    domain: switch
mode: single

Any assistance would be greatly appreciated.

You need to add another trigger which monitors the charge %… and a condition to correspond to the power criteria.

alias: Pool Pump on if Battery Power is >50Watt & SoC >75
description: Turn on Pool Pump if Battery Power is >50Watt & Battery SoC >75
trigger:
  - platform: numeric_state
    entity_id: sensor.battery_power
    above: "50"
    for: "00:01:00"
  - platform: numeric_state
    entity_id: sensor.battery_state_of_charge
    above: "74"
    for: "00:01:00"
condition:
  - condition: sun
    after: sunrise
  - condition: numeric_state
    entity_id: sensor.battery_state_of_charge
    above: "74"
  - condition: numeric_state
    entity_id: sensor.battery_power
    above: "50"
  - condition: sun
    before: sunset
action:
  - type: turn_on
    device_id: dfdecabb5649013065514d6c74b5f481
    entity_id: switch.sonoff_10017447ea
    domain: switch
mode: single

Dear Drew,

Thank you very much for your assistance. I have made the amendments you suggested and the automation works perfectly now.

Your assistance is highly appreciated.

Note that if your battery power threshold isn’t crossed before sunset, your pump will run all night…