Automatic control of a pump via the solar system

Hello,
I’m brand new here, so apologies in advance if my post isn’t complete.

I’m trying to use Home Assistant to automate a pump based on data from my solar power system.

I’ve already installed EcoFlow Cloud on Home Assistant and can see my smart plug there as an entity. What I’m missing is my PowerOcean and my storage unit.

I wrote the following script, but since the entities sensor.ecoflow-pv_power and sensor.ecoflow_soc cannot be found, the pump cannot be switched on automatically:

Blockquote

type: vertical-stack
cards:

  • type: entities
    title: :man_swimming: Pool control
    show_header_toggle: false
    entities:
    • entity: input_select.pool_pump_mode
      name: Mode selection
      icon: mdi:cog
    • entity: switch.pool_heat_pump
      name: Heat pump
      icon: mdi:water-pump
      state_color: true
  • type: glance
    title: :sunny: Energy overview (EcoFlow)
    entities:
    • entity: sensor.ecoflow_pv_power
      name: Solar power
      icon: mdi:solar-power
    • entity: sensor.ecoflow_soc
      name: Battery level
      icon: mdi:battery-high
  • type: conditional
    conditions:
    • entity: switch.pool_heat_pump
      state_not: “off”
      card:
      type: markdown
      content: |
      :green_circle: The pool pump is currently running.
      Making optimal use of available solar energy.
  • type: conditional
    conditions:
    • entity: switch.pool_heat_pump

Blockquote

Does anyone know how to solve this problem?
Thank you in advance.

That’s not a script. It is a dashboard card config. And to automate things you need to write an automation. Not a script or card.

Also: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16