Volume setting groovy module

You need a custom app in order to observe and react to events on devices. This is a pretty good and simple example: HubitatPublic/contactMotion.groovy at master 路 hubitat/HubitatPublic 路 GitHub

It subscribes to Contact events on a device that the user selects while configuring the app. This is important -- you can't just subscribe to events from any old device without selecting it in an app preferences page. You need to find the relevant capability from this page to filter on in the input.

For your use-case, you could handle the actual volume updating on the device a couple of ways:

  • If an existing driver exists that exposes a capability such as MusicPlayer, you can just execute commands on that device in the event handler of your custom app. In this case, you would want to create and configure a child device of the music player's type, as shown in the example I linked and using the interfaces further documented here.
  • If a driver doesn't exist or you prefer not to use one, you can just do the HTTP accesses directly in the handler method of your app. The typical HTTP methods are documented here, and a useful example of usage (in a driver, though it's basically the same in an app) is here: HubitatPublic/httpGetSwitch.groovy at master 路 hubitat/HubitatPublic 路 GitHub