Building publisher list with only points from enabled data sources
-
IS this possible? I only see the point enabled disabled and it selects the point for inclusion even if the data source is disabled. Is there a way to isolate only points from enabled data sources in the publisher selection list? When dealing with thousands of points that have the same device id across data sources we need a way to remove the disabled data source points from the list even if they have the same device ID.
-
The search fields in the header accepts regex, so you could delimit it (deviceName1|deviceName2|...)
Probably the only way to directly do what you're saying would be through JSON. Given an exported configuration, this Python script would add all enabled data points with enabled data sources to a publisher that doesn't already have them:
import json publisherXid = "PUB_Xid_To_Add_To" configFile = open("/path/to/ds-dp-pub.json") config = json.load(configFile) configFile.close() for pub in config["publishers"] : if pub["xid"] == publisherXid : publisher = pub break alreadyHas = {} for p in publisher["points"] : alreadyHas[p["dataPointId"]] = True dataSourceXidMap = {} for ds in config["dataSources"] : dataSourceXidMap[ds["xid"]] = ds for dp in config["dataPoints"] : if dp["enabled"] and dataSourceXidMap[dp["dataSourceXid"]]["enabled"] and dp["xid"] not in alreadyHas : publisher["points"].append({"dataSourceId": dp["xid"]}) outputFile = open("/path/to/output.json", "w+") outputFile.write(json.dumps(config, indent=4, sort_keys=False, separators=(",",": "))) outputFile.close()
-
Thanks Phil seems like that should work. I will run the script, import the publisher tomorrow and report back on the outcome. Thanks again.