{
  "ruleChain": {
    "additionalInfo": null,
    "name": "Root Rule Chain",
    "firstRuleNodeId": null,
    "root": true,
    "debugMode": false,
    "configuration": null
  },
  "metadata": {
    "firstNodeIndex": 3,
    "nodes": [
      {
        "additionalInfo": {
          "layoutX": 1069,
          "layoutY": 267
        },
        "type": "org.thingsboard.rule.engine.filter.TbJsFilterNode",
        "name": "Is Thermostat?",
        "debugMode": false,
        "configuration": {
          "jsScript": "return msg.id.entityType === \"DEVICE\" && msg.type === \"thermostat\";"
        }
      },
      {
        "additionalInfo": {
          "layoutX": 824,
          "layoutY": 156
        },
        "type": "org.thingsboard.rule.engine.telemetry.TbMsgTimeseriesNode",
        "name": "Save Timeseries",
        "debugMode": false,
        "configuration": {
          "defaultTTL": 0
        }
      },
      {
        "additionalInfo": {
          "layoutX": 825,
          "layoutY": 52
        },
        "type": "org.thingsboard.rule.engine.telemetry.TbMsgAttributesNode",
        "name": "Save Client Attributes",
        "debugMode": false,
        "configuration": {
          "scope": "CLIENT_SCOPE"
        }
      },
      {
        "additionalInfo": {
          "layoutX": 347,
          "layoutY": 149
        },
        "type": "org.thingsboard.rule.engine.filter.TbMsgTypeSwitchNode",
        "name": "Message Type Switch",
        "debugMode": false,
        "configuration": {
          "version": 0
        }
      },
      {
        "additionalInfo": {
          "layoutX": 839,
          "layoutY": 345
        },
        "type": "org.thingsboard.rule.engine.action.TbLogNode",
        "name": "Log RPC from Device",
        "debugMode": false,
        "configuration": {
          "jsScript": "return '\\nIncoming message:\\n' + JSON.stringify(msg) + '\\nIncoming metadata:\\n' + JSON.stringify(metadata);"
        }
      },
      {
        "additionalInfo": {
          "layoutX": 832,
          "layoutY": 407
        },
        "type": "org.thingsboard.rule.engine.action.TbLogNode",
        "name": "Log Other",
        "debugMode": false,
        "configuration": {
          "jsScript": "return '\\nIncoming message:\\n' + JSON.stringify(msg) + '\\nIncoming metadata:\\n' + JSON.stringify(metadata);"
        }
      },
      {
        "additionalInfo": {
          "layoutX": 825,
          "layoutY": 468
        },
        "type": "org.thingsboard.rule.engine.rpc.TbSendRPCRequestNode",
        "name": "RPC Call Request",
        "debugMode": false,
        "configuration": {
          "timeoutInSeconds": 60
        }
      },
      {
        "additionalInfo": {
          "layoutX": 1069,
          "layoutY": 90
        },
        "type": "org.thingsboard.rule.engine.filter.TbJsFilterNode",
        "name": "Is Thermostat?",
        "debugMode": false,
        "configuration": {
          "jsScript": "return metadata[\"deviceType\"] === \"thermostat\";"
        }
      },
      {
        "additionalInfo": {
          "layoutX": 1090,
          "layoutY": 360
        },
        "type": "org.thingsboard.rule.engine.action.TbCreateRelationNode",
        "name": "Relate to Asset",
        "debugMode": false,
        "configuration": {
          "direction": "FROM",
          "relationType": "ToAlarmPropagationAsset",
          "entityType": "ASSET",
          "entityNamePattern": "Thermostat Alarms",
          "entityTypePattern": "AlarmPropagationAsset",
          "entityCacheExpiration": 300,
          "createEntityIfNotExists": true,
          "changeOriginatorToRelatedEntity": false,
          "removeCurrentRelations": false
        }
      }
    ],
    "connections": [
      {
        "fromIndex": 0,
        "toIndex": 8,
        "type": "True"
      },
      {
        "fromIndex": 1,
        "toIndex": 7,
        "type": "Success"
      },
      {
        "fromIndex": 3,
        "toIndex": 5,
        "type": "Other"
      },
      {
        "fromIndex": 3,
        "toIndex": 2,
        "type": "Post attributes"
      },
      {
        "fromIndex": 3,
        "toIndex": 1,
        "type": "Post telemetry"
      },
      {
        "fromIndex": 3,
        "toIndex": 4,
        "type": "RPC Request from Device"
      },
      {
        "fromIndex": 3,
        "toIndex": 6,
        "type": "RPC Request to Device"
      },
      {
        "fromIndex": 3,
        "toIndex": 0,
        "type": "Entity Created"
      }
    ],
    "ruleChainConnections": [
      {
        "fromIndex": 7,
        "targetRuleChainId": {
          "entityType": "RULE_CHAIN",
          "id": "25e26570-89ed-11ea-a650-cd6e14e633bd"
        },
        "additionalInfo": {
          "layoutX": 1109,
          "layoutY": 182,
          "ruleChainNodeId": "rule-chain-node-10"
        },
        "type": "True"
      }
    ]
  }
}