Numeric state trigger not working

I’m having trouble with an automation, I’d really appreciate if someone could take a look and point out what I’ve done wrong. I’m trying to turn the spa heater on when the solar panels are producing excess power. But this trigger never fires.

alias: Solar Spa automation
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.solar_generation
    for:
      hours: 0
      minutes: 0
      seconds: 0
    value_template: ""
    above: 2000
    id: "on"
  - platform: numeric_state
    entity_id: sensor.solar_generation
    for:
      hours: 0
      minutes: 2
      seconds: 0
    value_template: ""
    id: "off"
    below: 200
condition:
  - condition: state
    entity_id: input_boolean.solar_spa
    state: "on"
action:
  - choose:
      - conditions:
          - condition: trigger
            id: "on"
        sequence:
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.my_spa_economy_mode
      - conditions:
          - condition: trigger
            id: "off"
        sequence:
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.my_spa_economy_mode
mode: single


You have told HA to ignore the value of sensor.solar_generation and instead use the value of the template.

The template is empty, it has no value.

No value is never going to rise above 2000 or below 200.

Try removing those lines :wink:

1 Like

You can also get rid of the choose.

- service: "switch.turn_{{ trigger.id }}"
  target:
    entity_id: switch.my_spa_economy_mode
1 Like

Thank you!

I had the same problem, but the blank value_template was added automatically by the visual editor when I accidentally typed something into that field and deleted it. In this state the only way to clear that field is to switch to YAML. What’s the right way to escalate this as a bug?

Check for known issues - there should be one there.

1 Like