Slider controlled temperature setpoit not working

I have this:
slider: input_number.slider1
sensor: sensor.temperature
switch: switch.relay1

Is there any way to compare the two entities and switch the relay on and off depending on the comparison output?

Of course, the function node is your friend.
If you want to directly compare the values, you would need to make sure that they are in the same format.

You could define the payload as a variable (and edit the variable so it fits in the format)
and then compare these 2 payloads.

I don’t have an exact example for this right now, but the general syntax is similar:

var remote = flow.get('remote');
var motion = flow.get('motion');
var gaming = flow.get('gaming');
if (remote + motion + gaming == 3){
    msg.payload = "True";
} else {
    msg.payload = "False";
return msg;

You could also use the switch node to compare 2 values to each other.