Status: ein CCU programm kann nun Konsistent in ein JSON Object zerlegt werden. dieses wird dann von der CCU exportiert.
Code: Alles auswählen
{
"Rules": [
{
"RuleOperatorType": 2,
"ElseIfFlag": true,
"RuleConditions": [
{
"CndOperatorType": 2,
"SINGLECONDITION": [
{
"ConditionType": 1,
"ConditionType2": 4,
"OperatorType": 1,
"ConditionChannel": 65535,
"LeftValType": 19,
"RightVal1ValType": 2,
"RightVal2ValType": 2,
"RightVal1": false,
"RightVal2": false
},
{
"ConditionType": 1,
"ConditionType2": 4,
"OperatorType": 1,
"ConditionChannel": 65535,
"LeftValType": 19,
"RightVal1ValType": 2,
"RightVal2ValType": 2,
"RightVal1": false,
"RightVal2": false
},
{
"ConditionType": 1,
"ConditionType2": 4,
"OperatorType": 1,
"ConditionChannel": 1465,
"LeftValType": 18,
"RightVal1ValType": 16,
"RightVal2ValType": 16,
"RightVal1": 0,
"RightVal2": 0
}
]
},
{
"CndOperatorType": 2,
"SINGLECONDITION": [
{
"ConditionType": 1,
"ConditionType2": 4,
"OperatorType": 1,
"ConditionChannel": 65535,
"LeftValType": 19,
"RightVal1ValType": 2,
"RightVal2ValType": 2,
"RightVal1": false,
"RightVal2": false
},
{
"ConditionType": 1,
"ConditionType2": 4,
"OperatorType": 1,
"ConditionChannel": 65535,
"LeftValType": 19,
"RightVal1ValType": 2,
"RightVal2ValType": 2,
"RightVal1": false,
"RightVal2": false
},
{
"ConditionType": 3,
"ConditionType2": 13,
"OperatorType": 1,
"ConditionChannel": 65535,
"LeftValType": 24,
"RightVal1ValType": 18,
"RightVal2ValType": 0,
"RightVal1": 9419,
"RightVal2": null
}
]
}
],
"RuleDestination": {
"BreakOnRestart": true,
"SingleDestinations": [
{
"DestinationParam": 19,
"DestinationValueType": 2,
"DestinationChannel": 65535,
"DestinationDP": 950,
"DestinationValueParamType": 0,
"DestinationValueParam": null
},
{
"DestinationParam": 18,
"DestinationValueType": 19,
"DestinationChannel": 7467,
"DestinationDP": 7468,
"DestinationValueParamType": 0,
"DestinationValueParam": null
},
{
"DestinationParam": 20,
"DestinationValueType": 20,
"DestinationChannel": 65535,
"DestinationDP": 65535,
"DestinationValueParamType": 28,
"DestinationValueParam": "2019-04-30 00:00:10",
"DestinationValue": "WriteLine (\"Ich bin ein testScript\");"
}
]
}
},
{
"RuleOperatorType": 2,
"ElseIfFlag": true,
"RuleConditions": [
{
"CndOperatorType": 2,
"SINGLECONDITION": [
{
"ConditionType": 1,
"ConditionType2": 4,
"OperatorType": 1,
"ConditionChannel": 65535,
"LeftValType": 19,
"RightVal1ValType": 2,
"RightVal2ValType": 2,
"RightVal1": false,
"RightVal2": false
}
]
}
],
"RuleDestination": {
"BreakOnRestart": true,
"SingleDestinations": [
{
"DestinationParam": 18,
"DestinationValueType": 2,
"DestinationChannel": 1465,
"DestinationDP": 4037,
"DestinationValueParamType": 0,
"DestinationValueParam": null
}
]
}
},
{
"RuleOperatorType": 2,
"ElseIfFlag": false,
"RuleConditions": [],
"RuleDestination": {
"BreakOnRestart": true,
"SingleDestinations": [
{
"DestinationParam": 19,
"DestinationValueType": 2,
"DestinationChannel": 65535,
"DestinationDP": 8291,
"DestinationValueParamType": 0,
"DestinationValueParam": null
}
]
}
}
],
"Datapoints": [
{
"ID": 1855,
"Methods": {
"ENUM": 27,
"NAME": "AllwaysTrue",
"ValueType": 2,
"Type": 1089
}
},
{
"ID": 3833,
"Methods": {
"ENUM": 27,
"NAME": "Rollo.AstroTag",
"ValueType": 2,
"Type": 1089
}
},
{
"ID": 1490,
"Methods": {
"ENUM": 5,
"NAME": "BidCos-RF.NEQ1478013:1.STATE",
"ValueType": 16,
"Type": 393281
}
},
{
"ID": 950,
"Methods": {
"ENUM": 27,
"NAME": "CCU_BOOT",
"ValueType": 2,
"Type": 1089
}
},
{
"ID": 4079,
"Methods": {
"ENUM": 27,
"NAME": "EN_HeizAnbau",
"ValueType": 2,
"Type": 1089
}
},
{
"ID": 7468,
"Methods": {
"ENUM": 5,
"NAME": "HmIP-RF.001A58A9A2801C:6.ON_TIME",
"ValueType": 4,
"Type": 393281
}
},
{
"ID": 6074,
"Methods": {
"ENUM": 27,
"NAME": "Alarmzone 2",
"ValueType": 2,
"Type": 2113
}
},
{
"ID": 4037,
"Methods": {
"ENUM": 27,
"NAME": "SHOP.AnwahlShopZu",
"ValueType": 2,
"Type": 1089
}
},
{
"ID": 8291,
"Methods": {
"ENUM": 27,
"NAME": "zzz",
"ValueType": 2,
"Type": 1089
}
}
],
"Program": {
"Name": "Demo",
"PrgInfo": "DemoTest",
"Enabled": true,
"Visible": true,
"Internal": false
},
"Zeitmodule": [
{
"ID": 9419,
"Methods": {
"TimerType": 9,
"Time": 1167679020,
"CalDuration": 1800,
"CalRepeatTime": 0,
"Weekdays": 0,
"Period": 0,
"Begin": 1553036400,
"End": 0,
"CalRepetitionCount": 0,
"SunOffsetType": 0
}
}
]
}
Das datenformat, welches auch noch erweitert werden kann, wenns sich als notwendig herausstellen sollte, bildet ein Programm komplett ab inkl Scritpe, verwendeter Datenpunkte und Zeitmodule.
Auf Wunsch meines Alpha0 testers werd ich auch die möglichkeit vorsehen, den JSON String zu exportieren und zu speichern, ebenso zu importieren.
Nu kommt der letzte Step, dieses in freepascal über meine geschriebene JSON Class in ein programm zu wandeln, welches auf der CCU dann ein programm gemäß des JSON erzeugt. Da aber die Methoden schon in dem JSON definiert sind... ^^ ist es jetzt noch tipparbeit.