openHAB: stop a ChromeCast

Posted by ads' corner on Wednesday, 2021-02-10
Posted in [Openhab]

There are a number of ChromeCasts in our setup. I’m adding (physical) switches to turn displays on and off, and primarily control the volume. When I turn the display off, I also want the ChromeCast to stop doing whatever it is doing right now (stop streaming), and go back to the default application (for video CC).

The openHAB ChromeCast binding has a separate channel for that:

1
Switch    chromecast_chromecast_dfb5af5187ce1135b276239130aef282_stop     { channel="chromecast:chromecast:dfb5af5187ce1135b276239130aef282:stop" }

However since the channel is named stop, it has to be enabled with ON. Doesn’t make sense? It is as it is:

1
chromecast_chromecast_dfb5af5187ce1135b276239130aef282_stop.sendCommand(ON)

And the result:

2021-01-18 17:13:20.305 [ome.event.ItemCommandEvent] - Item 'chromecast_chromecast_dfb5af5187ce1135b276239130aef282_stop' received command ON
2021-01-18 17:13:20.321 [nt.ItemStatePredictedEvent] - chromecast_chromecast_dfb5af5187ce1135b276239130aef282_stop predicted to become ON
2021-01-18 17:13:20.443 [vent.ItemStateChangedEvent] - chromecast_chromecast_dfb5af5187ce1135b276239130aef282_appName changed from <...> to UNDEF
2021-01-18 17:13:20.451 [vent.ItemStateChangedEvent] - chromecast_chromecast_dfb5af5187ce1135b276239130aef282_appId changed from <...> to UNDEF
2021-01-18 17:13:20.455 [vent.ItemStateChangedEvent] - chromecast_chromecast_dfb5af5187ce1135b276239130aef282_statustext changed from Casting: <...> to UNDEF
2021-01-18 17:13:20.457 [vent.ItemStateChangedEvent] - chromecast_chromecast_dfb5af5187ce1135b276239130aef282_idling changed from OFF to ON
2021-01-18 17:13:23.888 [vent.ItemStateChangedEvent] - chromecast_chromecast_dfb5af5187ce1135b276239130aef282_appName changed from UNDEF to Backdrop
2021-01-18 17:13:23.893 [vent.ItemStateChangedEvent] - chromecast_chromecast_dfb5af5187ce1135b276239130aef282_appId changed from UNDEF to E8C28D3C

Categories: [Openhab]