Automation with a dynamic value

what am I doing wrong ? I want to set a dynamic value in an automation, but this doesn’t seem to be working.

alias: Wallbox On - Sun above horizon (test)
description: ‘’
trigger:

  • platform: state
    entity_id: device_tracker.pixel_5
    from: away
    to: home
    condition:
  • condition: numeric_state
    entity_id: sensor.yv1pwbfvdm1162912_battery_level
    below: ‘100’
    action:
  • service: lock.unlock
    target:
    entity_id: lock.wallbox_portal_lock
    data: {}
  • service: switch.turn_off
    target:
    entity_id: switch.wallbox_portal_pause
  • service: number.set_value
    target:
    entity_id: number.wallbox_portal_max_charging_current
    data:
    value: (states(‘sensor.boerenkrijgstraat_10_reactive_amperage’)|round(0))
    mode: single

Please edit your post and format it correctly. See point 11 here.

The unformatted config makes it difficult to tell if you have anything else wrong, but you need to construct your template correctly:

value: "{{ states('sensor.boerenkrijgstraat_10_reactive_amperage')|round(0) }}"

More info on doing this here.