Are you able to get any information on whether the garage is open or closed? If not, then I think youâd want a button in HA that can simply issue the POST request and it will toggle the garage.
First youâd set up a RESTful command which allows you to issue your POST request by calling a service.
Next youâd create a template button which would call the service you just created every time the button is activated.
Finally, youâd add something like a button card to a lovelace dashboard so you have an easy way to press the button.
Well, I tryed it on Developer Tools > Service and that worked.
But It didnât quite understand how to crease the template button. Can you give me an example?
this is the rest command I made. I donât need to pass any other information.
(Later Iâll put the authorization in the secret and maybe Iâll create a command to get a new authorization automatically)
If I create a template it will become an entity? sorry, but Iâm a bit new to HA. I want to expose an entity to Alexa to open the garagem door. I know I can do that throw Script, right? Is there a way to create an entity?
Yes a template entity will create an entity. So if you put this code in your configuration.yaml file and then reload template entities (or restart HA if this is your very first template entity) then a new entity will show up called âGarage Door Buttonâ.
If you already have template entities, make sure you donât duplicate the template: heading.
Sorry, I see I didnât answer all your questions. The button entity can be exposed to a Alexa and it will show up as a âsceneâ in the Alexa app. You should be able to say âAlexa turn on Garage Door Buttonâ and the button will get activated.
You can also create a script instead of a button, and the script will show up in Alexa as a âsceneâ also.
Another option is a template switch, which would show up in Alexa as switch. For the state of the switch, you can just have it turn back off automatically a few seconds after it is turned on.