How to create an input control to lovelace UI?

I have a Mitsubishi AC unit and I’m using MELCloud integration to control it from Home Assistant. The AC device itself has a flaw that the air it does not spread around the apartment well so the internal thermostat thinks that the desired temperature is already reached even though it’s not. So I would like to control the temperature and other settings based on remote temperature sensors.

In order to define the temperature request for the AC I have created a python script that takes the remote sensor value (as current temperature) and desired temperature as inputs. It calculates the temperature request to be sent to the AC unit.

I have figured out the automation that calls for the script every now and then and sets the request for the AC. And it works. Took awhile to search here at the forum to find out how the “templates” works for getting the current temp as input to the script.

The las part I just cannot copmrehend, even though I would have supposed to find it easily from the documentation. How do I create an input to the lovelace UI?

Currently I have the desired temp hardcoded in the automation. I would like to be able to set the desired temp with a control in lovelace UI. Similar to a thermostat card. It could be an up/down arrow button setup and the number so that when you click up, the number steps up. Or a slider showing the number as well. And then I would like to pass that value to automation as the desired temp.

By searching I found several examples (or various issues) related to input_number, input_boolean, etc. But none of them exactly how to create such to the lovelace UI.

That’s the thing is that you don’t have a traditional climate entity to use the lovelace thermostat card. I’d say look at simple thermostat card, I believe it is flexible enough to do what you need.

There are other thermostat cards as well. Otherwise use a custom card, you could build it from the existing cards and modifying them.

Use generic thermostat and give fake entity so you just have front end control in Lovelace. Use this value to set temp in your automation

Thank you for your suggestions. I learned a lot while examining them.

I did try to use those thermostats as fake entities so that they would only act as input, but failed in doing so. Eg. if I added the simple_thermostat card with a fake entity name it actually corrupted the dashboard to be empty. After changing a real entity name the dashboard and the card loaded nicely.

While fiddling with those I found the solution myself, which was very simple. I just wasn’t able to describe the need well enough in my question: input_number. I found someone asking how to add an input_boolean to the dashboard and there was the answer: via Helpers. So what I did was I added an input_number to the dashboard, specified the entity name and that’s it.

Now I can use the state (=value) of that entity in my automation as the desired temperature.