Lovelace communication with Node-Red

Hi I have used Node-red for some years, but 2 weeks ago I installed home assistant, because it knows much more device and I’d like to use UI of it (different UI for different user).

I have several complex automatism in node-red, so I’d like to use HA and NR to complement each other.

It means for example there is a start button and a number input on lovelace card. I set a number and switch the button on lovelace and the node-red gets the change of number and the button state. The node-red do something and gives back a control (e.g. relay on and set temperature) which set a device (e.g. heating on and temperature setting) and the new value and a new button state appear on lovelace.

So may question is how I can add text field, button, etc to lovelace when there is not physical device entity, only there is mqtt or other connection with node-red?

Look up helpers in HA. They are probably what you want. They create various entities you can read from - such as numbers, times, booleans, etc. I have e pretty complicated set of room motion timers that work this way, I use lovelace to display the setting s UI which is nothing more than a collection of helper entities. My automations (all in Node-Red) read those entities and react accordingly.