INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Doorbell  (Read 1112 times)

flac.rules

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1268
Doorbell
« on: October 05, 2021, 01:30:04 am »

I use MC (among other things) as a doorbell, is there a way (with expressions), to mute/pause (i guess ideally mute, since it works with movies), the currently playing file, play the doorbell sound file, and then continue where it left of? (that is without messing up the rest of the playlist, and continuing from the same part of the same song?)
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2674
Re: Doorbell
« Reply #1 on: October 05, 2021, 04:31:39 am »

How are you triggering the doorbell sound?

Expressions won't help you do that. I guess you could write a script that uses the MCWS API to do that, but it's not trivial. Perhaps by creating an extra Zone just for the doorbell output, then pausing the current zone playback, play the doorbell on that 2nd zone, then resuming the current zone. Not sure if MC has all pieces in place to do this though.
Logged

flac.rules

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1268
Re: Doorbell
« Reply #2 on: October 05, 2021, 06:05:23 am »

How are you triggering the doorbell sound?

Expressions won't help you do that. I guess you could write a script that uses the MCWS API to do that, but it's not trivial. Perhaps by creating an extra Zone just for the doorbell output, then pausing the current zone playback, play the doorbell on that 2nd zone, then resuming the current zone. Not sure if MC has all pieces in place to do this though.

The triggering is pretty easy (If i didn't have the other things i wanted to do), I just send a web command like this: [Serverinfo]/MCWS/v1/Playback/PlayByKey?Key=1414819&Zone=10012&ZoneType=ID, this plays the file that is the doorbell sound. But this wipes the playlist, and doesn't continue playback afterwards.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2674
Re: Doorbell
« Reply #3 on: October 05, 2021, 07:16:16 am »

I think you can play different tracks to different zones at the same time (but I'm not sure). You could try cloning your current zone (using same hardware), then:
- pause zone 1
- play doorbell on zone 2
- resume zone 1

Try it manually... if it works, then it can be automated.
Logged

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: Doorbell
« Reply #4 on: October 05, 2021, 03:01:05 pm »

Yes, you can play multiple files to multiple zones simultaneously. Even videos. I've been doing this a lot lately with my recent bout of library wrangling.

Also, my old LyricsEditor plugin had a feature where it would pause whatever song was currently playing and play the song you had selected in the plugin until you clicked the Return button, at which point it would restore Playing Now and resume playback at the point it left off at within the song. I just had to query MC for the current playlist, current track, position within that track, then play the new song and restore it all afterward. So I feel like this can definitely be done. Using an additional zone should only make it easier.
Logged

Striker

  • World Citizen
  • ***
  • Posts: 176
Re: Doorbell
« Reply #5 on: October 07, 2021, 08:21:19 pm »

The triggering is pretty easy (If i didn't have the other things i wanted to do), I just send a web command like this: [Serverinfo]/MCWS/v1/Playback/PlayByKey?Key=1414819&Zone=10012&ZoneType=ID, this plays the file that is the doorbell sound. But this wipes the playlist, and doesn't continue playback afterwards.

I get telling MC to play the doorbell sound.. but how does your system "know" the doorbell was pressed to send the MCWS command?

I think maybe using another zone on the same sound card will not work if you have "exclusive access" set, which is best for the best audio.

I have my own HA system trigger to handle playing a doorbell sound.. but I want to hear how you did it... I'm always looking for new/betters way to handle automation.
Logged

flac.rules

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1268
Re: Doorbell
« Reply #6 on: October 11, 2021, 03:13:36 pm »

I get telling MC to play the doorbell sound.. but how does your system "know" the doorbell was pressed to send the MCWS command?

I think maybe using another zone on the same sound card will not work if you have "exclusive access" set, which is best for the best audio.

I have my own HA system trigger to handle playing a doorbell sound.. but I want to hear how you did it... I'm always looking for new/betters way to handle automation.

I use home assistant to send a web-command to MC when the doorbell is pressed.
Logged

Striker

  • World Citizen
  • ***
  • Posts: 176
Re: Doorbell
« Reply #7 on: October 11, 2021, 04:19:35 pm »

I use home assistant to send a web-command to MC when the doorbell is pressed.

I'm guessing you have some kind of "smart" doorbell.

I use this Elk doorbell detector which provides a dry contact closure to my home automation system when the doorbell button is pressed.  Then my HA system mutes any music I have playing in MC throughout my house.  But.. why did the music stop?  So then I have my HA system play a doorbell sound (different audio player) through out the house so I know why the music stopped.  I do the same when the land line rings.

To avoid the "exclusive access" setting quality issue, I actually have a separate sound card for my HA system and another separate mono system with speakers in all rooms for HA sounds only.

https://smile.amazon.com/dp/B0007N72ZG/?coliid=I26VF04OJKUBF6&colid=5TUV0KZ6G4P7&psc=1&ref_=lv_ov_lig_dp_it
Logged
Pages: [1]   Go Up