Chromecast with Nvidia Shield (Google Device)

I have 2 Nvidia Shields (2019 models) that I just realized is Google based and has Chromecast built in.

My setup:

  • OH 2.4
  • Chromecast 2.5 binding

I’m not understanding how I send a URL to the Chromecast binding; the items on the documentation has many-many more than my OH has discovered. Here’s what the Chromecast 2.5 binding discovered.

Group ChromeCast
Player		BasementShieldControl		"Basement Shield Player [MAP(sonos.map):%s]"					(ChromeCast)								{ channel="chromecast:chromecast:7c0d18b8531a558b43ca249b1cefb478:control" }
Switch		BasementShieldStop			"Basement Shield Stop Switch [MAP(On_Off.map):%s]"  														{ channel="chromecast:chromecast:7c0d18b8531a558b43ca249b1cefb478:stop" }
Dimmer		BasementShieldVolume		"Basement Shield Volume [%.1f %%]"  							(ChromeCast)								{ channel="chromecast:chromecast:7c0d18b8531a558b43ca249b1cefb478:volume" }
Switch		BasementShieldMute			"Basement Shield Mute Switch [MAP(On_Off.map):%s]"  									<soundvolume_mute>	{ channel="chromecast:chromecast:7c0d18b8531a558b43ca249b1cefb478:mute" }
String		BasementShieldArtist		"Basement Shield Artist [%s]"																				{ channel="chromecast:chromecast:7c0d18b8531a558b43ca249b1cefb478:artist" }
Location	BasementShieldLocation		"Basement Shield Location [%s]" 														<location>  		{ channel="chromecast:chromecast:7c0d18b8531a558b43ca249b1cefb478:location" }
String		BasementShieldTitle			"Basement Shield Title [%s]"																				{ channel="chromecast:chromecast:7c0d18b8531a558b43ca249b1cefb478:title" }

The end goal is to send my OH Habpanel URL that shows my cameras to my the Nvidia Shield Chromecast connection when the doorbell rings.

Any advise?

Best, Jay

In the PaperUI you can press “show more” on the thing which should reveal for example:

chromecast:chromecast:xxxxxxxxxxxxxxx:playuri which I believe is read/write.

Edit:
Documentation:
playuri | String | Can be used to tell the Chromecast to play media from a given url

Let me know if you found a way to get chromecast to display a web site url!

1 Like

Thank you, I can’t believe after 2 years working with OH, I missed that!

Best, Jay

@JimT I was wondering this also!!

Casting a video to Chromecast is not an easy task! Chromecast wants it to be a certain codec in order for it to work. After 10 hours; I finally got it to work with my HIKVision Camera against a NVR unit.

// HIK Vision for Chromecast
// https://github.com/Skinah/IpCamera/blob/master/README.md

Thing ipcamera:HIKVISION:FrontDoor "Front Door CAM MJPEG"
[
    IPADDRESS="192.168.0.11",
    USERNAME="user",
    PASSWORD="pass",
    ONVIF_PORT=81, 
	ONVIF_MEDIA_PROFILE=1,
	IP_WHITELIST="DISABLE",
	IMAGE_UPDATE_EVENTS=0,
	GIF_PREROLL=0,
	GIF_POSTROLL=6,
    PORT=81,
    NVR_CHANNEL=1,
	POLL_CAMERA_MS=2000,
	UPDATE_IMAGE=false,
    SERVER_PORT=54324,
	FFMPEG_LOCATION="/opt/bin/ffmpeg",
    FFMPEG_OUTPUT="/volume1/homes/openhab/conf/html/cameras/frontdoor/",
	FFMPEG_INPUT="rtsp://192.168.0.11:554/ISAPI/Streaming/channels/102"
]

You have to convert H.264 video to a FFMPEG format on the fly which requires you to install a FFMPEG converter on your OH server. Some older camera’s can natively produce FFMPEG but not mine ;-(

Item:

Switch  Cast_FrontDoor_Switch 			"Cast Front Door Switch [%s]"									(HomeState)									{ expire="2m,   command=OFF" }

Rule:

rule "Cast Front Door to TVs On"
    when
		Item Cast_FrontDoor_Switch changed
	then

		if (systemStarted.state != ON && Home_Away.state == ON && Cast_FrontDoor_Switch.state == ON) {

			if (systemStarted.state != ON && (Basement_TV_Wired_Power.state == ON || Discover_Basement_TV_Wired_Power.state == ON ||Basement_TV_Power.state == ON)) {
			
				BasementShieldStop.sendCommand(OFF)
					Thread::sleep(200)
				BasementShieldURI.sendCommand("http://192.168.0.230:54324/ipcamera.m3u8")
					
				logInfo("Chromecast", "Casting Front Door Camera to Basement TV.")
			}

			if (systemStarted.state != ON && (Living_TV_Power.state == ON || Discover_Living_TV_Power.state == ON)) {
			
				LivingRoomShieldStop.sendCommand(OFF)
					Thread::sleep(200)
				LivingRoomShieldURI.sendCommand("http://192.168.0.230:54324/ipcamera.m3u8")  
			
				logInfo("Chromecast", "Casting Front Door Camera to Living Room TV.")
			}

			if (systemStarted.state != ON && Living_TV_Power.state != ON && Discover_Living_TV_Power.state != ON && Basement_TV_Wired_Power.state != ON && Discover_Basement_TV_Wired_Power.state != ON && Basement_TV_Power.state != ON) {
			
				logInfo("Chromecast", "NO TVs are ON to Cast Front Door Camera To.")
			}
		}

		if (systemStarted.state != ON && Home_Away.state == ON && Cast_FrontDoor_Switch.state == OFF) {

			if (systemStarted.state != ON && (Basement_TV_Wired_Power.state == ON || Discover_Basement_TV_Wired_Power.state == ON ||Basement_TV_Power.state == ON)) {
			
				BasementShieldStop.sendCommand(ON)
					Thread::sleep(200)
				BasementShieldStop.sendCommand(OFF)
				
				logInfo("Chromecast", "Stopped casting of Front Door Camera to Basement TV.")
			}

			if (systemStarted.state != ON && (Living_TV_Power.state == ON || Discover_Living_TV_Power.state == ON)) {
			
				LivingRoomShieldStop.sendCommand(ON)
					Thread::sleep(200)
				LivingRoomShieldStop.sendCommand(OFF)
			
				logInfo("Chromecast", "Stopped casting of Front Door Camera to Living Room TV.")
			}
			
			return;
		}		
end

Best, Jay

1 Like

my door bell rule is sending a PLAYURI to my shieldTV 2019 ,a screenshot of my outdoor camera “http://192.168.1.xx/snapshot.cgi?user=xxxxxx&pwd=xxxxx” .It worked well until recently.If my shield was on the shield chromecast open that link and show my cam’s screenshot.Now its not working anymore.Nothing changed at my setup.I just updated recently to the latest stable openhab,but i dont know if this is it.Shield chrome cast is working playing casts from mobile devices and desktops as usual.When i am trying to cast that link with PlayUri it seems that chromecast is opening but it “crashes” and return to main menu.Other chromecast devices i own can open that link from PlayURI command.I get no log errors in openhab…Any ideas?