Pool automation - Help [ SOLVED ]

Hello

I’m not very knowledgeable in Yaml programming, but with the examples from this and other forums, I’ve been able to automate my home.

I have an automation that stops the pool motors when the filtration cycle is complete, and it works, but I want to go further and set the runtime through an “input number,” but I can’t get it to work in the automation.

In version 1, the automation works perfectly; in version 2, it doesn’t work, and I don’t have the ability to understand why.

Could someone point me to the error?

Version 1 - Working

- alias: Desligar Bomba da Piscina ciclo completo
  trigger:
    platform: numeric_state
    entity_id: sensor.piscina_horas_total_formatado
    above: 680
  action:
  - service: switch.turn_off
    entity_id: switch.stch_piscina_moes_2gang_switch

Version 1 - Not Working

- alias: v2 Desligar Bomba da Piscina ciclo completo verão
  trigger:
    platform: numeric_state
    entity_id: sensor.piscina_horas_total_formatado
    above: "{{ states('input_number.horas_funcionamento_piscina') | int }}"
  action:
  - service: switch.turn_off
    entity_id: switch.stch_piscina_moes_2gang_switch

Thank you all

It doesn’t work because above doesn’t support templates. However, it does allow you to specify the entity_id of an Input Number (and other numeric entities).

- alias: v2 Desligar Bomba da Piscina ciclo completo verão
  trigger:
    platform: numeric_state
    entity_id: sensor.piscina_horas_total_formatado
    above: input_number.horas_funcionamento_piscina
  action:
  - service: switch.turn_off
    target:
      entity_id: switch.stch_piscina_moes_2gang_switch

From the documentation:

1 Like

It work like it should, thank you a lot.

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.

For more information about the Solution tag, refer to guideline 21 in the FAQ.

1 Like