Smart Virtual Thermostat (beta version)

Thanks for you idea, @Der_Gute!

A few things that I noticed.
First of all this won’t work with underfloor heating. Valves used for such systems are only open/closed.
Secondly, I doubt if you get an accurate rating that you can compare with other solutions. And my doubt is based on the fact of PID controllers in thermostats.

Intelligent/Digital room, but also radiator, thermostats works with a PID controller (as opposite to a mechanical one, which uses a bimetal). Meaning that it calculates it behavior based on delta time and delta temperature. Thus turning a heating on/off, modulate a heating or opening a valve at a certain percentage, based on the difference in time and temperature.

This works, in my opinion, not backworks, such as you suggest to keep record of how long and at what percentage the valve has been open. These variables are almost infinite, you’ll have to have a very very big database of values.

My rule isn’t a PID, but tries to mimic one. When I’ve more time, I’ll add another value, delta outsite temperature, so it can calculate the isolation value of the room and based on that prediction what time needed is to heat to room. Almost like a PID controller :slight_smile:

Did you thought about making a NGRE version of this rule?
I know that this is translated from a Python script and you can use Python in NGRE so it might make sense to do it and maybe only a fewer modification is needed for the code…

Well… i’ve just installed jython and the NGRE. I’m learning python and the use of it with OpenHAB/NGRE.
But for know I’m having little time, so I won’t make a NGRE version in the near future.

Havent really read all comments in here but it seems to me that you are trying to overcomplicate quite simple problem.

for your application you are missing a heat consumption of given building to calculate heating percentage needs honestly, and this variable is quite not as simple as measuring during period time and then heat up a bit and then measure again.
Indeed I don’t know your appliance, but whole bunch of gas heaters really don’t likes to be swittched on/off constantly and it’s way better to run them on low power for longer period time. Not only because of appliance itself, but as well because water in the system has got heating delay and heating loses are quite high in the on/off approach, especially when running like 10mins, it’s not even close to heat up cold water in the system.

Not really sure why you would like to go this way when there are already quite robust and very well functioning applications for OH.

don’t take it wrong, just wondering

Can you give some example?

Also for example for me, who lives in a flat and I can’t control the boilers directly, I can only control the heating via TRVs (Thermostat Radiator Valves). And as @ljsquare said, this approach can be used with that also.
So basically what I can control is how much the valve is open and what I can measure is the room temp (maybe outside temp). I can’t measure the boiler temp, boiler consumption anything regarding that…

Thanks @kriznik for your comment. I would like to know where that option is hidden in OpenHAB. I know that Fibaro has a heating application in their home center, but in OH I didn’t find it (yet).

But you’re right, a heater doesn’t like to be switch on/off constantly, that’s why i’ve build in a safeguard. But that’s only in the beginning, when the system needs to learn the environment. Over time it wil (almost) predict the right time to heat the room(s).
As I said earlier it mimic a PID controller (that’s what a digital thermostat is).

Also (this is not criticism, it is just a view) but usually other solutions on this forum is not that complex and optimized. Usually the other solutions are the simplest one to give you a starting point, but you have to tweak it yourself…

really big plans, I’m pretty sure that for this kind of behaviour you’ll need more inputs to do it properly.
But as a general idea it’s nice, yet very depending on actual implementation - as general solution does not really works everywhere.

Anyway that was just my feeling as someone who was solving similar thing last year and running on that solution whole 650m2 house.
This winter I can see major savings on running costs already so I’m quite happy with that :smiley:

you are not wrong and that’s because everysingle house/usecase is very different. I’m almost certainly sure everybody who is on this forum tweaks everything for their needs anyway.

Basically all those projects works on ON/OFF principle. As soon as the temperature hits the setpoint (with/without hysteris) it shuts off the heating. It can work, but most of the time it over heats or under heats and you get the flipping of the heater (constanly quickly on/off).

The Heating Boilerplate solution can be used with my method. I’ve no time based schedule in my rule, I don’t that simple with a cron job, but the Boilerplate is more advance (holiday, weekend, day-off, etc).

that not really true
if you pay attention to the code you’ll see that there is safe split between temperatures (way higher than any commercial thermostats offers) so on/off switching is not a thing.
Some solutions do that, but it’s just wrong design or depending on “smart” thermocouplers which triggers heater directly, which is in any mean wrong.

Hello Everybody

I am new in Openhab but have found by experience in my existing heating control a good way to avoid overshoot
This works well with on off control on underfloor heating with low inertia (schlutter system )

