Menu

Temperature comparison bug?

Help
2010-01-26
2012-12-14
  • Frank Eisold

    Frank Eisold - 2010-01-26

    Hello,

    I plan to switch the heating mode at night back to comfort mode if the temperature outside is less (or equal) than -5 degree.

    <rule id="Heizung_Nacht">
      <condition type="and">
         <condition type="object" id="ZH_BA_Nacht" value="1" trigger="true"/>
         <condition type="object" id="Status_Anwesenheit" value="1"/>
         <condition type="object" id="Aussentemp" op="lte" value="-5"/>
      </condition>
      <actionlist>
         <action type="set-value" id="ZH_BA_Komfort" value="1" delay="5s"/>
      </actionlist>

    Actual the outside temp is -14 degree. But if "ZH_BA_Nacht" is switched to true nothing happens.
    The problem seems to be the comparison operator. With op="lt" the condition will be evaluated correct as true and the action will be executed. With op="lte" the condition will be evaltuated as false. is there a bug?

    Regards,
    Frank

     
  • jef2000

    jef2000 - 2010-01-31

    Hi,

    Yes, it's a stupid one-letter mistake I did in file ruleserver.cpp:
        else if (op == "lte")
            op_m = gt | eq;

    The "gt" should be "lt"

    Thanks for discovering it.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.