[SOLVED] Too dumb to work with files :-( ? stuck at getting started with files

Small addition to this posting, I got detection of Chromecast PLAY/PAUSE working. So now I can trigger rules for “dim light when start playing …”, happy with that. Issue was (for those of you that have the same issue) that this condition:

Item LivingRoom_ChromecastControl received command PAUSE

did not trigger/activate, whereas this one does:

Item LivingRoom_ChromecastControl changed from PLAY to PAUSE

not sure why, as the first one did not return any errors in openhab log. I have yet to see how reliable this function is gonna be, because I see frequent errors concerning the Chromecast binding in my log:

2018-05-31 18:36:16.827 [WARN ] [su.litvak.chromecast.api.v2.Channel ] - Error while handling
java.lang.NullPointerException: null

but for now another babystep in the right direction :wink:

This is because the item is receiving updates from the binding NOT commands
So you first trigger will never trigger because the chromecast binding is updating the item not sending a command to it.

Another way to do it would have been:

    Item LivingRoom_ChromecastControl changed
then
    If (LivingRoom_ChromecastControl === null) return; // do nothing exit the rule
    var chromeState = LivingRoom_ChromecastControl.state.toString
    if (chromeState == "PAUSE") {
        // Do the pause stuff
    } else if {chromeState == "PLAY") {
        // Do the play stuff
    }
end
1 Like