Howto create toggle button which turns state to 0 or 1? - PyScript automation

Hi,

I have a pyscript automation setup, in which I control my Heatpump based on if I have enough solar power available or not. Now I would like to turn on and off the automation with a toggle switch from my frontend. I would like to do this by setting a state to 0 or 1, such that my automation script then can run or not. But for the live of me, I cannot figure out how to add a toggle button to the lovelace frontend. Therefore: How can I get a toggle button to toggle a state which then can be read from my pyscript.
Note that I do know how to make my PyScript automation react to this state, but I need Lovelace to toggle this state…

Sorry for this pretty newby question, I am sure, but I searched quite some while and I could not find how to do this. I found how to trigger events, but that is not what I want to do.

Create an input_boolean in settings/devices&services/helpers. Use this to trigger your automations. In one automation set it from on to off and other automation off to on.

Thanks for the quick reply. But that does not answer my question: How can I tie this helper toggle button to an toggle button on the frontend?

The input_boolean."your helper toggle name " will be an entity. Put it in an entity card or entities card and it will appear as a toggle switch. When switched one way it triggers one automation and toggled the other way toggles the second automation.

Ahh, perfect. The entities card is what I was searching for. Thanks very much!
Just one last question. Can I somehow put the entities card and a button which calls a service in one panel?

Run that service from a script and you can put the script in the entities panel