(Alarm clock) Chromecast smb playback?

Hi again everyone :slight_smile:

I have a spare chromecast I haven’t used it so I don’t really no how they work

I would like too use the chromecast for an alarm

my idea in the morning OH could send a video file too the chromecast for playback and the video contains the wakup message ect

Can I store the video on a smb share (prefer) or do I need too upload too YouTube?

Or should I just use the audiosinc and use an audio file?

help and better suggestions or ways you sty alarms welcome

Yes, send the url to the chromecast on the chromecasturl channel
Or If I remember, I used to do that to send videos for islamic prayer times and these were stored in the OH html folder.

2 Likes

Thanks @vzorglub I will give it a try see what happens will post update

I do something similar with a ChromeCast Audio device in my bathroom.

When the shower gets hot, OpenHab2 sends a URL command that plays BBC Radio 2 from an MP3 stream.

Then when the shower cools, I send a short “Say” command to silence it.

FYI

I found the link to the BBC streams here :- http://www.suppertime.co.uk/blogmywiki/2015/04/updated-list-of-bbc-network-radio-urls/

Yes! Radio 2 anytime… :smile:

1 Like

Well, maybe not anytime.

I tend not to require a shower between midday & 5pm on weekdays :slight_smile:
Unless people are on holiday :wink:

Hi

I hope this helps someone :slight_smile:

I’ve been wanting to have options for the music streams that are pushed into a ChromeCast Audio dongle when our shower gets up to temperature.,

So…

I have a Velbus input channel trigger, mapped to PRESSED and RELEASED to start and stop the music

I have a dimmer Item (created in PaperUI) which is used to store a choice (a number) which relates to the audio stream we want.

We have a selection item in HabPanel which uses this comma separated list :-

1=BBC Radio 2,2=BBC RADIO 4 Extra,3=Planet Rock,4=Absolute Radio

and a rule which plays the music source of our choice… IF the house is awake (so that it doesn’t play music at night) AND when the shower water flow is up to temperature.

var int bathradio = 1

rule "Bathroom Music"
when

	Channel 'velbus:vmb7in:c5053467:0B:input#CH1' triggered PRESSED // Input channel 1 of a  Velbus VMB7IN
	
then
	 bathradio = (BathroomChromeCastSourceChoice.state as Number).intValue // Set the bathradio variable to our choice
	 
	//say("Source choice number "+bathradio, "voicerss:enGB", "webaudio") // My way of debugging

	
	if(House_Awake.state === ON){

	// say("Up to temperature while house awake", "voicerss:enGB", "webaudio")
	// say("Number"+BathroomChromeCastSourceChoice.state, "voicerss:enGB", "webaudio")

	// sendBroadcastNotification("Number"+BathroomChromeCastSourceChoice.state)
	
	 
		if(bathradio == 1) { 
														Bathroom_PlayURI.sendCommand("http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p")
														say("Radio choice is number"+BathroomChromeCastSourceChoice.state+" BBC Radio 2", "voicerss:enGB", "webaudio")
														} // BBC Radio 2
		if(bathradio == 2) { 
														Bathroom_PlayURI.sendCommand("http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4extra_mf_p")
														say("Radio choice is number"+BathroomChromeCastSourceChoice.state+" BBC Radio 4 Extra", "voicerss:enGB", "webaudio")
														} // BBC Radio 4 Extra
		if(bathradio == 3) {
														Bathroom_PlayURI.sendCommand("http://tx.planetradio.co.uk/icecast.php?i=planetrock.mp3")
														say("Radio choice is number"+BathroomChromeCastSourceChoice.state+" Planet Rock", "voicerss:enGB", "webaudio")
														} // Planet Rock
		if(bathradio == 4) {
														Bathroom_PlayURI.sendCommand("http://live-absolute.sharp-stream.com/absoluteradio.mp3")
														say("Radio choice is number"+BathroomChromeCastSourceChoice.state+" Absolute Radio", "voicerss:enGB", "webaudio")
														}  // Absolute Radio
                                                          
	}
	
	if(House_Awake.state === OFF){	say("Up to temperature while house asleep", "voicerss:enGB", "webaudio")	 }
	
end

What is particularly interesting is where I got the stream url’s from.

I found a site that offers PLS and M3U downloads,

http://www.radiofeeds.co.uk/mp3.asp

like this for Absolute Radio :-

http://www.radiofeeds.co.uk/ar112.mp3.m3u

which contains a single line

http://live-absolute.sharp-stream.com/absoluteradio.mp3

But to look at another file for Planet Rock

http://www.radiofeeds.co.uk/bauer.pls?station=planetrock.mp3.m3u

this file contains

[Playlist]
File1=http://tx.planetradio.co.uk/icecast.php?i=planetrock.mp3
Title1=planetrock.mp3
Length1=-1
Numberofentries=1
Version=2

By visiting a client last week…

I discovered that this would have been so much easier if I had opted for Sonos speakers instead.

It’s just a matter of selecting the favourite (which can be done via OpenHab2) and issuing a Play or Pause command