Simple rule for FritzBox DECT Comet Thermostat

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
    • openHAB version: 2.2

sorry, please find below the right rule coding:

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

Hi Oliver,

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.

I gave it another try ans started to create a new items file:

Group gCOMETDECT_Office "Comet DECT heating thermostat" <temperature>
Number COMETDECT_ActualTemp "Actual measured temperature [%.1f °C]" (gCOMETDECT_Office) { channel="avmfritz:Comet_DECT:1:119600204408:actual_temp" }
Number COMETDECT_Temperature "Actual measured temperature [%.1f °C]" (gCOMETDECT_Office) { channel="avmfritz:Comet_DECT:1:119600204408:temperature" }
Number COMETDECT_SetTemp "Thermostat temperature set point [%.1f °C]" (gCOMETDECT_Office) { channel="avmfritz:Comet_DECT:1:119600204408:set_temp" }
String COMETDECT_RadiatorMode "Radiator mode [%s]" (gCOMETDECT_Office) { channel="avmfritz:Comet_DECT:1:119600204408:radiator_mode" }
Switch COMETDECT_Battery "Battery low" (gCOMETDECT_Office) { channel="avmfritz:Comet_DECT:1:119600204408:battery_low" }

after that I’ve created following rule:

rule "Office"
when
    COMETDECT_ActualTemp changed from 23
then
    logInfo("Rule: Office", "Starting Rule Office")
    COMETDECT_SetTemp.sendCommand(26)
    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’

Thanks a lot for any idea!!

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.

```
your log goes here
```

You miss Item.

Item COMETDECT_ActualTemp changed from 23

Hi Oliver,

There is a small syntax error in your rule. The keyword Item is missing in the rule trigger. Try this:

rule "Office"
when
    Item COMETDECT_ActualTemp changed
then
    // your code goes here
end

thank you for you replies . I added the keyword Item in my rule file heizung.rules.
Please find below the current state:

rule "office"
when
    Item COMETDECT_ActualTemp changed 
then    
    COMETDECT_SetTemp.sendCommand(26)
end

And here’s my heizung.items file:

Group gCOMETDECT_Office "Comet DECT heating thermostat" <temperature>

Number COMETDECT_ActualTemp "Actual measured temperature [%.1f °C]" (gCOMETDECT_Office) { channel="avmfritz:Comet_DECT:1:119600204408:actual_temp" }
Number COMETDECT_Temperature "Actual measured temperature [%.1f °C]" (gCOMETDECT_Office) { channel="avmfritz:Comet_DECT:1:119600204408:temperature" }
Number COMETDECT_SetTemp "Thermostat temperature set point [%.1f °C]" (gCOMETDECT_Office) { channel="avmfritz:Comet_DECT:1:119600204408:set_temp" }
String COMETDECT_RadiatorMode "Radiator mode [%s]" (gCOMETDECT_Office) { channel="avmfritz:Comet_DECT:1:119600204408:radiator_mode" }
Switch COMETDECT_Battery "Battery low" (gCOMETDECT_Office) { channel="avmfritz:Comet_DECT:1:119600204408:battery_low" }

comet.things:

Bridge avmfritz:fritzbox:1 @ "Office" [ ipAddress="192.168.1.1", password="0535" ] {
Thing Comet_DECT 119600204408 "Comet DECT Arbeitszimmer" @ "Office" [ ain="119600204408" ]
}

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'

Hm, to be honest I don’t know. Sry.

Is the rule working?

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

Thanks to all. The rule is working ! :grinning:
The above mentioned log entries are just warnings but the function of the rules is not affected :+1:

This error is normal when saving the rules file.
I think it somehow is dependend of how the rules get processed when they are saved.