[SNAPSHOT #1519] Jodatime error: Could not invoke method: org.joda.time.DateTime.now() on instance: null

rule
timer
jodatime
Tags: #<Tag:0x00007f51e4ad10f0> #<Tag:0x00007f51e4ad0ec0> #<Tag:0x00007f51e4ad0ce0>

(Frank Delure) #1

Hi,

I receive a joda.time error where I only find one other topic that is unfortunately not helping me. I created this rule a couple of days ago and I guess it worked without an error - it still works but I receive this error message with release #1519.

2019-02-10 22:13:19.257 [ERROR] [ntime.internal.engine.RuleEngineImpl] 
- Rule 'Wifi timer': An error occurred during the script execution: 
Could not invoke method: org.joda.time.DateTime.now() on instance: null


Rule

var Timer Timer_Wifi_DG

rule "Wifi timer"
when
	Item zwave_device_512_node10_sensor_binary changed
	
then
	if(zwave_device_512_node10_sensor_binary.state==ON) 
	{
		if(Timer_Wifi_DG!==null) {
    		Timer_Wifi_DG.cancel
    		Timer_Wifi_DG = null
				    	}
fboxWifi24.sendCommand(ON)
fboxWifi50.sendCommand(ON)

	} 
	else if (zwave_device_512_node10_sensor_binary.state==OFF) 
	 {
		Timer_Wifi_DG = createTimer(now.plusSeconds(7200)) [| 
fboxWifi24.sendCommand(OFF)
fboxWifi50.sendCommand(OFF)

 ]
	}
	
end

Has something changed with joda time?


(bhomeyer) #2

Something has, none of my rules now work.


(Udo Hartmann) #3

Please open an issue at https://github.com/openhab/openhab-core/issues (I guess this is core related)


(bhomeyer) #4

Likely already been done.


(bhomeyer) #5

Also another forum post :


(Udo Hartmann) #6

Yepp, missed that one… :slight_smile:


(Frank Delure) #7
2019-02-12 16:11:25.062 [ERROR] [ntime.internal.engine.RuleEngineImpl] - 
Rule 'xxx timer': The name 'now' cannot be resolved to an item or type; 
line 19, column 23, length 3

The error message changed with #1521


(Frank Delure) #8

#1522 seems to have fixed it.