WTF Rules? in OH 2.1

@ganesh.ingle, did you look into the JSR223 add-on at all? It lets you write Rules in Jython, JavaScript, or Groovy. For Rules type logic that would be a bit better of a fit than creating a new Binding for Rules Logic. It is also a whole lot easier to get started given the challenges many face setting up the IDE environment to build Bindings.

http://docs.openhab.org/configuration/jsr223.html

It is not as well documented but there is a hardcore set of OH users who are doing some quite amazing things with it.

Yes, they are logged to openhab.log.

That is correct. The changed from XXX to XXX is only valid in Rule triggers. To do that sort of comparison in a Rule there are a couple of ways to do it. Perhaps the easiest:

Besides the implicitly available variables for items and commands/states, rules can have additional pre-defined variables, depending on their triggers:

receivedCommand - will be implicitly available in every rule that has at least one command event trigger.
previousState - will be implicitly available in every rule that has at least one status change event trigger.

http://docs.openhab.org/configuration/rules-dsl.html#implicit-variables

Which means you can:

if(TV_Livingroom.state.toString == "TV_POWER_OFF" && previousState.state == "TV_POWER_ON")

The second way you can do this is using persistence and the previousState method, but that requires more configuration to set up so I’ll leave it as an exercise for later.

Almost everything that gets tailed in the karaf console get saved to openhab.log which is in the same folder as the events.log. For an installed OH that is /var/log/openhab2/openhab.log, for a manual install that is $OH_HOME/userdata/logs/openhab.log.