I have a scrpt which is shutting down a linux pc, which thanks fot some help is now working.
however, at the end of the script I have a second section where i switch off thesmart plug. Im using this command in the script;
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer abcdthekeyishere" -d '{"entity_id": "switch.autodarts_plug", "state": "off"}' http://192.168.4.57:8123/api/services/switch/turn_off
The command doesnt work in the script or from trminal, it just throws a 400 error.
The entitle id is correct...and the switch for the device works perfect from the dashboard. Does anyone know what might be wrong with the command?