Hey! Stupid question, but I did research and so man tries but i can’t get the Curl command to work!
This one: curl -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "{\"type\":\"scroll\",\"config\":{\"mirror\":true}}" "http://127.0.0.1:8888/api/devices/wled-veletta/effects"
Does it work from the command line? Make sure the command works there first.
Honestly, it’s just not worth fighting with executeCommandLine on stuff like this. Put the curl command into a shell script and call the shell script .
Yes it works, and now it does exactly as you suggest (i’m on windows, calling a batch file).
I just tried to turn the code a little more elegant than calling a bunch of external files.
But if you say it’s better, i’ll go that way!
Thanks
First of all, you are saying the content is plain text but your data is in JSON format. In PHP when i use cURL commands similar to that I use variables to try & avoid the escaped quotes in the JSON.
It is good practice in ANY script to put the full path to the command in it. Mosr times th script is running in a different environment with a different default path.
I know, but that’s the only way i got it to work in cmd, and it was mostly created by Chrome, inspecting the webpage.
I don’t have any error in the log, OH does the job, I guess it’s just the output to be formatted the wrong way; then the receiver doesn’t get the message.