@farstreet wrote:
I have created a TTS script in my configuration that needs 3 variables to run properly. When calling this script in my automations, I simply do:
- service: script.google_home_notification data: exclude_bedroom_when_sleeping: "yes" language: "en" message: "this is a test"
Works like a charm. However, I also want to be able to call this script via the REST API but I can’t seem to get the URL (see below) correct, I keep on getting
400: Bad Request
back. When I do a POST to a script without variables, that works fine, it executes without any problem.curl --location --request POST 'MYURL/api/services/script/turn_on' \ --header 'Authorization: Bearer MYTOKEN' \ --header 'Content-Type: application/json' \ --data-raw '{ "entity_id": "script.google_home_notification", "exclude_bedroom_when_sleeping":"yes", "language":"en", "message":"this is a test" }'
I tried variations that included
data, data_template, service_data,
etc… but without any success…
Searched Google and this community for hours already… Kinda expect that it’s going to be a small stupid error but I just can’t find it… Help
Posts: 1
Participants: 1