• header.categories
    • header.recent
    • header.tags
    • header.popular
    • register
    • login

    Rules introduction

    scheduled pinned locked moved Rules
    rulesintroductionconditions
    4 posts 2 posters 3.6k views 1 watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • jkandasaJ offline
      jkandasa
      global:last-edited-by, jkandasa

      Rules are used to trigger set of Operations when a condition met the specification. MyController supports multiple conditions.

      Conditions type:
      • Compare
      • State
      • Script
      • String
      • Threshold
      • Threshold range

      To add new Rule, Navigate to Resources >> Rules >> Add rule.

      0_1461341569745_rules-conditions.png

      Condition - Compare

      We can compare Sensor variable1 with Sensor variable2.
      Example: Hall-temperature >= 20% outside-temperature

      0_1461342034928_rules-compare.png

      Condition - State

      With this condition we con monitor state of Binary type sensor variables, Node, Gateway and Resources group.
      Example for Sensor variable

      0_1461342238160_rules-state1.png

      Example for Node

      0_1461342300016_rules-state2.png

      Example for Gateway

      0_1461342418518_rules-state3.png

      Example for Resources group

      0_1461342479583_rules-state4.png

      Condition - Threshold

      With this condition we can monitor Sensor variable values with a static value or with another Sensor variable value

      Example with static value:

      0_1461342743069_rules-threshold-1.png

      Example with another Sensor variable:

      0_1461342836405_rules-threshold-2.png

      Condition - Threshold range

      With this condition we can monitor Sensor variable value Is in range? or Is in outside range?

      • Threshold value low (1) - low value of threshold
      • Threshold value high (2) - high value of threshold
      • Include threshold low - When we check this field included (1) in boundary
      • Include threshold high - When we check this field included (2) in boundary
      • In range - When you check this box will be act as In range check, otherwise Out side range check

      Example: X inside [10,56], X outside [45, 200]

      Example for In range:

      0_1461343409580_rules-thresholdrange-1.png

      Example for Out side range:

      0_1461343454204_rules-thresholdrange-2.png

      one-reply-to-this-post last-reply-time reply quote 0
      • M offline
        Marek
        global:last-edited-by,

        Hello,

        I would like to execute some operation when data from two sensors meet some condition.
        For example: if (sensor1 == 0 AND sensor2 == 0) then turn_off_power.

        Is there a way how to do it?

        Thank You,
        Marek

        jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
        • jkandasaJ offline
          jkandasa @Marek
          global:last-edited-by, jkandasa

          @Marek from UI you cannot compare two sensors. However you can writer simple script for condition. and return true or false. If you need help to write script let me know I will show some example.

          M one-reply-to-this-post last-reply-time reply quote 0
          • M offline
            Marek @jkandasa
            global:last-edited-by,

            @jkandasa Thanks for the hint. I'v created following script and it works 😄

            var dimCree = mcApi.uidTag().getByUid("dimm_cree_uid");
            var dimCob = mcApi.uidTag().getByUid("dimm_cob_uid");
            ( dimCree.sensorVariable.value == 0 && dimCob.sensorVariable.value == 0 )

            Thanks for all the effort,
            Marek

            one-reply-to-this-post last-reply-time reply quote 1
            • first-post
              last-post

            0

            online

            644

            users

            532

            topics

            3.4k

            posts
            Copyright © 2015-2025 MyController.org | Contributors | Localization