Menu

LinKnx 'if-true' rule triggers unexpected

Help
knaller
2015-03-26
2015-03-29
  • knaller

    knaller - 2015-03-26

    Hi All,

    if I understand the 'if-true' condition right, it always triggers when the condition is true no matter what the value was before.
    In my case I defined a switch that should trigger the 'if-true' condition when 'on' arrives on the bus, and the 'if-false' condition if 0 arrives.
    But what happens is that the rule alternates from the 'if-true' condition to the 'if-false' condition even if I only receive 'on' on the bus.

    Here the definition of the object:

    <object id="switch_volume" gad="0/4/7" type="1.001" init="persist" flags="cwtur">Lautstärke</object>
    

    Here the definition of the rule:

    <rule id="change_volume">
        <condition type="object" id="switch_volume" value="on" trigger="true" />
        <actionlist type="if-true">
            <action type="shell-cmd" cmd="changevolume.php 'Z2volume' '+5'" />
        </actionlist>
        <actionlist type="if-false">
            <action type="shell-cmd" cmd="changevolume.php 'Z2volume' '-5'" />
        </actionlist>
    </rule>
    

    Here the evaluation result from the linknx output:

    2015-03-26 20:33:23 [ INFO] Object: New value on for object switch_volume (type: 1.001)
    2015-03-26 20:33:23 [ INFO] Rule: Evaluate rule change_volume
    2015-03-26 20:33:23 [ INFO] ObjectValue: SwitchingObjectValue: Compare value_m='1' to value='1'
    2015-03-26 20:33:23 [ INFO] Condition: ObjectCondition (id='switch_volume') evaluated as '1'
    2015-03-26 20:33:23 [ INFO] Rule: Rule change_volume evaluated as 1, prev value was 0
    2015-03-26 20:33:23 [ INFO] FilePersistentStorage: Writing 'on' for object 'switch_volume'
    2015-03-26 20:33:23 [ INFO] Action: Execute ShellCommandAction: changevolume.php 'Z2volume' '+5'
    2015-03-26 20:33:27 [ INFO] Object: New value off for object switch_volume (type: 1.001)
    2015-03-26 20:33:27 [ INFO] Rule: Evaluate rule change_volume
    2015-03-26 20:33:27 [ INFO] ObjectValue: SwitchingObjectValue: Compare value_m='0' to value='1'
    2015-03-26 20:33:27 [ INFO] Condition: ObjectCondition (id='switch_volume') evaluated as '0'
    2015-03-26 20:33:27 [ INFO] Rule: Rule change_volume evaluated as 0, prev value was 1
    2015-03-26 20:33:27 [ INFO] FilePersistentStorage: Writing 'off' for object 'switch_volume'
    2015-03-26 20:33:27 [ INFO] Action: Execute ShellCommandAction: changevolume.php 'Z2volume' '-5'
    2015-03-26 20:33:30 [ INFO] Object: New value on for object switch_volume (type: 1.001)
    2015-03-26 20:33:30 [ INFO] Rule: Evaluate rule change_volume
    2015-03-26 20:33:30 [ INFO] ObjectValue: SwitchingObjectValue: Compare value_m='1' to value='1'
    2015-03-26 20:33:30 [ INFO] Condition: ObjectCondition (id='switch_volume') evaluated as '1'
    2015-03-26 20:33:30 [ INFO] Rule: Rule change_volume evaluated as 1, prev value was 0
    2015-03-26 20:33:30 [ INFO] FilePersistentStorage: Writing 'on' for object 'switch_volume'
    2015-03-26 20:33:30 [ INFO] Action: Execute ShellCommandAction: changevolume.php 'Z2volume' '+5'
    2015-03-26 20:33:32 [ INFO] Object: New value off for object switch_volume (type: 1.001)
    2015-03-26 20:33:32 [ INFO] Rule: Evaluate rule change_volume
    2015-03-26 20:33:32 [ INFO] ObjectValue: SwitchingObjectValue: Compare value_m='0' to value='1'
    2015-03-26 20:33:32 [ INFO] Condition: ObjectCondition (id='switch_volume') evaluated as '0'
    2015-03-26 20:33:32 [ INFO] Rule: Rule change_volume evaluated as 0, prev value was 1
    2015-03-26 20:33:32 [ INFO] FilePersistentStorage: Writing 'off' for object 'switch_volume'
    2015-03-26 20:33:32 [ INFO] Action: Execute ShellCommandAction: changevolume.php 'Z2volume' '-5'
    2015-03-26 20:33:34 [ INFO] Object: New value on for object switch_volume (type: 1.001)
    2015-03-26 20:33:34 [ INFO] Rule: Evaluate rule change_volume
    2015-03-26 20:33:34 [ INFO] ObjectValue: SwitchingObjectValue: Compare value_m='1' to value='1'
    2015-03-26 20:33:34 [ INFO] Condition: ObjectCondition (id='switch_volume') evaluated as '1'
    2015-03-26 20:33:34 [ INFO] Rule: Rule change_volume evaluated as 1, prev value was 0
    2015-03-26 20:33:34 [ INFO] FilePersistentStorage: Writing 'on' for object 'switch_volume'
    2015-03-26 20:33:34 [ INFO] Action: Execute ShellCommandAction: changevolume.php 'Z2volume' '+5'
    

    Here the vbusmonitor1 result:

    LPDU: BC 10 58 04 07 E1 00 81 68 :L_Data low from 1.0.88 to 0/4/7 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 01
    LPDU: BC 10 58 04 07 E1 00 81 68 :L_Data low from 1.0.88 to 0/4/7 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 01
    LPDU: BC 10 58 04 07 E1 00 81 68 :L_Data low from 1.0.88 to 0/4/7 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 01
    LPDU: BC 10 58 04 07 E1 00 81 68 :L_Data low from 1.0.88 to 0/4/7 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 01
    LPDU: BC 10 58 04 07 E1 00 81 68 :L_Data low from 1.0.88 to 0/4/7 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write (small) 01
    

    As you see in the vbusmonitor1 result I only receive 01 values on the bus. The condition 'switch_volume' evaluates alternating from 0 to 1. I just do not understand why. I would expect that it evaluates to 1 every time.
    Maybe someone can shade some light into my darkness and has a clue why this is not working how expected.

    Thanks a lot

     
  • knaller

    knaller - 2015-03-29

    Hi All,

    I kind of found the problem. I changed the flags to "cwtrf" removing the u=update flag. That one was hindering the update I saw on vbusmonitor to be used by linknx. Why this was toggeling the result is still not clear to me, but now it works which is what I wanted.

    I leave this in the hope it might help someone with similar issues.

     

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.