@@ -207,17 +207,28 @@ automation:
|
||||
|
||||
### Execute Script Service
|
||||
|
||||
You can also execute scripts with arguments using the service:
|
||||
Run a pre-defined server script. Use the `target:` block to scope the call to a
|
||||
specific hub (or area / entity); omit it to fan out to **all** configured hubs.
|
||||
|
||||
```yaml
|
||||
# Run on a single hub
|
||||
service: remote_media_player.execute_script
|
||||
target:
|
||||
device_id: <device id of the hub>
|
||||
data:
|
||||
script_name: "echo_test"
|
||||
args:
|
||||
- "arg1"
|
||||
- "arg2"
|
||||
params:
|
||||
message: "hello"
|
||||
|
||||
# Run on all hubs (legacy fan-out)
|
||||
service: remote_media_player.execute_script
|
||||
data:
|
||||
script_name: "shutdown"
|
||||
```
|
||||
|
||||
> Without a target, the service runs on every configured Remote Media Player.
|
||||
> For destructive scripts (shutdown, reboot, lock) always pin a target.
|
||||
|
||||
## Lovelace Card Examples
|
||||
|
||||
### Basic Media Control Card
|
||||
|
||||
Reference in New Issue
Block a user