Run Script via HTTP Shortcut on Android Tablet

A long time ago I used “HTTP Shortcut” to create some icons on my tablet to turn switches on and off through http post messages, e.g.:

http//192.168.1.1:8123/api/services/switch/turn_on
{
  "entity_id":"switch.switch_name"
}
http//192.168.1.1:8123/api/services/switch/turn_off
{
  "entity_id":"switch.switch_name"
}

Saves me from having to load the whole dashboard just to switch a light on or off.

I tried to find a similar way to invoke some of the scripts I use with my Broadlink RM ProPlus but am close to giving up.
Does anybody have any hints?

And while I’m at it:
Is there something similar to trigger the scenes form my climate control (via Wink)?

I guess scripts and scenes are similar to the switch functionality, but can’t seem to figure out the exact URLs :frowning:

You call scripts from a service. The api documentation for that is here.

So it should be

http://<host>/api/services/script/<script_name>

The body should contain any parameters the script needs.

Also note that this must be using the `POST`` method.

Edit:
You can test calling services with parameters using the Services page under Developer Tools on the HA web ui.

Thanks for that @gpbenton - was trying to read through the documentation but couldn’t draw the right conclusion.

Also tried to replace ‘script’ with ‘scene’ but that that seems to be too simplistic an approach. Do you have another hint for me?

I don’t use scenes, so I have never tried, but the documentation seems quite explicit

Scenes can be activated using the service scene.turn_on (there is no ‘scene.turn_off’ service).

Thanks again, @gpbenton!
I looked at the link you provided earlier again and can’t find any mention of ‘scenes’.

And this is what’s killing me sometimes:
A scene, just like a script, is a ‘turn_on’ action only - but the syntax required is different :confused:

I agree, it isn’t very consistent.