Why this error?

Hi to all
when i run this code

rule "Scendi"


when 

	//Every weekday at 21:19 hours
	Time cron "30 44 10 ? * MON-SUN *"
then
     logWarn("Alarm", "The {} all'inizio", LivingRoom_Light2.state)
var Number y = 0
var Number k = 0

	 //
if (LivingRoom_Light2.state == ON) {
	logWarn("Alarm", "The {} dentro", LivingRoom_Light2.state)

    createTimer(now.plusSeconds(24)) [|
		 Auto.postUpdate(0) 
        LivingRoom_Light1.sendCommand(ON)

		
		//
//controlla se la serranda è già per un pò abbassata e calcola di quanto
//la deve ancora abbassare	
		    y = (Percentuale.state).intValue
			Percentuale2.postUpdate(y)
            logWarn("Alarm", "The {} valore di y in ap automat.", Percentuale.state)
            createTimer(now.plusSeconds(y)) [|
            LivingRoom_Light1.sendCommand(OFF)
            Percentuale.postUpdate(0)
			]

			//

		return;
    ]

	}
//
if (LivingRoom_Light2.state == OFF) {

     Auto.postUpdate(0) 

	//dire Auto.postUpdate(0) significa dire che Auto.state == 0. con i numeri si scrive cosi
   //  logWarn("Alarm", "The {} dopo messo a 0", Auto.state)

    // update item to switch on light here
    LivingRoom_Light1.sendCommand(ON)

//controlla se la serranda è già per un pò abbassata e calcola di quanto
//la deve ancora abbassare	
		    y = (Percentuale.state as Number).intValue
            logWarn("Alarm", "The {} valore di y in ap automat.", Percentuale.state)
            createTimer(now.plusSeconds(y)) [|
            LivingRoom_Light1.sendCommand(OFF)
			Precisione.postUpdate(0)
          
			]



  	}
end



i have this error:

2019-03-24 10:44:33.249 [ome.event.ItemCommandEvent] - Item ‘LivingRoom_Light1’ received command ON

==> /var/log/openhab2/openhab.log <==

2019-03-24 10:44:33.252 [WARN ] [eclipse.smarthome.model.script.Alarm] - The 6 valore di y in ap automat.

==> /var/log/openhab2/events.log <==

2019-03-24 10:44:33.266 [vent.ItemStateChangedEvent] - Auto changed from 1 to 0

2019-03-24 10:44:33.339 [vent.ItemStateChangedEvent] - LivingRoom_Light1 changed from OFF to ON

2019-03-24 10:44:33.352 [vent.ItemStateChangedEvent] - Auto changed from 0 to 1

==> /var/log/openhab2/openhab.log <==

2019-03-24 10:44:33.359 [WARN ] [eclipse.smarthome.model.script.Alarm] - Quanto vale Percentuale parte 2? 6

2019-03-24 10:44:33.363 [WARN ] [eclipse.smarthome.model.script.Alarm] - Quanto vale z? 6

==> /var/log/openhab2/events.log <==

2019-03-24 10:44:33.374 [vent.ItemStateChangedEvent] - Percentuale changed from 6 to 0

2019-03-24 10:44:39.265 [ome.event.ItemCommandEvent] - Item ‘LivingRoom_Light1’ received command OFF

==> /var/log/openhab2/openhab.log <==

2019-03-24 10:44:39.263 [ERROR] [org.quartz.core.JobRunShell ] - Job DEFAULT.2019-03-24T10:44:39.256+01:00: Proxy for org.eclipse.xtext.xbase.lib.Procedures$Procedure0: [ | {

<XFeatureCallImplCustom>.sendCommand(<XFeatureCallImplCustom>)

<XFeatureCallImplCustom>.postUpdate(<XNumberLiteralImpl>)

} ] threw an unhandled Exception:

java.lang.reflect.UndeclaredThrowableException: null

at com.sun.proxy.$Proxy151.apply(Unknown Source) ~[?:?]

at org.eclipse.smarthome.model.script.internal.actions.TimerExecutionJob.execute(TimerExecutionJob.java:49) ~[?:?]

at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh240]

at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh240]

Caused by: org.eclipse.smarthome.model.script.engine.ScriptExecutionException: The name ‘Precisione’ cannot be resolved to an item or type; line 58, column 4, length 10

at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.invokeFeature(ScriptInterpreter.java:141) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:902) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:865) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:224) ~[?:?]

at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:226) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:204) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:768) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:220) ~[?:?]

at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:226) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:204) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:447) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:228) ~[?:?]

at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:226) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:204) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:190) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.ClosureInvocationHandler.doInvoke(ClosureInvocationHandler.java:46) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.AbstractClosureInvocationHandler.invoke(AbstractClosureInvocationHandler.java:29) ~[?:?]

… 4 more

==> /var/log/openhab2/events.log <==

2019-03-24 10:44:39.383 [ome.event.ItemCommandEvent] - Item ‘LivingRoom_Light1’ received command OFF

==> /var/log/openhab2/openhab.log <==

