Automation suddenly not triggering

HA version 2021.4.6

I have a simple automation to detect when my EV is charging and disable the house battery from discharging. It was working perfectly until a week ago. I have checked the Logbook and the binary sensor is working but it is not triggering the automation.

Any ideas greatly received.

Max

alias: Charge Car - Disable House Battery Drain
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.car_charging
    to: 'on'
    from: 'off'
condition:
  - condition: numeric_state
    entity_id: sensor.emoncms_import
    above: '3250'
  - condition: numeric_state
    entity_id: sensor.solax_battery_capacity
    above: '20'
action:
  - data: {}
    data_template:
      entity_id: input_number.solax_battery_discharge
      value: '0'
    service: input_number.set_value
mode: single

check your logs for any errors.

but try removing the extra “data_template:” line from the service call.

it’s not a template so it’s not needed and I’m not sure if that would cause any issues or not.

action:
  - data:
      entity_id: input_number.solax_battery_discharge
      value: 0
    service: input_number.set_value

You’re totally right @finity! According to the documentation if both data and data_template are set, data has precedence. :slight_smile:

1 Like