[BETA] - MP3 Event Player - Using Sonos Speakers

Thatā€™s a problem. The whole internet will be https in very short order, and even locally hosted stuff are generating ā€œunsecureā€ notices on current browsers.

1 Like

lol, thanks

That one works great. Now I need to figure out where to put the files if I canā€™t use dropbox. Google drive, One Drive and Box also all use Https. Like @EdwardN said, everything will be using it soon.

If you have a NAS, they are usually able to add a simple local hosted web site fairly easily.

Havenā€™t had a NAS in a few years now. With everything in the cloud (Play Music, Google Photos. Dropbox, Google Drive, etc.) I didnā€™t have a need to keep it going. :frowning:

If you have a computer thatā€™s always on then you could just install a webserver to that (something like xampp)
Or perhaps the easiest would be a Raspberry Pi webserver

Andy

I do have a mini pc running Blue Iris 24/7. I havenā€™t setup a webserver in many years, though. Last time was when Napster was in its hay day, lol. Took your advise and installed xampp on it. Easy enough to install. Just had to turn on the Apache module, copy my mp3 files over and it is good to go. Hubitat now has a voice!

For anyone else that wants/needs to do this:

  • Download xampp for windows and install (I used all default settings)
  • ā€˜Startā€™ Apache within the control window
  • Open up windows explorer and go into C:\xampp\htdocs
  • Create a new directory, in my case ā€˜Sonosā€™ and copy your mp3ā€™s into it

Now when making an event with the MP3 Event Player just put in your local ip address for that windows machine. ie. http://192.168.xx.xx/Sonos

Remember like @Cobra said in the first post. IP address and File Name are case sensitive!

Hope this helps and thanks to @Cobra for this awesome app.

2 Likes

True, or it'll look like nonsense: !(@.!^*.@.! :smiley:

1 Like

So I was setting up a bunch of events and think Iā€™ve come across a problem.

I setup a test event that triggers on ā€œSwitch Onā€ everything works fine, speech comes out of the Sonos.

If I have the same event trigger off of ā€œTimeā€, I get an error and no speech.
The error is ā€œ2018-04-22 10:51:00.065: error Cannot get property ā€˜valueā€™ on null object on line 305ā€

Thanks

1 Like

@bptworld
Bryan
Thanks for letting me know.
I have found the bug and have posted the revision to GitHub.
You just need to update the code for the child app (the parent stays the same)

New child app version: 1.2.1

Andy

Found another bug in the way power appliance monitoring was working.
Fixed now!

New child app version: 1.2.2

Andy

Having another minor surgery today :frowning: Hopefully get to check this out soon.

1 Like

Hi @Cobra . Great Work! I am playing with your app now. I believe I may have found a bug, or maybe I am doing something wrong. Announcements are working and everything was working great until I created a virtual switch called ā€œPlay Announcementsā€, and selected it in the ā€œSelect Enable/Disable Switch (Optional)ā€ dropdown. When I save the app with the switch already on, the app works great. If I change the virtual switch to off, the announcement stop (as desired). If I then switch the virtual switch back on, the announcements do not start working again.

I am using V1.2.2

Log when I toggle Off, then On
app:4032018-04-26 12:52:57.341:debugOFFICE_ENTRY_ANNOUNCEMENT (Childapp Version: 1.2.2) - Timer reset - Messages allowed
app:4032018-04-26 12:52:57.283:debugOFFICE_ENTRY_ANNOUNCEMENT (Childapp Version: 1.2.2) - Waiting for 0 seconds before resetting timer to allow further messages
app:4032018-04-26 12:52:57.282:debugOFFICE_ENTRY_ANNOUNCEMENT (Childapp Version: 1.2.2) - Message allow: set to 'no' as I have just played a message
app:4032018-04-26 12:52:57.280:debugOFFICE_ENTRY_ANNOUNCEMENT (Childapp Version: 1.2.2) - goNow evt = open
app:4032018-04-26 12:52:57.279:debugOFFICE_ENTRY_ANNOUNCEMENT (Childapp Version: 1.2.2) - state.timer = yes
app:4032018-04-26 12:52:21.819:debugOFFICE_ENTRY_ANNOUNCEMENT (Childapp Version: 1.2.2) - Timer reset - Messages allowed
app:4032018-04-26 12:52:21.734:debugOFFICE_ENTRY_ANNOUNCEMENT (Childapp Version: 1.2.2) - Waiting for 0 seconds before resetting timer to allow further messages
app:4032018-04-26 12:52:21.732:debugOFFICE_ENTRY_ANNOUNCEMENT (Childapp Version: 1.2.2) - Message allow: set to 'no' as I have just played a message
app:4032018-04-26 12:52:21.728:debugOFFICE_ENTRY_ANNOUNCEMENT (Childapp Version: 1.2.2) - goNow evt = open
app:4032018-04-26 12:52:21.725:debugOFFICE_ENTRY_ANNOUNCEMENT (Childapp Version: 1.2.2) - state.timer = yes
app:4032018-04-26 12:52:10.795:debugOFFICE_ENTRY_ANNOUNCEMENT (Childapp Version: 1.2.2) - Play Announcements = on
app:4032018-04-26 12:51:50.204:debugOFFICE_ENTRY_ANNOUNCEMENT (Childapp Version: 1.2.2) - Play Announcements = off

@DeveloperDavidB

Can you please screenshot the log when you

  1. Switch on/off the restriction switch
  2. When something triggers the playback with the switch on

Perhaps it will tell us something

Thanks

Andy

Wow! I was clicking save right when you posted this.

1 Like

What is the trigger you are using?

Andy

@DeveloperDavidB
I think Iā€™ve found the issue and fixed it (I thought Iā€™d fixed this one before)

New version 1.2.3 uploaded to GitHub if youā€™d like to try it?

Please let me know how you,get on

Andy

That was fast! I will give it a whirl!

Seems to work now! Thank you. The only other concern I have is the volume setting doesnā€™t seem to set the volume of the Sonos speaker correct?. I think it is changing the volume being sent to sonos not the volume of the actual sonos amp. I have my setting in your app at 90, because my speakers are usually around 50%. My wife turned music down using the sonos app, and after the music was shut off, the announcement volume was reduced as well.

Not saying this is a problem, just want to confirm this is the intended behavior.

@DeveloperDavidB
Unfortunately , hubitat does not have any control over the amplifier, only the speakers.
I would think that the amp would always override the speaker settings.
I donā€™t have a sonos amp to test with (unless youā€™d like to buy me one :slight_smile: ) but the volume to the speakers is set just before it sends the mp3.
If you turn on the logging you should see a method ā€˜setVolume()ā€™ called just before the mp3 is played, this method also sets the ā€˜quiet timeā€™ volume settings if configured

I can only think that the amp is resetting them to the lower volume.

Not sure what we could do about this.

Andy