2019-03-24 10:44:39.356 [ERROR] [org.quartz.core.ErrorLogger ] - Job (DEFAULT.2019-03-24T10:44:39.256+01:00: Proxy for org.eclipse.xtext.xbase.lib.Procedures$Procedure0: [ | {

<XFeatureCallImplCustom>.sendCommand(<XFeatureCallImplCustom>)

<XFeatureCallImplCustom>.postUpdate(<XNumberLiteralImpl>)

} ] threw an exception.

org.quartz.SchedulerException: Job threw an unhandled exception.

at org.quartz.core.JobRunShell.run(JobRunShell.java:213) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh240]

at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh240]

Caused by: java.lang.reflect.UndeclaredThrowableException

at com.sun.proxy.$Proxy151.apply(Unknown Source) ~[?:?]

at org.eclipse.smarthome.model.script.internal.actions.TimerExecutionJob.execute(TimerExecutionJob.java:49) ~[?:?]

at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[?:?]

… 1 more

Caused by: org.eclipse.smarthome.model.script.engine.ScriptExecutionException: The name ‘Precisione’ cannot be resolved to an item or type; line 58, column 4, length 10

at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.invokeFeature(ScriptInterpreter.java:141) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:902) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:865) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:224) ~[?:?]

at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:226) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:204) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:768) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:220) ~[?:?]

at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:226) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:204) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:447) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:228) ~[?:?]

at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:226) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:204) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:190) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.ClosureInvocationHandler.doInvoke(ClosureInvocationHandler.java:46) ~[?:?]

at org.eclipse.xtext.xbase.interpreter.impl.AbstractClosureInvocationHandler.invoke(AbstractClosureInvocationHandler.java:29) ~[?:?]

at com.sun.proxy.$Proxy151.apply(Unknown Source) ~[?:?]

at org.eclipse.smarthome.model.script.internal.actions.TimerExecutionJob.execute(TimerExecutionJob.java:49) ~[?:?]

at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[?:?]

… 1 more

==> /var/log/openhab2/events.log <==

2019-03-24 10:44:39.433 [vent.ItemStateChangedEvent] - LivingRoom_Light1 changed from ON to OFF

I use this code to commanda a shutter. I set a time and in that moment automatically the rule actives the shutter.

The rule works well but i have this error

Seems to be the important part

and this error?
What kind of error is?

==> /var/log/openhab2/openhab.log <==

2019-03-26 16:39:23.462 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule ‘Sali’: An error occurred during the script execution: Couldn’t invoke ‘assignValueTo’ for feature JvmVoid: (eProxyURI: settare_orario.rules#|::0.2.1.2.0.1.1.0.3::0::/1)

rule "Sali"

when 
    //Every weekday at 
	Time cron "20 39 16 ? * MON-SUN *"
then
 //    logWarn("Alarm", "The {} all'inizio", LivingRoom_Light1.state)

	 //
if (LivingRoom_Light1.state == ON) {
	logWarn("Alarm", "The {} dentro", LivingRoom_Light1.state)

    createTimer(now.plusSeconds(24)) [|
		 Auto.postUpdate(0) 
        LivingRoom_Light2.sendCommand(ON)
//
//controlla se la serranda è già per un pò alzata e calcola di quanto
//la deve ancora alzare	
		 logWarn("Alarm", "1 {}", Auto.state)

            y = (Percentuale.state as Number).intValue
			 logWarn("Alarm", "2{}", y)

			y = ((24 - y) as Number).intValue
			 logWarn("Alarm", "3 {}", y)

            logWarn("Alarm", "The {} valore di y in ap automat.", Percentuale.state)
            createTimer(now.plusSeconds(y)) [|
            LivingRoom_Light1.sendCommand(OFF)
			Precisione.postUpdate(24)
          
			]


//		

		return;
    ]

	}
//
if (LivingRoom_Light1.state == OFF) {

     Auto.postUpdate(0) 

	//dire Auto.postUpdate(0) significa dire che Auto.state == 0. con i numeri si scrive cosi
   //  logWarn("Alarm", "The {} dopo messo a 0", Auto.state)

    // update item to switch on light here
    LivingRoom_Light2.sendCommand(ON)

//controlla se la serranda è già per un pò alzata e calcola di quanto
//la deve ancora alzare	
	 logWarn("Alarm", "1{}", Auto.state)


            y = (Percentuale.state as Number).intValue

			 logWarn("Alarm", "2{}", y)


			y = ((24 - y) as Number).intValue

			 logWarn("Alarm", "3{}", y)


            logWarn("Alarm", "The {} valore di y in ap automat.", Percentuale.state)
            createTimer(now.plusSeconds(y)) [|
            LivingRoom_Light1.sendCommand(OFF)
			Precisione.postUpdate(24)
          
			]



  	}
end



The kind of error it is, is that your rule has tried to assign a value to something that does not exist.

The logs that have kept secret will probably lead you to the correct area of your rule.

If you want a guess, y= fails because you have not defined y.

But i am not able to understand what is the variable?

I don’t understand your question.

ok but how can i understand what is this thing?

Using the logwarns that you put in your rule, you can work out what part of the rule has got into trouble.

Then you have to look at it hard, and think about it.
Is that variable defined? Am I trying to give it sensible value? Etc.

ok i understand now.
Thank’s a lot