Increase bulb temperature with button press

hello. i am trying to create an automation to increase my smart bulbs color temp when i press a button but cannot seem to get it to work. here is what i currently have:

action: light.turn_on
metadata: {}
data:
    kelvin: "{{state_attr('light.kauf_bulb', 'color_temp_kevin') -500 | float}}"
target:
  device_id: light.kauf_bulb

Should be:

target:
  entity_id: light.kauf_bulb

and

Should be:

data:
    kelvin: "{{ [ state_attr('light.kauf_bulb', 'color_temp_kevin')|int(0) - 500, 333]|max }}"

Replace 333 with the minimum colour temperature your light supports.

for

action: light.turn_on
metadata: {}
data:
    kelvin: "{{ [ state_attr('light.kauf_bulb', 'color_temp_kevin')int(0) - 500, 6667]|max }}"
entity_id: light.kauf_bulb

i get this error

Message malformed: template value should be a string for dictionary value @ data['actions'][1]['choose'][4]['sequence'][0]['data']

Should be
)|int(0)

this will actually change the temp, but it just sets it whatever i enter as the max temp

Read it again:

this still didn’t work for me, but the below did

action: light.turn_on
metadata: {}
data:
  kelvin: >-
    {{ state_attr('light.kauf_bulb', 'color_temp_kelvin') |
    int - 500 }}
target:
  device_id: light.kauf_bulb

That will keep going lower until you get errors and your automation is disabled. Put the limit back in.

{{ [ state_attr('light.kauf_bulb', 'color_temp_kevin')|int(0) - 500, 333]|max }}