Menu

How to trigger a rule if the received value did NOT change

Help
knaller
2014-05-14
2014-05-15
  • knaller

    knaller - 2014-05-14

    Hi All,

    I configured a rule for my blinds and usually I send 0 for up and 1 for down. Stop is 1 od a differnt GAD.
    I intend to open all blinds in the house with one switch, with the exception if I have visitors. Then the 2 blinds should stay closed.
    I have 2 GADs where all blinds except the 2 of the guest room are in "all_blinds_move" and "all_blinds_stop" group and the 2 others in the "guest_blinds_move" "guest_blinds_stop"

    If I start the move action e.G. move_up everything works. But if I stop the action and try to move in the same direction with the next push of the button only the "all_blinds_group" work as linknx does not trigger the rule that says "guest_blinds_move" That rule has the trigger condition of "all_blinds_move"
    But "all_blinds_move" does not change with the second time moving the blinds into the same direction.
    So my problem is that the trigger is not satisfied if the value does not change.
    Is there a way to trigger even if the value does not change?
    Or is there another way that I just have not thought about?

    Something like a signal redirection which does not have to be a rule?

    Thanks

    knaller

     

    Last edit: knaller 2014-05-14
  • JensH

    JensH - 2014-05-15

    Hi knaller,
    maybe you can send an extract of your config / rules to make discussion easier...
    But maybe I can also give some generic hints.
    1) if you want, that a GAD is always "evaluated" even if it does not change, then you have to put a "s" (for "stateless" in the object definition.
    I.e.

    <object id="move_up" gad="x/y/z" type="1.001" flags="cwtus" >move_up</object>
    

    2) in a rule definition, where you want to evaluate the gad upon reception, you have to add the 'trigger="true"',
    i.e.

    <condition type="object" id="move_up" value="on" trigger="true" />
    

    3) if you want the action to be done, even if the rule (condition) result is not changing, then you have to write "if-true" in the actionlist-type.
    (there are 2 different options for "true" and "false"
    "on-true" and "if-true" and corresponding "on-false" and "if-false")
    The "on-..." is triggered, when the rule conditions CHANGE from true to false and vice versa.
    The "if-..." actions are also triggered in the case, when a condition is re-evaluated because of a "trigger" and the overall conditions are NOT changed, but stay true or false.
    Please check, that the "S" flag is also set in the GAD-objectm which you send in the actionlist. If the "s" (or formerly "f" - flag for "force" is not send, then an GAD is not send from linknx to the bus if it is not changed.

    So in your case this would mean something like this:

    <object id="move_up" gad="x1/y1/z1" type="1.001" flags="cwtus" >move_up</object>
    <object id="move_action" gad="x2/y2/z2" type="1.001" flags="cwtus" >move_action</object>
    
    <rule id="do_someting" init="false">
        <condition type="object" id="move_up" value="on" trigger="true" />
        <actionlist type="if-true"> 
            <action type="set-value" id="move_action" value="..." />
        </actionlist> 
    </rule> 
    

    Hope this helps. I have some quite complex logic implemented for my roof-window-shutters, which take "guests", "temperatures", "rain", "previous manual overides" into account and it is possible :-)
    best Regards, Jens

     
    • knaller

      knaller - 2014-05-15

      Hi Jens,

      thanks a lot. My problem was the "if-true" in the action list.
      Somehow I oversaw this. I thought I did it.
      Thanks a lot for your detailed explainations. You saved my day :-)

      Knaller

       

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.