import org.openhab.model.script.actions
import org.openhab.core.library.types
import java.util
rule "check chromecast state"
when
Item chromecast_audio_473325b22fd70ba5c3e51dd0d503fc7c_control changed
then
var String command = chromecast_audio_473325b22fd70ba5c3e51dd0d503fc7c_control.state.toString
if (command.contains("PLAY"))
{
logInfo("TEST","Chromecast is playing")
}
else if (command.contains("PAUSE"))
{
logInfo("TEST","Chromecast is paused")
}
end
Could you help me out here? When you say you are using this for streaming iHeart, do you mean you are streaming iHeart from a phone or tablet, separate from OH? Or do you actually have music steaming integrated into OH? (I would love to see how this works, if so.)
And I have the CCast binding installed, and channels active. But I am really just starting with Rules. Can you tell me what else i need to make use of it? ie, scripts, items, sitemap entry etc?