Pause current - play new - resume pauzed file
#1
Dear,

For my setup I've bought a raspberry pi 2. I've just installed kodi/osmc rc3. What a wonderfull program!!

For my house setup I'm working with loxone. The plan is to use the ceiling speakers also as my doorbell.
I've created following code, which plays when the doorbell is pressed:

Code:
/jsonrpc?request={"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"file:////home/osmc/Music/Geluid_huis/Deurbel.mp3"}}}

Dispite my best efforts, at the moment I'm still stuck resolving following issue:
When playing a stream or mp3 file, the currect file is stopped when the "doorbell" is pressed. The file that was playing is stopped and I need to start it again by hand.

Is there anybody that knows a code which would do the following?
- Pause current file
- Play mp3 with doorbell sound
- Resume file that was playing before the doorbell was pressed

More than probably following code for pauze is needed?
Code:
curl --user foo:bar --header 'Content-Type: application/json' --data-binary '{ "id": 1, "jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": 2 } }' 'http://192.168.1.127/jsonrpc'

An idea that pops to my mind: Play the doorbel via a secondary external player in Kodi. Thus, using the same amplifier, but just use a second "software" player within Kodi.

Secondary, following question pops up my mind:
Would it be possible to put in the % of volume for the doorbell? So when I play my music rather loud, the doorbell should always ring at the same volume level.
Reply
#2
It's not exactly what you asked for, but if you can check out eventghost! You can make your doorbell create some sort of event that when triggered, can mute kodi(or pause or whatever!), play the desired mp3 at whichever volume you would like and then unmute or unpause kodi. I have been playing with eventghost straight for the last 4 months and it is by far the BEST set of automation software I have ever come across!
Reply
#3
Thank u for the code to start playing the doorbell. Ive been trying to get it to work for 4 weeks.
Ive got a similar setup with loxone and also the same problem.

My idea is to make loxone play a few different streams (like stubru) and make it restart it when the doorbel rings
But this could be difficult if u have alot of different strings or mp3 u want to play. So the simple solutuion is to just get another rasberry. One for music playing and one for doorbell/anouncements.
Reply

Logout Mark Read Team Forum Stats Members Help
Pause current - play new - resume pauzed file0