What’s the easiest way to create a Home Assistant card with buttons that execute these URLs without actually trying to display the webpage? …just quietly executes the URL link.
I’m doing something wrong for sure. I looked under developer tools /service… the only thing I could find related to the service is called, rest_command.ac_humidity_mode
However, when I have the below settings, if I click on the card, nothing happens. I can make it happen if I just put the url in my web browser directly.
I don’t get any errors in the config or the card… however, nothing happens when I use the mouse to click on the card I created. I dont see an button in the card either. Just a card. The below command DOES work in the web browser though:
I was even able to specify an icon for this service. Just one more thing… could you give me an example card code if I have another button with a slightly different service name to be included in the same card? I tried and tried, but couldn’t figure it out.
I basically want to have a card that has multiple items like the example below:
Hey Tom. I really appreciate all your help. I was able to figure what I did wrong. I was using hyphens in the additional service names I had added instead of underscore. As soon as I switched to underscore and rebooted all the services were available to me. I deleted my post because I didn’t want to take up your time unless I absolutely had to. It’s all working thanks to you.
I was doing a bit of reading about restful commands and see why my original idea didn’t work. Payloads aren’t just appended to the URL in restful, they’re actually passed to whatever api is listening on the resource to do things like update delete or get values.
So what we ended up with is a bit of a hack. We’re actually asking an api (that doesn’t exist) to send (get) info from the URL resource. It works but strictly speaking the shell_command I posted above would be better suited in this case.
Switched everything to use shell_command:. The good news is now I know how to use both. I’ll use rest commands if I ever need to do real GET or POST REST API commands.
Hi Pita, the log shows that you’re getting an “Unauthorized” response aka 401 response. It’s possible that endpoint may only allow supported web browser user-agents only. Whatever the actual reason, it’s the endpoint that’s not allowing Home Assistant to make the REST calls.