Hi ssthlmann,
Thanks for the question! Sometimes I wonder if this module goes overlooked, so I'm glad you're giving it a try!
In the course of answering this question, I found a bug in using the quadruple dollar sign without a property name, but I have fixed this and we'll release version 3.3.1 of the module shortly. Thanks for the note about the print statement. I will remove that from the script and then it should be compatible with python 2 or 3.
Here's my pre-processed JSON:
{
"dataSources":[
{
"xid":"DS_Template_%%deviceNumber%%",
"name":"%%deviceName%%",
"enabled":true,
"type":"VIRTUAL",
"alarmLevels":{
"POLL_ABORTED":"URGENT"
},
"purgeType":"YEARS",
"updatePeriodType":"SECONDS",
"polling":true,
"updatePeriods":5,
"editPermission":"",
"purgeOverride":false,
"purgePeriod":1
}
],
"dataPoints":[
{
"xid":"DP_Templated_1",
"name":"$$DataPointName1$$",
"enabled":true,
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"ALPHANUMERIC",
"changeType":{
"type":"NO_CHANGE",
"startValue":"$$$$"
},
"settable":true
},
"eventDetectors":[
],
"plotType":"STEP",
"rollup":"NONE",
"unit":"",
"templateXid":"Alphanumeric_Default",
"chartColour":"",
"chartRenderer":{
"type":"TABLE",
"limit":10
},
"dataSourceXid":"DS_Template_%%deviceNumber%%",
"defaultCacheSize":1,
"deviceName":"%%deviceName%%",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"intervalLoggingPeriod":15,
"intervalLoggingSampleWindowSize":0,
"overrideIntervalLoggingSamples":false,
"preventSetExtremeValues":false,
"purgeOverride":false,
"purgePeriod":1,
"readPermission":"",
"setExtremeHighLimit":1.7976931348623157E308,
"setExtremeLowLimit":-1.7976931348623157E308,
"setPermission":"",
"tags":{
},
"textRenderer":{
"type":"PLAIN",
"useUnitAsSuffix":true,
"unit":"",
"renderedUnit":"",
"suffix":""
},
"tolerance":0.0
}
]
}
I ran the h2ftl.py script and created output.ftl, which looks like this:
<#--===MANIFEST===
deviceNumber:Global:Global
deviceName:Global:Global
name:prefix:DataPointName1
startValue:prefix:
===END MANIFEST===-->
{
"dataSources":[
{
"xid":"DS_Template_<#if deviceNumberGlobalGlobal??>${deviceNumberGlobalGlobal}<#else>${defaultdeviceNumberGlobalGlobal}</#if>",
"name":"<#if deviceNameGlobalGlobal??>${deviceNameGlobalGlobal}<#else>${defaultdeviceNameGlobalGlobal}</#if>",
"enabled":true,
"type":"VIRTUAL",
"alarmLevels":{
"POLL_ABORTED":"URGENT"
},
"purgeType":"YEARS",
"updatePeriodType":"SECONDS",
"polling":true,
"updatePeriods":5,
"editPermission":"",
"purgeOverride":false,
"purgePeriod":1
}
],
"dataPoints":[
{
"xid":"DP_Templated_1",
"name":"<#if nameprefixDataPointName1??>${nameprefixDataPointName1}<#else>${defaultnameprefixDataPointName1}</#if>",
"enabled":true,
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"ALPHANUMERIC",
"changeType":{
"type":"NO_CHANGE",
"startValue":"<#if startValueprefix??>${startValueprefix}<#else>${defaultstartValueprefix}</#if>"
},
"settable":true
},
"eventDetectors":[
],
"plotType":"STEP",
"rollup":"NONE",
"unit":"",
"templateXid":"Alphanumeric_Default",
"chartColour":"",
"chartRenderer":{
"type":"TABLE",
"limit":10
},
"dataSourceXid":"DS_Template_<#if deviceNumberGlobalGlobal??>${deviceNumberGlobalGlobal}<#else>${defaultdeviceNumberGlobalGlobal}</#if>",
"defaultCacheSize":1,
"deviceName":"<#if deviceNameGlobalGlobal??>${deviceNameGlobalGlobal}<#else>${defaultdeviceNameGlobalGlobal}</#if>",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"intervalLoggingPeriod":15,
"intervalLoggingSampleWindowSize":0,
"overrideIntervalLoggingSamples":false,
"preventSetExtremeValues":false,
"purgeOverride":false,
"purgePeriod":1,
"readPermission":"",
"setExtremeHighLimit":1.7976931348623157E308,
"setExtremeLowLimit":-1.7976931348623157E308,
"setPermission":"",
"tags":{
},
"textRenderer":{
"type":"PLAIN",
"useUnitAsSuffix":true,
"unit":"",
"renderedUnit":"",
"suffix":""
},
"tolerance":0.0
}
]
}
which I then placed in Mango/web/templateConfigruation/web/ftl/ and navigated to the /templateConfiguration.shtm page. Upon importing my template, I got this dialogue:

Which imported a data source and one point that were these:
{
"dataSources":[
{
"xid":"DS_Template_555",
"name":"CoolTemplate",
"enabled":true,
"type":"VIRTUAL",
"alarmLevels":{
"POLL_ABORTED":"URGENT"
},
"purgeType":"YEARS",
"updatePeriodType":"SECONDS",
"polling":true,
"updatePeriods":5,
"editPermission":"",
"purgeOverride":false,
"purgePeriod":1
}
],
"dataPoints":[
{
"xid":"DP_Templated_1",
"name":"My Data Point",
"enabled":true,
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"ALPHANUMERIC",
"changeType":{
"type":"NO_CHANGE",
"startValue":"foobar"
},
"settable":true
},
"eventDetectors":[
],
"plotType":"STEP",
"rollup":"NONE",
"unit":"",
"templateXid":"Alphanumeric_Default",
"chartColour":"",
"chartRenderer":{
"type":"TABLE",
"limit":10
},
"dataSourceXid":"DS_Template_555",
"defaultCacheSize":1,
"deviceName":"CoolTemplate",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"intervalLoggingPeriod":15,
"intervalLoggingSampleWindowSize":0,
"overrideIntervalLoggingSamples":false,
"preventSetExtremeValues":false,
"purgeOverride":false,
"purgePeriod":1,
"readPermission":"",
"setExtremeHighLimit":1.7976931348623157E308,
"setExtremeLowLimit":-1.7976931348623157E308,
"setPermission":"",
"tags":{
},
"textRenderer":{
"type":"PLAIN",
"useUnitAsSuffix":true,
"unit":"",
"renderedUnit":"",
"suffix":""
},
"tolerance":0.0
}
]
}
This is the issue I fixed: https://github.com/infiniteautomation/ma-core-public/issues/1204
But you will not be able to use the example provided here until 3.3.1 of the template configuration module is released. However, you could modify two lines in output.ftl and it will work:
startValue:prefix: --> startValue:prefix:A
"startValue":"<#if startValueprefix??>${startValueprefix}<#else>${defaultstartValueprefix}</#if>"
-->
"startValue":"<#if startValueprefixA??>${startValueprefixA}<#else>${defaultstartValueprefixA}</#if>"