Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
# MQTT Transmission Create Transmitter
logger = system.util.logger("com.cirruslink.examples.transmitter.customtransmitters")

# Get the Default Set ID
sets = system.cirruslink.transmission.readConfig("Sets")
for config in sets:
  if config["Name"] == "Default":
    setId = config["Id"]
    logger.debug("New Set ID: " + str(setId))

# Create Transmitter One
#transmitterPropstransmitterProps = {}
#transmitterPropstransmitterProps["Name"] = "Custom One"
#transmitterPropstransmitterProps["Enabled"] = True
#transmitterPropstransmitterProps["TagProvider"] = "default"
#transmitterPropstransmitterProps["TagPath"] = ""
#transmitterPropstransmitterProps["TagPacingPeriod"] = 1000
#transmitterPropstransmitterProps["ServerSetId"] = setId
#transmitterPropstransmitterProps["DiscoveryDelay"] = 0
#transmitterPropstransmitterProps["AliasedTags"] = False
#transmitterPropstransmitterProps["CompressionTypeWrapper"] = "NONE"
#transmitterPropstransmitterProps["BlockCommands"] = False
#transmitterPropstransmitterProps["ConvertUdts"] = True
#transmitterPropstransmitterProps["PublishUdtDefinitions"] = True
#transmitterPropstransmitterProps["OptimizeUdts"] = True
#transmitterPropstransmitterProps["CacheBirthsEnabled"] = False
##transmitterProps#transmitterProps["HistoryStore"] = None
#transmitterPropstransmitterProps["EnableStoreForwardByDefault"] = True
#transmitterPropstransmitterProps["InOrderHistory"] = False
#transmitterPropstransmitterProps["GroupId"] = "Test1G"
#transmitterPropstransmitterProps["EdgeNodeId"] = "Test1E"
#transmitterPropstransmitterProps["DeviceId"] = None
#transmitterPropstransmitterProps["FilteredProperties"] = "accessRights;clampMode;deadband;deadbandMode;formatString;historicalDeadband;historicalDeadbandMode;historicalDeadbandStyle;historyEnabled;historyMaxAge;historyMaxAgeUnits;historyProvider;historySampleRate;historySampleRateUnits;historyTagGroup;historyTimeDeadband;historyTimeDeadbandUnits;opcItemPath;opcServer;permissionModel;rawHigh;rawLow;sampleMode;scaleFactor;scaleMode;scaledHigh;scaledLow;tagGroup;valueSource;expression;expressionType;ConfiguredTagPath;eventScripts;readPermissions;writePermissions;eventScripts"
#transmitterPropstransmitterProps["RebirthDebounceDelay"] = 5000
#systemsystem.cirruslink.transmission.createConfig("Transmitters", transmitterProps)

# Read Config
savedTransmitters = system.cirruslink.transmission.readConfig("Transmitters")
for config in savedTransmitters:
  if config["Name"] == "Custom One":
    logger.info("Transmitter Config: " + str(config))
    customOneId = config["Id"]

# Delete Config
#system.cirruslink.transmission.deleteConfig("Transmitters", customOneId)

...