looking to build an automation that will compare the temp from a TEMPer sensor and the value of an input slider, if they don’t match, turn on a switch. then once they do match, turn off the switch.
does anyone have some example or similar code i can look at?
Try the Generic Thermostat component. You specify the temperature sensor and the switch the heater is connected to. It has worked very well for me with a space heater in one of our cold bedrooms.
I’ll paste my set up below. You’re right, there isn’t a way to just ‘turn off’ the generic thermostat (at least not that I found), so I set the default target very low (50 F), and then use an automation to set the target to a realistic temperature when certain conditions are met, for instance, when the house thermostat is in ‘sleep’ mode. This effectively turns off the thermostat when I don’t want it running. You could easily do the same with a different condition, such as the device tracker.
In the fronted, it displays the same as a regular thermostat would. When you click on it, it shows a graph with history, and allows you to set a target. It used to display as a slider, i think in one of the recent versions upgrades, it changed to up and down arrows.