Help to control mopidy volume and "streams" via script (api?)

Hi everyone

MoPiDy run at home - and it works fiine.
Now i want to “play” with api but my knowledge is to less…
How i can control the volume by API?
How i “say” mopidy to Play a stream (tunein:station:s303413)?
With Webfront End it works fine, but now i want a script with this step? so i can control mopidy by mi smarthome…)

I think this describe my situation below my 2 pain-Points :slight_smile:

With a bash or python i want to make a “start up” script (with API?) with the following steps

  1. Set volume to value xy
  2. Play stream a (by tunein (tunein:station:s303413)

Hi,

TLDR; Read the documentation!

The documentation gives examples of uses of the HTTP API, using curl; See HTTP JSON-RPC API — Mopidy 3.4.2 documentation.

You should also read about JSON-RPC; Understanding the Wikipedia page should be ok.

Then for 1. use the JSON-RPC core.mixer.set_volume method.

For 2. I would add the stream to the track list with a call to core.tracklist.add. But you should also have a look to core.tracklist.clear, core.playback.get_state and core.playback.play to handle non-empty track list, already playing instance, etc…

All public methods are documented in API reference — Mopidy 3.4.2 documentation.

Thank you for the answer.

Step 1 (adjust volume): → Yes, I found it in the documentation, but I’m stupid and it doesn’t work - please give me the command (which I have to send to MoPiDy) - I’m crying about my stupidity… - it shows me once again that I don’t know / can’t do “anything”…
Maybe then I’ll understand it and can then take a few intermediate steps for the second step (play stream).