Automation not working/sarting

Hi;

My problem is that I would like to start the pool pump whenever mit Photovoltaic deliver > 1000watt and the Battery charge state is > 20%

This is the Yaml I ended up with:

alias: Pool an
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.enpal_solar_production_power
    attribute: measurement
    above: 1000
conditions:
  - condition: numeric_state
    entity_id: sensor.enpal_battery_percent
    above: 20
actions:
  - type: turn_on
    device_id: 32b38020a0a4b2a07378cb498bf73fa3
    entity_id: b08bf2428bb90f79af11a4471b795ff1
    domain: switch
mode: single

unfortunately it does not work. Anyone see my Mistake?

Any help appreciated :slight_smile:
Thanks

When you say it doesn’t work, do you mean…

  • It never triggers
  • The condition always stops it
  • The action doesn’t have the desired effect

…?

Possibly you have run into the common stumbling block of understanding the difference between triggers and conditions? Triggers are things that happen at a moment in time that start the automation. Conditions are states that must be true or else the condition is stopped. In other words, your automation could be read as "When the solar power production goes from below 1000W to above 1000W and IF and ONLY IF the batter percent is over 20, THEN start the pump. But maybe you also want the pump to start if the batter goes from below to above 20% but ONLY IF the production power is > 1000W. If so, you will need to have the power and the battery state as both triggers and conditions.

alias: Pool an
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.enpal_solar_production_power
    attribute: measurement
    above: 1000
  - trigger: numeric_state
    entity_id:
      - sensor.enpal_battery_percent
    above: 20
conditions:
  - condition: numeric_state
    entity_id: sensor.enpal_battery_percent
    above: 20
  - condition: numeric_state
    entity_id: sensor.enpal_solar_production_power
    attribute: measurement
    above: 1000

Written like this, this automation says "When either the power goes above 1000W or the battery goes above 20% and IF both the power is above 1000W and the battery is above 20%, then do the action(s).

1 Like