Almost got it!
{{ (states.sensor.nextalarm.state.split(" ")[0] | int *60 ) | timestamp_custom("%H:%M") }}
Allmost gives me the correct time (for some reason it adds 1 hour). Do I have to add the timezone somehow?
Got it working by cheating with the sensor template but it isn’y how it should be:
{% set relative_time = (states.input_slider.alarmhour.state|float|multiply(60) + states.input_slider.alarmminutes.state|float) - (now().hour|float|multiply(60) + now().minute) %}
{%- if relative_time < 0 -%}
{{23*60+relative_time}}
{%- else -%}
{{ relative_time-60}}
{%- endif %}