Links to beginners documents on Rules for OpenHab2

This doesn’t work either…

rule "Den Door Contact Open"
when
    Item omnilink_zone_4515ad84_3_current_condition changed from CLOSED to OPEN
then

    sendHttpGetRequest("http://172.16.1.136:3480/data_request?id=lu_action&output_format=json&DeviceNum=165&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1")

end

rule "Den Door Contact Closed"
when
    Item omnilink_zone_4515ad84_3_current_condition changed from OPEN to CLOSED
then

    sendHttpGetRequest("http://172.16.1.136:3480/data_request?id=lu_action&output_format=json&DeviceNum=165&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0")

end




My example only works since openhab 2.2.
This explains the error.

Try to really look what you write and use VSCode.

This is not logInfo.

Did you install the http action?

It worked atter updated to 2.2.0

Thanks.

Here is the sample rule subsection.\

Thank you! Thank you! Thank you!






rule "Den Door Contact Open"
when
    Item omnilink_zone_4515ad84_3_current_condition changed from 0 to 1
then
   {logInfo("My Rule Test", "CLOSED TO OPEN" ) 
    sendHttpGetRequest("http://172.16.1.136:3480/data_request?id=lu_action&output_format=json&DeviceNum=165&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1")
   }
end

 
rule "Den Door Contact Closed"
when
    Item omnilink_zone_4515ad84_3_current_condition changed from 1 to 0
then
   {logInfo("My Rule Test", "open to closed" ) 
    sendHttpGetRequest("http://172.16.1.136:3480/data_request?id=lu_action&output_format=json&DeviceNum=165&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0")
   }
end


rule "Den Door Contact Detect"
when
    Item omnilink_zone_4515ad84_3_current_condition changed 
then
    logInfo("My Rule Test", "Item:\"" + triggeringItem.name + "\" state:\"" +  triggeringItem.state + "\" previousState:\"" +  previousState + "\"" )
end