Air con and cron

I have been trying to get this to work for ages and its annoying me.

so i have an air con unit controlled by OH2 it works relatively well but i want it to come on at x time 2am or whatever and dry the room out. then go off x time later, but only when DEHU (switch) is on and the outside temp (ostemp) is 5 degrees or higher. To be fair i would like it to turn off if it dips below 5 as to protect the air con unit. Cant get it to work, can some one point me in the right direction, as i know its a syntax error. The time is not important more the interaction between cron and the items osTemp and DEHU

rule “dehumidify at 2am”

Time cron " 0 5 18 1/1 * ? *"

if ((Item DEHU.state == ON) && (osTemp.state >= 5)) {
sendCommand(AirconPower, ON)
sendCommand(AirconMode, 2)
sendCommand(AirconTemp, 16)
sendCommand(AirconSwingVertical, 1)

thanks in advance.

i worked it out it turns out the " " are not in fact " " not sure i understand it, they look like " to me… anyhow deleted them and retyped and all started to work.

Look very carefully: The bad quotes are curved, and the leading and trailing quote are different. The good quotes are just straight up and down.

Programming interfaces almost always want the “plain” quotes, not the curly ones. The curly ones are more correct for use in writing, and match better what we’re taught to do by hand and will look better when printed, but they’re different characters and the programming languages aren’t recognizing them as quotes.

Little things like this matter to the computer, because the computer is stupid.

Working in a program designed to write words - such as Microsoft Word - is likely to get you the “smart quotes”. Working in a text or programming editor is more likely to get you the correct older straight quotes.

Glad you figured it out! Good luck!