First, you can’t conditionally include a parameter in a service call. Second, you really need an else part to your if statement. The following will change the color temp to 454 if it is currently 250, or will leave it the same if it’s not 250.
EDIT: Actually, now that I think about it, if the light happens to be off when this automation runs, it won’t work, because a light that is off won’t have a color_temp attribute. So maybe the following would work better:
- id: '1531570360460'
alias: test
trigger:
event_data:
event: 4002
id: vrumtakremote
event_type: deconz_event
platform: event
condition: []
action:
data:
entity_id: light.vrumtak
color_temp:
{% set ct = state_attr('light.vrumtak', 'color_temp')|int %}
# If light was on and color temp was 250,
# change to 454
{% if ct == 250 %}
454
# If light was off ct will evaluate as zero,
# so use some default value
{% elif ct == 0 %}
300
# If light was on, but color temp was not 250,
# then leave as is
{% else %}
{{ ct }}
{% endif %}
service: light.turn_on
This uses the state_attr() function, which will return None if the attribute doesn’t exist. None cast to an integer will evaluate to the value zero.