JSON Import and XIDs-- Way to force new XIDs for data import?
-
Greetings, all:
Here's another weird one that may be unique to me. We do Solar. I do a LOT of different inverters. Even those that follow the Spec don't follow the spec, so nothing is ever the same.
I've found another odd case that makes things behave oddly;
I have an Inverter Template file for both Modbus TCP and Modbus Serial. This has ALL The points that I would conceivably care about for a solar inverter, and their scaling and historical logging settings. This file changes occasionally as new features are released. This template file gets maintained as a JSON Data export. When I add new things, I export this, and that becomes the New Template File.
The side effect of this is that I am duplicating XID's throughout my system. This isn't a Big Problem, except in the case I just found: This site has both Serial and Ethernet connected devices. I did some modifying, and imported in the Serial template file, and it merrily changed the Ethernet device's point settings (since they had the same XID as the Serial export, since that file was made via export and editing).
Also, I've got lots of things phoning home via the Persistent TCP Publisher: I always append a unique name (the SITENAME_ as an XID prefix).
I guess- I'm always going to use this "template file" approach, when new machines get configured, and I can't figure out a good way to get over this. Maybe I should set up a Dummy Mango Install JUST to store my configs that never polls anything, and just copy'n'edit the data sources there, hence getting a new XID each time I copy, rather than storing the configs as JSON files..
In fact, I think I maybe just answered my own question.
Okay then. Thanks for Listening.
-
this is done by using the CSV import/export. There is a column on the CSV file called action. where you can change it to UPDATE, DELETE or CREATE. If it is set to create you can leave the XID column blank and the XID will then be generated when the points are created.