No variable resp in these rules

Hi Guys

These rules were created by someone else and throw an error when refreshing as the ‘val resp’ isn’t defined anywhere

I cant work out what its used for.

Any thoughts and how can I remove the error?

Thanks


rule "Spotify run script"
when
                Item spotify_forceupadte received update
        then
        val resp =  executeCommandLine("/usr/bin/python /etc/openhab2/scripts/spotify.py", 5000)
//        logInfo("Spotify", resp)
end

rule "Spotify Action"
when
                Item spotify_action received update
        then
        val resp =  executeCommandLine("/usr/bin/python /etc/openhab2/scripts/spotify.py " + spotify_action.state.toString, 5000)
//        logInfo("Spotify", resp)
end

Im thinking its to have things logged from memory, just not sure to define at the start of the rule

Try changing val to var.

It is defined twice… once in each rule. But it isn’t used, since the logInfo is commented out. Saving the rule file will give a validation warning because of this, but the file will still load.

1 Like

nice!

That explains it :slight_smile: Thanks gents!