lukasroegner / homebridge-apple-tv-remote

Plugin for controlling Apple TVs in homebridge.
MIT License
131 stars 13 forks source link

Can this code be used in 'apple shortcuts' as script to control volumeup & volumedown on the Apple TV? could you post or reply an example. cheers #85

Closed mrfibreoptic closed 3 years ago

mrfibreoptic commented 3 years ago

Can this code be used in 'apple shortcuts' as script to control volumeup & volumedown on the Apple TV? could you post or reply an example. cheers

lukasroegner commented 3 years ago

You can use the plugin HTTP API to send a virtual volume-up or volume-down to the Apple TV. This, however, works only if you can control the volume directly on the Apple TV (infrared via Siri Remote is not supported).

POST http://<YOUR-HOST-IP-ADDRESS>:<apiPort>/<UNIQUE-NAME>

{
  "commands": [{ "key": "volumeup" }]
}

or

POST http://<YOUR-HOST-IP-ADDRESS>:<apiPort>/<UNIQUE-NAME>

{
  "commands": [{ "key": "volumedown" }]
}
mrfibreoptic commented 3 years ago

9000F5CD-D88D-40D2-A737-A804E80CC651

where do I put the command?

lukasroegner commented 3 years ago
  1. Remove the "<" and ">" characters from the URL
  2. key = commands, value has to be of type Array
  3. Add a single entry to the Array, type Dictionary
  4. Add a new property to the Dictionary, key = key, value = volumeup
mrfibreoptic commented 3 years ago

any chance you could create a volume up shortcut that you could share so i can understand better? apologies for being a pain