[SOLVED] MAX! cube set temperature at a specific time

Hello, i am using OH2 with a Raspberry pi and the MAX cube binding. I am trying to set the temperature of one room at 8:30 in the morning using the folowing rule. This is not working, could someone help me out what is wrong with this rule or point me in the right direction?

Thanks

when
    Time cron "0 30 8 * * ?" 
then
   WallmountedThermostatWoonkamerThermostaat_SetpointTemperature.sendCommand(20)
end

@RvD

Your cron expression should be

Time cron "0 30 8 ? * *"

You easily can create cron expressions with this generator.

https://www.freeformatter.com/cron-expression-generator-quartz.html

EDIT: OK, I now see you’ve used “every day of week” and I’ve used “every day of month”. It should result the same.

Do you also have a rule name at the beginning?

rule "my rule name"

Do you get any errors messages?

There was indeed an error, thanks for pointing this out. The error was:

2019-10-05 08:27:24.132 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘home.rules’ has errors, therefore ignoring it: [134,1]: missing EOF at ‘when’

Your remark about the rule name made me wonder if it would work if i would make a separate rule file for it. I had added it to an existing rule file now. The code works in the separate rule file, so i had made a mistake when i added this code to an existing rule file. Still don’t know what the error was i had made but the rule is working at the moment.

Thanks for pointing me in the right direction.

1 Like