Menu

Evaluation error with TimerCondition

Help
chris_14
2009-10-22
2012-12-14
  • chris_14

    chris_14 - 2009-10-22

    Hello.

    For closing my blinds I use two rules, for presence an not presence:

            <rule id="rollo_runter_1">
                <condition type="and">
                    <condition type="timer" trigger="true">
                        <at type="sunset" offset="0"/>
                        <until hour="23" min="59" />
                    </condition>
                <condition type="object" id="anwesend" value="false" trigger="true" />
                </condition>
                <actionlist>
                    <action type="set-value" id="zentralsteuerung_rollos" value="1" />
                </actionlist>
            </rule>
            <rule id="rollo_runter_2">
                <condition type="and">
                    <condition type="timer" trigger="true">
                        <at hour="21" min="45" />
                        <until hour="23" min="59" />
                    </condition>       
                <condition type="object" id="anwesend" value="true" trigger="true" />
                </condition>
                <actionlist>
                    <action type="set-value" id="zentralsteuerung_rollos" value="1" />
                </actionlist>
            </rule>

    But every time, I change the object "anwesend" to false (presence = false) the blinds are going down. This seems to be caused by a wrong evaluation of the AND condition (last line):

        2009-10-22 16:17:41  Condition: TimerCondition evaluated as '1'
        2009-10-22 16:17:41  SwitchingObject: SwitchingObject (id=anwesend): Compare value_m='1' to value='0'
        2009-10-22 16:17:41  Condition: ObjectCondition (id='anwesend') evaluated as '0'
        2009-10-22 16:17:41  Condition: TimerCondition evaluated as '0'
        2009-10-22 16:17:41  FilePersistentStorage: Writing 'on' for object 'anwesend'
       
        2009-10-22 16:18:25  Condition: TimerCondition evaluated as '1'
        2009-10-22 16:18:26  SwitchingObject: SwitchingObject (id=anwesend): Compare value_m='0' to value='0'
        2009-10-22 16:18:26  Condition: ObjectCondition (id='anwesend') evaluated as '1'
        2009-10-22 16:18:26  Condition: TimerCondition evaluated as '0'
        2009-10-22 16:18:26  FilePersistentStorage: Writing 'off' for object 'anwesend'
        2009-10-22 16:18:26  Action: Execute SetValueAction with value on

    The configuration looks like this:

        2009-10-22 16:16:17  Rule: Rule: Configuring rollo_runter_1 (active=1)
        2009-10-22 16:16:17  TimeSpec: 1899-0-1 -1:-1:0 (wdays=0; exception=2)
        2009-10-22 16:16:17  TimeSpec: 1899-0-1 23:59:0 (wdays=0; exception=2)
        2009-10-22 16:16:17  SolarTimeSpec: sun_rise_set date 2009-10-22
        2009-10-22 16:16:17  SolarTimeSpec: sun_rise_set returned 18:24
        2009-10-22 16:16:17  SolarTimeSpec: adjustTime date 2009-10-22
        2009-10-22 16:16:17  SolarTimeSpec: adjustTime returned 16:16
        2009-10-22 16:16:17  PeriodicTask: Rescheduled at 2009-10-22 16:16:17 (1256220977)
        2009-10-22 16:16:17  Condition: ObjectCondition: configured value_m='off'
        2009-10-22 16:16:17  Rule: ActionList: Configuring
        2009-10-22 16:16:17  Action: SetValueAction: Configured for object zentralsteuerung_rollos with value on
        2009-10-22 16:16:17  Rule: Rule: Configuration done
        2009-10-22 16:16:17  Rule: Rule: Configuring rollo_runter_2 (active=1)
        2009-10-22 16:16:17  TimeSpec: 1899-0-1 21:45:0 (wdays=0; exception=2)
        2009-10-22 16:16:17  TimeSpec: 1899-0-1 23:59:0 (wdays=0; exception=2)
        2009-10-22 16:16:17  PeriodicTask: Rescheduled at 2009-10-22 16:16:17 (1256240700)
        2009-10-22 16:16:17  Condition: ObjectCondition: configured value_m='on'
        2009-10-22 16:16:17  Rule: ActionList: Configuring
        2009-10-22 16:16:17  Action: SetValueAction: Configured for object zentralsteuerung_rollos with value on
        2009-10-22 16:16:17  Rule: Rule: Configuration done

    For me, it looks like that the evaluation of the TimerCondition with sunset is not correct. Any idea?

     
  • chris_14

    chris_14 - 2009-10-22

    Here are the rules again in readable form (I hope):

        <rule id="rollo_runter_1">
            <condition type="and">
                <condition type="timer" trigger="true">
                    <at type="sunset" offset="0"/>
                    <until hour="23" min="59" />
                </condition>
            <condition type="object" id="anwesend" value="false" trigger="true" />
            </condition>
            <actionlist>
                <action type="set-value" id="zentralsteuerung_rollos" value="1" />
            </actionlist>
        </rule>
        <rule id="rollo_runter_2">
            <condition type="and">
                <condition type="timer" trigger="true">
                    <at hour="21" min="45" />
                    <until hour="23" min="59" />
                </condition>       
            <condition type="object" id="anwesend" value="true" trigger="true" />
            </condition>
            <actionlist>
                <action type="set-value" id="zentralsteuerung_rollos" value="1" />
            </actionlist>
        </rule>

     
  • chris_14

    chris_14 - 2009-10-22

    Last try:
    `<rule id="rollo_runter_1">
        <condition type="and">
            <condition type="timer" trigger="true">
                <at type="sunset" offset="0"/>
                <until hour="23" min="59" />
            </condition>
        <condition type="object" id="anwesend" value="false" trigger="true" />
        </condition>
        <actionlist>
            <action type="set-value" id="zentralsteuerung_rollos" value="1" />
        </actionlist>
    </rule>
    <rule id="rollo_runter_2">
        <condition type="and">
            <condition type="timer" trigger="true">
                <at hour="21" min="45" />
                <until hour="23" min="59" />
            </condition>       
        <condition type="object" id="anwesend" value="true" trigger="true" />
        </condition>
        <actionlist>
            <action type="set-value" id="zentralsteuerung_rollos" value="1" />
        </actionlist>
    </rule>`

     
  • Peter

    Peter - 2009-10-22

    Hallo chris_14,

          </condition>
        <condition type="object" id="anwesend" value="false" trigger="true" />
        </condition>

    change to
          
        <condition type="object" id="anwesend" value="false" trigger="true" />
      < /condition>
    </condition>

    my rule:
        <rule id="Souterrain_abwesend_2">      
                  <condition type="and">
                      <condition type="object" id="KG_abwesend" value="on" />
                       <condition type="timer" trigger="true">
                             <at type='sunset' wdays='1234567' offset="1250" />
                       </condition>
                   </condition>
                  <actionlist>
                    <action type="set-value" id="Rolladen_Souterrain" value="1" />
                  </actionlist>
                </rule>

    Viele Grüße
    Peter

     
  • jef2000

    jef2000 - 2009-10-25

    Hi,

    I think you have the same problem as described here:
    http://sourceforge.net/projects/linknx/forums/forum/743670/topic/3308230

    I suspect that this problem is caused by the logging facility. I discovered some time after I released 0.0.1.26 with improved logging that the date/time functions used in log messages were interfering with date/time functions used in sunrise/sunset or timers. I already fixed it in CVS. If you want to be sure that you see the same problem, you can add <loggging format="simple"/> to your config file (inside the <config> element, at the same level as <rules>, <objects> and <sevices>). This will remove the timestamps from log messages and perhaps solve your problem.

    Regards,

    Jean-François

     

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.