• Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login
  • Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login

Rules introduction

Scheduled Pinned Locked Moved Rules
rulesintroductionconditions
4 Posts 2 Posters 3.4k Views 1 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    jkandasa
    last edited by jkandasa 22 Apr 2016, 16:12

    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

    1 Reply Last reply Reply Quote 0
    • M Offline
      Marek
      last edited by 3 Nov 2016, 23:01

      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

      J 1 Reply Last reply 4 Nov 2016, 00:51 Reply Quote 0
      • J Offline
        jkandasa @Marek
        last edited by jkandasa 11 Aug 2016, 06:43 4 Nov 2016, 00:51

        @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 1 Reply Last reply 7 Nov 2016, 21:33 Reply Quote 0
        • M Offline
          Marek @jkandasa
          last edited by 7 Nov 2016, 21:33

          @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

          1 Reply Last reply Reply Quote 1
          • First post
            Last post

          0

          Online

          620

          Users

          531

          Topics

          3.4k

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