Looks like you are using a word processor for your commands. Your single tics and double tics are replaced with stylized open and closed quotes. Replacing these symbols with the simple single and double tics solves the problem.
If the machine you’re using the curl command on can run python3 then the above will help you write a little python script that calls Hass just the same. You’ll need to install Hass to the machine, but you don’t have to run it - just to get the remote python module (well, that’s how I did it).
You’ll probably want to go with remote.call_service rather than remote.set_state in my example, there’s some more ideas in the link. It will definitely work, and it’s how I avoided long curl commands with quotes all over.
I’ve tested in on OSX and the command runs without issue… Are you using windows? Someone else had a similar problem last week (note the use of only double-quotes):
I understand. Your post with your version of the command shows odd quotes. You need to figure out why your editor is using them and change settings etc for the future???
I’m also trying to call home assistant through a curl command.
The script I try to call is “Ampli”, it helps me using a Broadlink RM4C Mini to send a command to my Denon Amplifier.
Here is my script. curl -X POST -H "Authorization: password" -H "Content-Type: application/json" -d "{ \"entity_id\": \"script.Ampli\" }" http://192.168.1.2:8123/api/services/script/Ampli
I get the error “400: Bad Request”, do you have any idea what could provoke this error ?