Dear all,
I’ve tried to create a simple rule to change the temperature value of my COMET Thermostat.
Therefore I’ve created following rule:
rule "Office" when ** Item avmfritz_Comet_DECT_192_168_1_1_119600204408_temperature changed** then ** logInfo(“Rule: Office”, “Starting Rule Office”)** ** avmfritz_Comet_DECT_192_168_1_1_119600204408_set_temp.postUpdate(26) ** ** logInfo(“Rule: Office”, “changed temperature to 26 degrees”)** end
Unfortunately the rule doesn’t work.
In the openhab.log file I just get following information:
2018-02-10 18:15:42.054 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'heizung.rules’
2018-02-10 18:15:42.054 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘heizung.rules’ is either empty or cannot be parsed correctly!
2018-02-10 18:15:42.601 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'heizung.rules’
2018-02-10 18:15:42.617 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘heizung.rules’ is either empty or cannot be parsed correctly!
2018-02-10 18:15:42.695 [ERROR] [se.xtext.ide.server.WorkspaceManager] - The document file:///C:/openHAB2/conf/rules/heizung.rules has not been opened.
Can anyone help me on that issue?
Thanks a lot and have a nice weekend!
Platform information:
Hardware: Intel Core i5
OS: WIndows 10
Java Runtime Environment: which java platform is used and what version
rule "Arbeitszimmer"
when
Item avmfritz_Comet_DECT_192_168_1_1_119600204408_temperature changed
then
logInfo(“Rule: Arbeitszimmer”, “Starting Rule Arbeitszimmer”) //SetTemp.postUpdate(28)
avmfritz_Comet_DECT_192_168_1_1_119600204408_set_temp.postUpdate(26)
logInfo(“Rule: Arbeitszimmer”, “Temp Arbeitszimmer auf 28 Grad erhoeht”)
end
I suppose the main problem is that you try to set the new temperature with postUpdate which doesn’t work like you expect it to do. There is a difference between postUpdate and sendCommand. The first one updates the state of an item. The latter one updates the state AND sends a command to linked channels. See here for a more detailed description https://docs.openhab.org/configuration/rules-dsl.html#manipulating-item-states.
logInfo("Rule: Office", "Temp Office auf 26 Grad erhoeht")
end
In openhab.log filefollowing message appeared:
2018-02-11 12:04:46.801 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'heizung.rules’
2018-02-11 12:04:46.801 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘heizung.rules’ is either empty or cannot be parsed correctly!
2018-02-11 12:04:46.816 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘heizung.rules’ has errors, therefore ignoring it: [3,5]: no viable alternative at input ‘COMETDECT_ActualTemp’
Please try to avoid to copy the code and then use the Codeblock buttons. First make the code fence then copy your code into it, this will avoid this empty lines. I think ist a bug. Feel free to correct your privous post for people who will read this in future. And also logs and all code you do not know how to format are best placed in a generic code fence, last button.
but I still get following error message in openhab.log file:
2018-02-11 13:32:41.283 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'heizung.rules'
2018-02-11 13:32:41.283 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'heizung.rules' is either empty or cannot be parsed correctly!
2018-02-11 13:32:41.315 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'heizung.rules'
I see those errors quite often - afaik only when editing the configuration files using the network share.
So if it is working, and those three log entries are the only ones according to this rule, i wouldn’t worry much