Somethings changed and I need to change with it, but not sure what

Tags: #<Tag:0x00007f5c94f23e68>

Hi all,
I am not sure what has changed, I do not think its necessarily Openhab.

I had the rule below working successfully for a good 6 months and I noticed today it was not functioning and instead throwing an error and not liking the Echo1.state(int) see exact error below.

In order to troubleshoot I stuck in a logInfo message that spits out the contents of Echo1.state which is 1.0 and then after getting this I coded the new create timer line to specify the value of 1 which permits the rule to run correctly.
I have probably a hundred of these lines with me using a variable that is set through the sitemap to a time delay throughout my rule base. So my question
What has changed and what must I do now to programically adapt?

ORIGINAL LINE

	//createTimer(now.plusSeconds(Echo1.state as Number).intValue) [ | {	

ERROR THROWN

2020-05-23 09:18:06.252 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Alexa Check office status': An error occurred during the script execution: Could not invoke method: org.joda.time.DateTime.plusSeconds(int) on instance: 2020-05-23T09:18:06.252+12:00

TEST WORKAROUND

rule "Alexa Check office status"
when
	Member of EchoCmds changed to "office status"
then
	val sourceRoom = triggeringItem.name.split("_").get(0)
	val _TTS = sourceRoom+"_Echo_TTS"
	logInfo("Test","Echo1 State:"+Echo1.state)
	//createTimer(now.plusSeconds(Echo1.state as Number).intValue) [ | {	
	createTimer(now.plusSeconds(1)) [ | {	
		if (HO_Temp.state == NULL) {
			_TTS.sendCommand("The office state is unknown."+" The temperature control is "+HO_Temp_Auto.state)
			logInfo("HO_Temp_Status","Message : office temperature status is unknown.")		
		} else {
			_TTS.sendCommand("The temperature state is considered "+HO_Temp_State.state+", and the temperature control is "+HO_Temp_Auto.state)
		}
	}]

Thanks
Paul

You miss two brackets.
createTimer(now.plusSeconds((Echo1.state as Number).intValue))

1 Like

Thanks that sorted it, I have no recollection of being in that area of the rules for donkeys so was not thinking any change has gone on. Perhaps the syntax checker got an update or something, anyway the rule now correctly functions as intended.

Thanks
Paul