The idea is to trigger thermostat based on room temperature forecast.
Outside temperature influence the water temperature sent to the floor.
How to do the forecast?

One way could be to check the trends of temperature based on history records
The way I did it is easier but need a cycling polling rule (not sure that is adapted for event driven philosophy and definitely sure that event driven is not a good approach for good heating control )

Compute a long term filtered value of the room temperature ( room.LT)

Compute a forecast value of the room temperature ( room.FT)
Filter can be done with
LT=( T- LT)*alpha + LT With alpha = poll_cycle/time_cst <<1
T is the room actual Temperature

Forecast can be done the same way
FT=( T - LT)*alpha + LT With alpha =2

In my case I was using a poll cycle of 8 sec
A LT alpha of 0.002 so a time constant of about 66 min but should be ajusted depending of your heating system inertia

Regarding the idea to heat in Onoff to modulate heating power, I did the same for some rooms but with a cycle of 120s because the thermal element controlling the valves are working some how as a control valve with such time.

I modulate by a proportional control with anticipation computing the opening time by multiplying the difference between target and forecast by a factor.

My digital output are triacs so I don’t care about the frequency of commutation

Feel free to comment

I plan to control in the same way with openhab but I am searching for the best way to implement this in openhab or using node red.

Pierre

Updated to version 0.2.15.

I’ve noticed that after a restart of OH, the values of the different items become the default ones as written in the rule. Despite of the restoreonstartup defined for the items.
I’ve created a delay of 10 minutes, so the rule can (re)check if the items are NULL and need to be filled with the default values.

Hi,

I am trying to get this to work, but I get the following error a couple of times (+ alot of text):

[ERROR] [org.quartz.core.ErrorLogger ] - Job (DEFAULT.Timer 23 2020-02-24T21:32:26.214+01:00: Proxy for org.eclipse.xtext.xbase.lib.Procedures$Procedure0: [ | {

And nothing happens after 30 min has passed… Only thing I can see that has NULL value is LivingRoom_Heating_Power if that matters. I have the latest code from GitHub.

Thanks!

Can you post the “a lot of text”? It give me more info which timer is not working.

Sure:

2020-02-24 22:08:02.210 [INFO ] [g.eclipse.smarthome.model.script.svt] - System started checking for NULL

2020-02-24 22:08:12.224 [INFO ] [g.eclipse.smarthome.model.script.svt] - retrigger

2020-02-24 22:08:12.228 [INFO ] [g.eclipse.smarthome.model.script.svt] - retrigger LivingRoom_Heating_Mode with 1

2020-02-24 22:08:12.235 [INFO ] [g.eclipse.smarthome.model.script.svt] - Room LivingRoom, RoomDevice LivingRoom_Heating

2020-02-24 22:08:12.236 [INFO ] [g.eclipse.smarthome.model.script.svt] - nextCalcTimer for LivingRoom_Heating is org.eclipse.smarthome.model.script.internal.actions.TimerImpl@2fd25e

2020-02-24 22:08:12.240 [INFO ] [g.eclipse.smarthome.model.script.svt] - Reschedule nextCalcTimer for LivingRoom_Heating is org.eclipse.smarthome.model.script.internal.actions.TimerImpl@2fd25e. CalcTime 30. When mode/setpoint changed

2020-02-24 22:08:12.242 [ERROR] [org.quartz.core.JobRunShell         ] - Job DEFAULT.Timer 4 2020-02-24T22:07:15.388+01:00: Proxy for org.eclipse.xtext.xbase.lib.Procedures$Procedure0: [ | {

  val roomTemp

  val roomMode

  val lastCalcItem

  val roomSetPoint

  val roomLearnItem

  var roomLearn

  logInfo(<XFeatureCallImplCustom>,<XStringLiteralImpl>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XMemberFeatureCallImplCustom>)

  val setPointItem

  val powerItem

  var lastSetPoint

  val lastSetPointState

  org.eclipse.xtext.xbase.impl.XIfExpressionImpl@433f77 (conditionalExpression: false)

  var lastPower

  org.eclipse.xtext.xbase.impl.XIfExpressionImpl@5d6011 (conditionalExpression: false)

  org.eclipse.xtext.xbase.impl.XIfExpressionImpl@1bc614a (conditionalExpression: false)

  logInfo(<XFeatureCallImplCustom>,<XStringLiteralImpl>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>)

  val power

  <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)

  logInfo(<XFeatureCallImplCustom>,<XStringLiteralImpl>,<XFeatureCallImplCustom>)

  val heatDuration

  val valveItem

  logInfo(<XFeatureCallImplCustom>,<XStringLiteralImpl>,<XMemberFeatureCallImplCustom>,<XFeatureCallImplCustom>)

  val roomEndHeatTimer

  logInfo(<XFeatureCallImplCustom>,<XStringLiteralImpl>,<XFeatureCallImplCustom>,<XMemberFeatureCallImplCustom>)

  org.eclipse.xtext.xbase.impl.XIfExpressionImpl@15d567e (conditionalExpression: false)

  <XFeatureCallImplCustom>.postUpdate(<XConstructorCallImplCustom>)

  <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)

  <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)

  <XMemberFeatureCallImplCustom>.reschedule(<XMemberFeatureCallImplCustom>)

  logInfo(<XFeatureCallImplCustom>,<XStringLiteralImpl>,<XFeatureCallImplCustom>,<XMemberFeatureCallImplCustom>,<XFeatureCallImplCustom>)

} ] threw an unhandled Exception: 

