Putting a variable value in modbus.write_register

Hello! :slight_smile:
Been trying to automate a hot water heat pump, attempting to vary the demanded temperature based on the current measured one. Testing modbus.write_register, it works fine when I take an actual integer like 55 as the value, but what I did here doesn’t seem to count as an integer. How do I make it so it does?

action: modbus.write_register
data:
  hub: modbus_warm_water
  address: 2
  value: {{ states('sensor.water_heatpump_display_temperature')|int(0) + 5 }}

(Please be kind, I’m super new to this!!)

See Rule #1: HA Docs - Building Templates - Important Template Rules