[solved] How can I save the current setting of my heating in a rule?

  • Platform information:
    • Hardware: Raspberry PI 3
    • OS: raspbian
    • openHAB version: 2.2 (I guess)
  • Issue of the topic: I want to manage an open Window Contact for my heating
  • Please post configurations (if applicable):
    • Items configuration related to the issue
// Buero
String  maxModeBuero                 "Modus"                                                  <max_mode>  (gMaxBuero, gMaxMode, gMaxAutoMode)                                  {channel="max:thermostat:NEQ0101554:NEQ0100856:mode"}
Number  maxSetTempBuero              "Zieltemperatur [%.1f °C]"                               <max_temp>  (gMaxBuero, gMaxSetTemp, gMaxAutoTemp)        ["TargetTemperature"]  {channel="max:thermostat:NEQ0101554:NEQ0100856:set_temp"} 
Number  maxActualTempBuero           "Raumtemperatur [%.1f °C]"                               <max_temp>  (gMaxBuero, gMaxActualTemp)                   ["CurrentTemperature"] {channel="max:thermostat:NEQ0101554:NEQ0100856:actual_temp"}
Switch  maxBatLowBuero               "Batteriestatus Büro [MAP(max.map):%s]"                  <battery>   (gMaxBuero, gMaxBatLow)                                              {channel="max:thermostat:NEQ0101554:NEQ0100856:battery_low"}
Number  maxValveBuero                "Ventilstellung [%d %%]"                                 <max_valve> (gMaxBuero, gMaxValve)                                               {channel="max:thermostat:NEQ0101554:NEQ0100856:valve"}
// Contact maxLockedBuero               "Bediensperre [MAP(max.map):%s]"                      <lock>      (gMaxBuero, gMaxLock)                                                {channel="max:thermostat:NEQ0101554:NEQ0100856:locked"}
Contact  maxWindowBuero			     "Fenster Büro  [MAP(max.map):%s]"				          <window>    (gMaxBuero, gMaxWindow)			                                   {channel="max:shuttercontact:NEQ0101554:NEQ0100259:contact_state"}
  • Rules code related to the issue
val Number BueroTemp = 12.0

rule "Büro Fenster öffnen/schließen"
when

	Item maxWindowBuero changed
	
then
if (maxWindowBuero.state == OPEN){
	BueroTemp.sendCommand(maxSetTempBuero.set_temp)
        // BueroTemp.postUpdate(maxSetTempBuero.set_temp) <- this I tried also
	maxSetTempBuero.sendCommand(5.0)
	}
if (maxWindowBuero.state == CLOSED){
	maxSetTempBuero.sendCommand(BueroTemp)
	}
end
  • If logs where generated please post these here using code fences:
2018-01-28 20:01:04.429 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Büro Fenster öffnen/schließen': 'sendCommand' is not a member of 'java.lang.Double'; line 64, column 2, length 47

or

2018-01-28 19:54:04.276 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Büro Fenster öffnen/schließen': 'postUpdate' is not a member of 'java.lang.Double'; line 64, column 2, length 46


How can I save the current setting of my heating maxSetTempBuero?
I tried a lot of combinations but did not get the rule running.
I copied it from here:

Any help for a beginner is wellcome!

Thanks in advance,
Ralf

sendCommand and postUpdate are methods for items, you are trying to set a global variable to a new value!
The sign to perform that is just =

maxSetTempBuero.set_temp

As maxSetTempBuero is an item, there is no method nor property named set_temp. Instead of this, you have to use

BueroTemp = maxSetTempBuero.state as Number
1 Like

Thanks for your answer. Will try this evening at home. Looks like it is exactly what I need.

For better understanding: What does “.state” mean? Can you point me to the documentation for learning?

Look here

Thanks a lot. That solved my issue!