java.lang.IllegalStateException: Could not invoke method: org.eclipse.xtext.xbase.lib.DoubleExtensions.operator_divide(double,int) on instance: null

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	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.$Proxy611.apply(Unknown Source) ~[?:?]

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

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

	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [bundleFile:?]

Caused by: java.lang.IllegalArgumentException

	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]

	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]

	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]

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

	... 23 more

2020-02-24 22:08:12.248 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (DEFAULT.Timer 4 2020-02-24T22:07:15.388+01:00: Proxy for org.eclipse.xtext.xbase.lib.Procedures$Procedure0: [ | {

  val roomTemp

  val roomMode

  val lastCalcItem

  val roomSetPoint

  val roomLearnItem

  var roomLearn

  logInfo(<XFeatureCallImplCustom>,<XStringLiteralImpl>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XMemberFeatureCallImplCustom>)

  val setPointItem

  val powerItem

  var lastSetPoint

  val lastSetPointState

  org.eclipse.xtext.xbase.impl.XIfExpressionImpl@433f77 (conditionalExpression: false)

  var lastPower

  org.eclipse.xtext.xbase.impl.XIfExpressionImpl@5d6011 (conditionalExpression: false)

  org.eclipse.xtext.xbase.impl.XIfExpressionImpl@1bc614a (conditionalExpression: false)

  logInfo(<XFeatureCallImplCustom>,<XStringLiteralImpl>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>,<XFeatureCallImplCustom>)

  val power

  <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)

  logInfo(<XFeatureCallImplCustom>,<XStringLiteralImpl>,<XFeatureCallImplCustom>)

  val heatDuration

  val valveItem

  logInfo(<XFeatureCallImplCustom>,<XStringLiteralImpl>,<XMemberFeatureCallImplCustom>,<XFeatureCallImplCustom>)

  val roomEndHeatTimer

  logInfo(<XFeatureCallImplCustom>,<XStringLiteralImpl>,<XFeatureCallImplCustom>,<XMemberFeatureCallImplCustom>)

  org.eclipse.xtext.xbase.impl.XIfExpressionImpl@15d567e (conditionalExpression: false)

  <XFeatureCallImplCustom>.postUpdate(<XConstructorCallImplCustom>)

  <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)

  <XFeatureCallImplCustom>.postUpdate(<XFeatureCallImplCustom>)

  <XMemberFeatureCallImplCustom>.reschedule(<XMemberFeatureCallImplCustom>)

  logInfo(<XFeatureCallImplCustom>,<XStringLiteralImpl>,<XFeatureCallImplCustom>,<XMemberFeatureCallImplCustom>,<XFeatureCallImplCustom>)

} ] threw an exception.

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

	at org.quartz.core.JobRunShell.run(JobRunShell.java:213) [bundleFile:?]

	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [bundleFile:?]

Caused by: java.lang.IllegalStateException: Could not invoke method: org.eclipse.xtext.xbase.lib.DoubleExtensions.operator_divide(double,int) on instance: null

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	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.$Proxy611.apply(Unknown Source) ~[?:?]

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

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

	... 1 more

Caused by: java.lang.IllegalArgumentException

	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]

	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]

	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	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.$Proxy611.apply(Unknown Source) ~[?:?]

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

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

	... 1 more

I also tried leaving it running like Benny_Dormaels did, but the 30 min timer doesnt seem to work and nothing happens after 30 min. Only thing that happens is when rule “Boiler on/off” runs, I get the following error:

[ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'Boiler on/off': An error occurred during the script execution: index=2, size=2

This is my items (only have one zone for now):

Group                   Heating                                                                                                         (Home)                                                                          
Group:Number            Heating_Mode                                                                                                    (Heating,RestoreOnStartup)                                                      
Group:Switch:OR(ON,OFF) Heating_BoilerValves                                                                                            (Heating,RestoreOnStartup, BoilerRoom, Influxdb)                                
Group:Number            Heating_Setpoint_Normal                                                                                         (Heating,RestoreOnStartup)                                                      
Group:Number            Heating_Setpoint_Eco                                                                                            (Heating,RestoreOnStartup)                                                      
Group:Number            Heating_Setpoint_Current                                                                                        (Heating,RestoreOnStartup,Influxdb_EU,Rrd4j)                                    
Group:Number            Heating_ConstC                                                                                                  (Heating,RestoreOnStartup,Influxdb_EU,Rrd4j)                                    
Group:DateTime          Heating_LastCalc                                                                                                (Heating,RestoreOnStartup)                                                      
Group:Number            Heating_CalcTime                                                                                                (Heating,RestoreOnStartup)                                                      
Group:Switch            Heating_Learn                                                                                                   (Heating,RestoreOnStartup)                                                      
Group:Number            Heating_Power                                                                                                   (Heating, RestoreOnStartup,Influxdb_EU,Rrd4j)                                   

Switch                  LivingRoom_Heating_BoilerValve                                                                                  (Heating_BoilerValves, BoilerRoom)                                              
Number                  LivingRoom_Heating_Mode             "Woonkamer verwarming modus [MAP(spiritmode.map):%s]"                       (LivingRoom, Heating_Mode)                                                      
Number                  LivingRoom_Heating_ConstC                                                                                       (Heating_ConstC)                                                                
DateTime                LivingRoom_Heating_LastCalc                                                                                     (Heating_LastCalc)                                                              
Number                  LivingRoom_Heating_Setpoint_Normal  "Woonkamer thermostaat [%.1f °C]"                           <my-heating>    (LivingRoom, Heating_Setpoint_Normal)                                           
Number                  LivingRoom_Heating_Setpoint_Eco     "Woonkamer thermostaat eco [%.1f °C]"                       <my-heating>    (LivingRoom, Heating_Setpoint_Eco)                                              
Number                  LivingRoom_Heating_Setpoint_Current                                                                             (Heating_Setpoint_Current)                                                      
Number                  LivingRoom_Heating_CalcTime                                                                                     (Heating_CalcTime)                                                              
Switch                  LivingRoom_Heating_Learn                                                                                        (Heating_Learn)                                                                 
Number                  LivingRoom_Heating_Power                                                                                        (Heating_Power)                                                                 

Switch                  BoilerRoom_Boiler_Switch            "CV aan/uit"                                                <fire>          (BoilerRoom,Influxdb)                                                           

I am setting LivingRoom_Heating_Setpoint_Normal to 28 and heating mode to “1”.

Appreciate all help! :slight_smile:

It looks like you’ve just saved or restart the rule (see the first log System started, checking for NULL
The old/previous timers are still active, but without a context. That’s why they give an error.

Can you post the rule? Maybe there is a typo, because there is no array, so there is no index needed.

It takes sometime a few hours (why I still don’t know).

Thanks for getting back to me. This has been running for 12 hours now and nothing has happened in the logfile after the error message initially (except two of those rule errors).

Here is the rule

rule "Boiler on/off"
when
    Member of Heating_BoilerValves changed
    or
    Time cron "0 0 0/4 ? * * *"
then
    checkFirstS.apply(Heating_BoilerValves.state as OnOffType, 10)
    logInfo(filename, "CV {}", Heating_BoilerValves.state.toString)
end

The Heating_BoilerVales has not changed either… Even though sensed temp is 21 degrees and setpoint is at 27.

You have to give 3 parameters instead of 2. First is the switch which controls the boiler (BoilerRoom_Boiler_Switch), secondly the state you wish and lastly the time-out (to avoid flapping).
checkFirstS.apply(BoilerRoom_Boiler_Switch, Heating_BoilerValves.state as OnOffType, 10)

Strange. If you change a setpoint or a heatmode, it should trigger the rule right away

Yeah, I removed the BoilerRoom_Boiler_Switch since I dont have this feature. I added it again and now I get another error:

[ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'Boiler on/off': cannot invoke method public abstract java.util.Date org.eclipse.smarthome.core.persistence.HistoricItem.getTimestamp() on null

This got me thinking maybe my persistance rules is giving me trouble ? I have influxdb configured and set to:

Strategies {
}
 
Items {
   *: strategy = everyChange, restoreOnStartup
}