外观
lib-knx 库参考
原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793586902/FIN+5.3.1+lib-knx 中文整理基于 FIN 5.3.1
导读: KNX 连接器扩展
以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。
目录(导读)
- lib
- meta
- docs
- tags
- funcs
- def
- finAddEditKnxConnCommit(id, knxProjInput, disInput, hostInput, localAddrInput, knxRadio)
- supertypes
- src
- finFormAddEditKnxConn(addEdit: true, id: null, refill: null)
- finFormConfirmKnxProj(target, sources)
- finFormKnxProjError(title, errMsg, retryAction)
- finFormReplaceKnxProj(orig)
- finFormReplaceKnxProjCommit(orig, fileRef)
- finFormSelectKnxConnEdit()
- finFormUnlockKnxProj(knxProjRef, reopened: 0)
- finFormUnlockKnxProjCommit(knxProjRef, secret)
- finFormUploadKnxProj()
- finFormUploadKnxProjCommit(fileRef)
- finRemoveStaleLockedKnxProj(fileRef, isTask: false, staleTime: 30min)
- knxDeleteProjectFiles(files)
- knxDeviceStatus(conn, router: null, timeout: null)
- knxDevices(conn)
- knxDpEditForm(connId, dpAddrs)
- knxEnableCustomEncoding(enable: true)
- knxFindProjectFiles()
- knxFormAddEditCustomUnit(oldKey: null, newKey)
- knxFormAddEditExistingUnit(oldKey: null, newKey)
- knxFormAddEditUnit(key: null)
- knxFormDeleteUnit(keys: null)
- knxFormImportExportCustomUnitFile(export: false)
- knxFormNote()
- knxGetDataTypes(connId, level, id: null)
- knxGetQuantities()
- knxImportUnits(recId)
- knxLearn(conn, arg)
- knxPing(conn)
- knxProjectIsLocked(knxProjFileRef)
- knxReadUnits(inclDef)
- knxReplaceProjectFile(original, replacement, hasPassword: false)
- knxSyncCur(points)
- knxUpdateDataPoints(connId, fileUri, points)
- knxUpdateIndividualAddress(conn, addr)
- knxUploadProject(knxProjFileRef, secret: "")
- knxWatchdogDisable(conn)
- knxWatchdogEnable(conn, freq: null, batchSize: null, routerAware: true)
- knxWatchdogStatus(conn)
- knxWriteUnits(units)
概述(中译)
KNX 连接器扩展
API 正文(英文)
docs
Overview • Supported Protocols • Setup • knxproj Files • Connectors • Learning • Reading and writing • Funcs
tags
| knxAddr | The KNX Group Address used on a particular KnxConn |
| knxConn | Marker tag for the KNX connector record which stores the connectivity configuration used to access a KNX access point |
| knxConnRef | Assocation with knxConn |
| knxCur | Uri to use for current value subscriptions |
| knxDevice | Marker tag on records that represent a physical KNX device |
| knxIndividualAddr | The KNX individual address of a physical device record (e.g |
| knxProjFileRef | A reference to the *knxproj file attached to a given KnxConn |
| knxRouter | When present on a knxConn, the watchdog will ping router devices (detected from the ETS project file) first and skip bus device checks if the router is unreachable |
| knxWatchdogEnabled | Enable periodic KNX device connectivity watchdog polling |
| knxWatchdogFreq | KNX watchdog polling interval |
| knxWrite | Stores the Uri to be used when writing to the datapoint |
funcs
| finAddEditKnxConnCommit | Axon function |
| finFormAddEditKnxConn | Axon function |
| finFormConfirmKnxProj | Axon function |
| finFormKnxProjError | Axon function |
| finFormReplaceKnxProj | Axon function |
| finFormReplaceKnxProjCommit | Axon function |
| finFormSelectKnxConnEdit | Axon function |
| finFormUnlockKnxProj | Axon function |
| finFormUnlockKnxProjCommit | Axon function |
| finFormUploadKnxProj | Axon function |
| finFormUploadKnxProjCommit | Axon function |
| finRemoveStaleLockedKnxProj | Axon function |
| knxDeleteProjectFiles | |
| knxDeviceStatus | NOTE |
| knxDevices | Return a grid of all KNX devices found in the ETS project file for the given connector |
| knxDpEditForm | Launches the data point edit form |
| knxEnableCustomEncoding | Method to configure encoding if KNX project import fail Parameters - enable |
| knxFindProjectFiles | |
| knxFormAddEditCustomUnit | Axon function |
| knxFormAddEditExistingUnit | Axon function |
| knxFormAddEditUnit | Axon function |
| knxFormDeleteUnit | Axon function |
| knxFormImportExportCustomUnitFile | Axon function |
| knxFormNote | Axon function |
| knxGetDataTypes | Retrieve the possible data types for the data point edit form's data type selectors |
| knxGetQuantities | |
| knxImportUnits | |
| knxLearn | Perform a synchronous learn read on the given connector |
| knxPing | Perform an async ping on the given connector |
| knxProjectIsLocked | |
| knxReadUnits | |
| knxReplaceProjectFile | |
| knxSyncCur | Asynchronously synchronize current values for given list of proxy points |
| knxUpdateDataPoints | Receives the updated values from the data point edit form |
| knxUpdateIndividualAddress | Method to configure KNX individual address Parameters - conn |
| knxUploadProject | |
| knxWatchdogDisable | Disable the KNX watchdog for the given connector |
| knxWatchdogEnable | Enable or configure the KNX watchdog for the given connector |
| knxWatchdogStatus | Return a grid showing the cached watchdog connectivity status for all KNX devices |
| knxWriteUnits | Write units |
lib knx
**************************************************************************
** title: KnxExt
** author: Ionut Enescu
** created: 20 Aug 20
** copyright: Copyright (c) 2020, J2 Innovations
**************************************************************************
Overview [#overview]
********************
The [KnxExt]`KnxExt::index` pod implements connector support for the KNX protocol.
It follows the standard connector model:
- Connectors: used to configure a JKNXC connection to a KNX access point (typically an IP interface)
- Functions: provide access to read/write/learn from within your Axon scripts
Supported Protocols [#support]
******************************
Currently KnxExt supports the KNXNet/IP version of the KNX protocol. Reading and writing is supported via tunneling only.
Setup [#setup]
**************
FIN leverages the JKNXC infrastructure for using various KNX Java drivers. The JKNXC interface is implemented by all FIN JKNXC drivers, therefore anyone who needs any customized driver can simply implement the JKNXC interface.
For setup:
1. Ensure your JKNXC interface (jknxc.jar) and your JKNXC driver(jknxc-xxx.jar) is installed and available via the system class path. The best place to stick it is in the "jre/lib/ext" directory.
jknxc.jar and jknxc-xxx.jar are Java based: lib/java/ext/. In the case of jknxc-calimero driver, the following dependencies should also be present in the same location: calimero-core-2.4.jar and slf4j-api-1.8.0-beta4.jar.
TODO: revisit the above when jknxc.jar will be ecapsulated into knx.pod
2. Ensure that both knxExt.pod and knx.pod are present in lib/fan/
3. Make sure the KnxExt is enabled (FIN Advanced Apps -> Settings App -> Ext -> Knx)
knxproj Files [#knxproj]
**************************
The startup point to any KNX configuration is defining the KNX topology of one or several installations using the ETS tool, which can be downloaded from the KNX Association website (www.knx.org).
Importing [#import]
============================
After creating and configuring a KNX project you will have a *.knxproj file that you can import into FIN. To upload a *.knxproj file into a FIN project, go to FIN System Integrator Apps -> DB Builder -> Connectors -> Knx -> Projects, click on the Upload button and select your *knxproj file. In the same view you have the options of Replace-ing and Delete-ing an uploaded *knxproj file. When you upload a *knxproj file into a FIN project, that file is available for all Knx connectors you create under that FIN project.
Connectors [#connectors]
************************
There are two things you need to provide in order to create a KNX connector: the KNX Project exported from the ETS tool and the connector URI. Once you have at least one knxproj file uploaded into the FIN project, you can go ahead and create a KNX connector. The connector URI has the following format: knx-[driver]://[IP]:[port]/, where:
- driver – default is `calimero`, but you can have your own customized JKNXC driver
- IP – the IP address of the KNX interface/gateway device you use to access the KNX network
- port - default for KNX is 3671, but you can pick your own
The FIN Knx connector URI also has an enhanced version where a KNX Group Address can be appended it, i.e. knx-calimero://192.168.1.100:3671/2/0/3. Additionally, the appended group address can have wildcards, like 2/1/* or 1/*/5, which would allow for similar/identical functionalities to operate on a batch of group addresses instead of a single one.
You can test out your connector using the knxPing Axon function:
read(knxConn).knxPing
or by using the connector UI under the Equip Tree accessible from the DB Builder app.
Learning [#learning]
********************
From the KnxConn view, you can discover the data points from the chosen *knxproj. Before learning a data point as a point in FIN, you have the ability to first edit its definition in the knxproj file by using the Edit Datapoint button in the point discovery interface. This can be used for datapoints that don’t originally come with a data point type assigned from the knxproj, to configure if they are readable and/or writable or if we need to change some of the point information before adding it to the equip. Once you've done that, you can select the points you want to add into the Equip Tree by clicking Add/Add all or drag and drop the point(s) under an equip. Note: when you edit a data point the changes you make are made on the imported knxproj file, therefore all other KnxConns using that *knxproj file will be impacted.
Besides the FIN Discover view, learning can calso be done using the KnxLearn Axon function as following:
read(knxConn).knxLearn
which returns a Grid of all discovered data points on that KnxConn.
Translation to FIN [#translation]
=================================
The Learning and Edit Datapoint views offer a great deal of flexibility in order to translate KNX data point types into Haystack types efficiently. For example, in the case of a DateTime DPT, KnxExt offers the possibility of selecting individual bits of the DPT, such month, minutes, day of the week.
Specifying the DPT [#dpt]
-------------------------
You can specify the data point type in the following formats:
- 1.009 (close/open encoding)
- DPST-1-9 (close/open encoding)
- DPT-1 (generic boolean, no subtype)
- DPST-4-1[0] (retrieves the increase/decrease encoding bit of the generic DPST-4-1 data point type, which is an 8-bit encoding)
- 4 or 4-xxx (generic DPST-4-xxx type)
- 4.001 (DPT subtype)
- 4.009.0 (first part of the DPST-4-9 DPT)
Units [#units]
--------------
Units translation from KNX to Haystack is done via the units.props file found under /etc/sys/. In case your *.knxproj file defines a non-standard KNX unit, you can add it to the units.props file or change an already existing binding in that file. A FIN restart is required after altering this file.
Reading and writing [#rw]
*************************
Reading and writing on KNX can be performed on the same group address or on dedicated group addresses independently. For example, reading a batch of switches/binary outputs is done with the 1/1/* group addresses, while writing to these channels is performed with the 1/0/* group addresses, or they both reading and writing can be performed on the same group address.
Funcs [#funcs]
**************
The following Axon funcs can be used to interface with the KnxExt:
- `knxPing` : performs an async ping on a given connector.
- `knxSyncCur`: asynchronously synchronize current values for given list of proxy points.
- `knxLearn` : synchronous learn read on the given connector.
- `knxFindProjectFiles`: searches for knxproj files in the following places: /var/proj/[proj_name]/io, /var/proj/[proj_name]/data/knx, inside the pods(uploads what it finds into FIN and tags it as knxProjFile), file records with knxProjFile tag
- `knxDeleteProjectFiles`: deletes knxproj files from the FIN project
- `knxReplaceProjectFile`: replaces knxproj files from the FIN project
- `knxUpdateDataPoints`: writes changes performed on data points back to the knxproj used on a KnxConn
- `knxGetDataPoint`: returns data for a specific data point
- `knxGetDataTypes`: returns the data point types found in the knx_master.xml which is bundled in the *knxproj file assigned to a KnxConndef
func:finAddEditKnxConnCommit
finAddEditKnxConnCommit(id, knxProjInput, disInput, hostInput, localAddrInput, knxRadio)
Axon function
meta
| def | func:finAddEditKnxConnCommit |
| is | func |
| lib | lib:knx |
| name | finAddEditKnxConnCommit |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, knxProjInput, disInput, hostInput, localAddrInput, knxRadio) => do
hostRegEx: "^[a-zA-Z0-9]([a-zA-Z0-9\\-\\.]*[a-zA-Z0-9])?(:[0-9]+)?\$"
if(hostInput.isEmpty or reFind(hostRegEx, hostInput) == null)
return finFormAddEditKnxConn(id == null, id, {
dis: disInput,
host: hostInput,
localAddr: localAddrInput,
knxRadio: knxRadio,
errMsg: toLocale("knxExt::knxInvalidHost")
})
localAddrRegEx: "^[a-zA-Z0-9]([a-zA-Z0-9\\-\\.]*[a-zA-Z0-9])?\$"
if(not localAddrInput.isEmpty and reFind(localAddrRegEx, localAddrInput) == null)
return finFormAddEditKnxConn(id == null, id, {
dis: disInput,
host: hostInput,
localAddr: localAddrInput,
knxRadio: knxRadio,
errMsg: toLocale("knxExt::knxInvalidLocalAddr")
})
if(knxRadio == false)
knxRadio = "knx"
uri : knxRadio + "://"
uri = uri + hostInput + "/"
if(not localAddrInput.isEmpty)
uri = uri + "?localAddr=" + localAddrInput
if(isRef(knxProjInput))
dbAddEditCommit(
id,
{
dis: disInput,
knxProjFileRef:
if(knxProjInput == @null)
removeMarker()
else
knxProjInput,
-knxProjFile,
uri: parseUri(uri),
knxConn,
conn
}
)
else
dbAddEditCommit(
id,
{
dis: disInput,
knxProjFile: parseUri(knxProjInput),
-knxProjFileRef,
uri: parseUri(uri),
knxConn,
conn
}
)
enddef
func:finFormAddEditKnxConn
finFormAddEditKnxConn(addEdit: true, id: null, refill: null)
Axon function
meta
| def | func:finFormAddEditKnxConn |
| is | func |
| lib | lib:knx |
| name | finFormAddEditKnxConn |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(addEdit: true, id: null, refill: null) => do
dis: "KNX Conn"
defIndex: 0
uri: ""
host: "0.0.0.0"
localAddr: ""
schema: "knx"
projs: try knxFindProjectFiles().sort("name") catch [].toGrid
knxRadios: [
{name: "knxRadio", editorType: "radio", label: "Routing", group: "knxSchema", selectedValue: "knx-routing", encapsulate: true},
{name: "knxRadio", editorType: "radio", label: "Tunneling", group: "knxSchema", selectedValue: "knx-tunneling", encapsulate: true}
]
if(not addEdit) do
rec: readById(id)
dis = rec->dis
uri = rec->uri.toStr
uriSplit: try uri.split("/") catch ""
schema = uriSplit[0].split(":")[0].toStr
host = uriSplit[2].toStr
localAddr = uriSplit[3].toStr.replace("?localAddr=", "")
refs: try projs.colToList("val").insert(0, null) catch []
file: if(rec.has("knxProjFile")) rec["knxProjFile"] else rec["knxProjFileRef"]
defIndex = refs.index(file)
if(defIndex == null) defIndex = 0
knxRadios = knxRadios.map(r => if(r->selectedValue == schema) r.set("defVal", true) else r)
end
if(refill != null) do
dis = refill->dis
host = refill->host
localAddr = refill->localAddr
if(refill.has("knxRadio") and refill->knxRadio != false)
knxRadios = knxRadios.map(r => if(r->selectedValue == refill->knxRadio) r.set("defVal", true) else r)
end
body: []
if(refill != null)
body = body.add({name: "errMsg", editorType: "label", text: refill->errMsg})
body = body.addAll([
{name: "disInput", editorType: "textinput", prompt: "Dis:", defVal: dis},
{name: "knxProjInput", editorType: "combobox", prompt: toLocale("knxExt::knxProj"), dataProvider: projs.toRecList.map(x=> x).insert(0, {name: "None", type: "none", val: @null}).toAxonCode, labelField: "name", selectedValueTags: "val", defIndex: defIndex},
{name: "hostInput", editorType: "textinput", prompt: "Host:", defVal: host},
{
name: "knxGroup",
editorType: "group",
horizontal,
children: [
{name: "knxLabel", editorType: "label", text: "Schema", width: 150}
].addAll(knxRadios)
},
{name: "localAddrInput", editorType: "textinput", prompt: "Local address:", defVal: localAddr},
{name: "cancelButton", editorType: "button", label: toLocale("knxExt::knxCancel"), controlBar: true},
{name: "commitButton", editorType: "button", label: if(addEdit) toLocale("knxExt::knxAdd") else toLocale("knxExt::knxEdit"), controlBar: true}
])
{
"dis": (if(addEdit) toLocale("knxExt::knxAdd") else toLocale("knxExt::knxEdit")) + " KnxConn",
"name": "finFormAddEditKnxConn" + (if(refill != null) random(0..1000).toStr else ""),
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$commitButton",
"commitAction": "finAddEditKnxConnCommit(" + id.toAxonCode + ", \$knxProjInput, \$disInput, \$hostInput, \$localAddrInput, \$knxRadio)",
"completeAction": "window.app.RefreshBuilderTreeNodeForId('@folderPath:knxConn:'); window.app.RefreshBuilderGridAt(0, 'panel')",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finFormConfirmKnxProj
finFormConfirmKnxProj(target, sources)
Axon function
meta
| def | func:finFormConfirmKnxProj |
| is | func |
| lib | lib:knx |
| name | finFormConfirmKnxProj |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(target, sources) => do
source: sources[0] //{name:KNX_Building_A, type:data, val:data/knx/KNX_Building_A.knxproj}
rec: target.toRec
body: [
{name: "labelOne", editorType: "label", text: toLocale("knxExt::knxDoYouWantToChange") + rec.dis + toLocale("knxExt::knxSProject") + source->name + "?"},
{name: "cancelButton", editorType: "button", label: toLocale("knxExt::knxNo"), controlBar: true},
{name: "commitButton", editorType: "button", label: toLocale("knxExt::knxYes"), controlBar: true}
]
comm: "knxProjFile: `" + source->val + "`, -knxProjFileRef"
if(source->type == "bin")
comm = "knxProjFileRef: " + source->val->val + ", -knxProjFile"
{
"dis": toLocale("knxExt::knxConfirmProjOverwrite"),
"name": "finFormConfirmKnxProj",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$commitButton",
"commitAction": "dbAddEditCommit(" + target.toAxonCode + ", {" + comm + "}, \"\")",
"completeAction": "window.app.RefreshBuilderTreeNodeForId('@folderPath:knxConn:'); window.app.RefreshBuilderGridAt(0, 'panel')",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finFormKnxProjError
finFormKnxProjError(title, errMsg, retryAction)
Axon function
meta
| def | func:finFormKnxProjError |
| is | func |
| lib | lib:knx |
| name | finFormKnxProjError |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(title, errMsg, retryAction) => do
body: [
{name: "labelOne", editorType: "label", text: errMsg},
{name: "commitButton", editorType: "button", label: toLocale("knxExt::knxOkay"), controlBar: true}
]
{
"dis": title,
"name": "finFormKnxProjError",
"body": body.toJSON,
"cancelButton": null,
"commitButton": "\$commitButton",
"commitAction": retryAction,
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finFormReplaceKnxProj
finFormReplaceKnxProj(orig)
Axon function
meta
| def | func:finFormReplaceKnxProj |
| is | func |
| lib | lib:knx |
| name | finFormReplaceKnxProj |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(orig) => do
if(orig->type != "io" and orig->type != "data" and orig->type != "bin")
return finFormAlertOk(toLocale("knxExt::knxErr"), toLocale("knxExt::knxReplacementOnlyWorks"))
body: [
{name: "fileOne", editorType: "file", prompt: toLocale("knxExt::knxSelectProjReplacement"), fileTypes: ["knxproj"], tags: {tempKnxProjFile: marker()}},
{name: "cancelButton", editorType: "button", label: toLocale("knxExt::knxCancel"), controlBar: true},
{name: "commitButton", editorType: "button", label: toLocale("knxExt::knxUpload"), controlBar: true}
]
{
"dis": toLocale("knxExt::knxReplaceProj"),
"name": "finFormReplaceKnxProj",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$commitButton",
"commitAction": "finFormReplaceKnxProjCommit(" + orig.toAxonCode + ", \$fileOne)",
"completeAction": "window.app.RefreshBuilderGridAt(0, 'panel')",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finFormReplaceKnxProjCommit
finFormReplaceKnxProjCommit(orig, fileRef)
Axon function
meta
| def | func:finFormReplaceKnxProjCommit |
| is | func |
| lib | lib:knx |
| name | finFormReplaceKnxProjCommit |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(orig, fileRef) => do
try do
isLocked: knxProjectIsLocked(fileRef)
if (isLocked) do
if (read(ext == "task", false) != null)
taskRun((msg) => finRemoveStaleLockedKnxProj(msg, true), fileRef)
else
eval("jobRun(finRemoveStaleLockedKnxProj(" + fileRef.toAxonCode + "))")
end
knxReplaceProjectFile(orig, readById(fileRef), isLocked)
end catch (err) do
return finFormKnxProjError(toLocale("knxExt::knxReplaceProj"), err.dis, "finFormReplaceKnxProj(" + orig.toAxonCode + ")")
end
enddef
func:finFormSelectKnxConnEdit
finFormSelectKnxConnEdit()
Axon function
meta
| def | func:finFormSelectKnxConnEdit |
| is | func |
| lib | lib:knx |
| name | finFormSelectKnxConnEdit |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
() => do
body: [
{name: "comboOne", editorType: "combobox", prompt: toLocale("knxExt::knxSelectConnEdit"), dataProvider: "readAll(knxConn)", labelField: "dis", selectedValueTags: "id", defIndex: 0},
{name: "cancelButton", editorType: "button", label: toLocale("knxExt::knxCancel"), controlBar: true},
{name: "commitButton", editorType: "button", label: toLocale("knxExt::knxEdit"), controlBar: true}
]
{
"dis": (toLocale("knxExt::knxEdit") + "KnxConn"),
"name": "finFormSelectKnxConnEdit",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$commitButton",
"commitAction": "finFormAddEditKnxConn(false, \$comboOne)",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finFormUnlockKnxProj
finFormUnlockKnxProj(knxProjRef, reopened: 0)
Axon function
meta
| def | func:finFormUnlockKnxProj |
| is | func |
| lib | lib:knx |
| name | finFormUnlockKnxProj |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(knxProjRef, reopened: 0) => do
formName:"finFormUnlockKnxProj"
body: [
{name: "password", editorType: "textinput", prompt: toLocale("knxExt::knxProjectPassword"), password: true, defVal: ""},
{name: "cancelButton", editorType: "button", label: toLocale("knxExt::knxCancel"), controlBar: true},
{name: "commitButton", editorType: "button", label: toLocale("knxExt::knxApply"), controlBar: true}
]
if (reopened != 0) do
formName = formName + random(0..1000)
body = body.insert(0, {name: "badPassText", editorType:"label", text: if (reopened == 1) toLocale("knxExt::knxIncorrectPassword") else toLocale("knxExt::knxEnterPassword")})
end
{
"dis": toLocale("knxExt::knxUnlockProj"),
"name": formName,
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$commitButton",
"commitAction": "finFormUnlockKnxProjCommit("+ knxProjRef.toAxonCode +", \$password)",
"completeAction": "window.app.RefreshBuilderGridAt(0, 'panel')",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finFormUnlockKnxProjCommit
finFormUnlockKnxProjCommit(knxProjRef, secret)
Axon function
meta
| def | func:finFormUnlockKnxProjCommit |
| is | func |
| lib | lib:knx |
| name | finFormUnlockKnxProjCommit |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(knxProjRef, secret) => do
if (secret.isEmpty)
return finFormUnlockKnxProj(knxProjRef, 2)
try
knxUploadProject(knxProjRef, secret)
catch (err)
if (err.dis.lower.contains("wrong password"))
finFormUnlockKnxProj(knxProjRef, 1)
else throw err
enddef
func:finFormUploadKnxProj
finFormUploadKnxProj()
Axon function
meta
| def | func:finFormUploadKnxProj |
| is | func |
| lib | lib:knx |
| name | finFormUploadKnxProj |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
() => do
body: [
{name: "fileOne", editorType: "file", prompt: toLocale("knxExt::knxSelectProjUpload"), fileTypes: ["knxproj"], tags: {tempKnxProjFile: marker()}},
{name: "cancelButton", editorType: "button", label: toLocale("knxExt::knxCancel"), controlBar: true},
{name: "commitButton", editorType: "button", label: toLocale("knxExt::knxUpload"), controlBar: true}
]
{
"dis": toLocale("knxExt::knxUploadProj"),
"name": "finFormUploadKnxProj",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$commitButton",
"commitAction": "finFormUploadKnxProjCommit(\$fileOne)",
"completeAction": "window.app.RefreshBuilderGridAt(0, 'panel')",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finFormUploadKnxProjCommit
finFormUploadKnxProjCommit(fileRef)
Axon function
meta
| def | func:finFormUploadKnxProjCommit |
| is | func |
| lib | lib:knx |
| name | finFormUploadKnxProjCommit |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(fileRef) => do
try do
if (knxProjectIsLocked(fileRef)) do
if (read(ext == "task", false) != null)
taskRun((msg) => finRemoveStaleLockedKnxProj(msg, true), fileRef)
else
eval("jobRun(finRemoveStaleLockedKnxProj(" + fileRef.toAxonCode + "))")
return finFormUnlockKnxProj(fileRef, 0)
end
knxUploadProject(fileRef)
end catch (err) do
return finFormKnxProjError(toLocale("knxExt::knxUploadProj"), err.dis, "finFormUploadKnxProj()")
end
enddef
func:finRemoveStaleLockedKnxProj
finRemoveStaleLockedKnxProj(fileRef, isTask: false, staleTime: 30min)
Axon function
meta
| def | func:finRemoveStaleLockedKnxProj |
| is | func |
| lib | lib:knx |
| name | finRemoveStaleLockedKnxProj |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(fileRef, isTask: false, staleTime: 30min) => do
if (isTask) taskSleep(staleTime)
else jobSleep(staleTime)
knxProj: readById(fileRef, false)
if (knxProj != null and knxProj.has("tempKnxProjFile"))
knxProj.diff({}, {remove}).commit
enddef
func:knxDeleteProjectFiles
knxDeleteProjectFiles(files)
meta
| def | func:knxDeleteProjectFiles |
| is | func |
| lib | lib:knx |
| name | knxDeleteProjectFiles |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxDeviceStatus
knxDeviceStatus(conn, router: null, timeout: null)
NOTE: This function is for TEST purposes only. Do NOT use in production. It generates live KNX bus traffic for every device and blocks the calling thread for the full duration. For production use, call knxWatchdogStatus() which reads from the in-memory cache with zero bus traffic.
Check the connectivity status of KNX devices for the given connector. Routers are always pinged first. If a router is unreachable, all its bus devices (same area.line prefix) are marked "unreachable (router down)" without pinging them individually.
When a router individual address is provided, only that router and its bus devices are checked. When no router is specified, ALL routers and ALL bus devices are tested.
Parameters:
- conn: connector reference or id
- router: optional router individual address (e.g. "1.1.0") to filter by line
- timeout: optional ping timeout per device (default 10sec). Examples: 10sec, 30sec
Returns a grid with columns: individualAddr, dis, status, isRouter, checkedAt where status is "ok", "unreachable", or "unreachable (router down)".
Example:
knxDeviceStatus(@myKnxConn) // check all devices, default 10sec timeout
knxDeviceStatus(@myKnxConn, "1.1.0") // check router 1.1.0 and its bus devices
knxDeviceStatus(@myKnxConn, null, 30sec) // all devices, 30sec ping timeout
knxDeviceStatus(@myKnxConn, "1.1.0", 15sec) // router filter with 15sec timeoutmeta
| admin | ✓ |
| def | func:knxDeviceStatus |
| is | func |
| lib | lib:knx |
| name | knxDeviceStatus |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxDevices
knxDevices(conn)
Return a grid of all KNX devices found in the ETS project file for the given connector. Each row contains the device's individual address, display name, description, serial number, product ref, and the resolved group addresses it is bound to. Router devices are included and marked with an isRouter column.
Example:
knxDevices(@myKnxConn)meta
| admin | ✓ |
| def | func:knxDevices |
| is | func |
| lib | lib:knx |
| name | knxDevices |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxDpEditForm
knxDpEditForm(connId, dpAddrs)
Launches the data point edit form
meta
| def | func:knxDpEditForm |
| is | func |
| lib | lib:knx |
| name | knxDpEditForm |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxEnableCustomEncoding
knxEnableCustomEncoding(enable: true)
Method to configure encoding if KNX project import fail Parameters
enable: true - enable custom encoding, false - disable custom encoding
Example:
knxEnableCustomEncoding(true)
meta
| admin | ✓ |
| def | func:knxEnableCustomEncoding |
| is | func |
| lib | lib:knx |
| name | knxEnableCustomEncoding |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxFindProjectFiles
knxFindProjectFiles()
meta
| def | func:knxFindProjectFiles |
| is | func |
| lib | lib:knx |
| name | knxFindProjectFiles |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxFormAddEditCustomUnit
knxFormAddEditCustomUnit(oldKey: null, newKey)
Axon function
meta
| def | func:knxFormAddEditCustomUnit |
| is | func |
| lib | lib:knx |
| name | knxFormAddEditCustomUnit |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(oldKey: null, newKey) => do
names: ""
scale: ""
offset: ""
isEdit: oldKey != null
quantityIndex: 0
body: []
quantityProvider: knxGetQuantities()
commitStr: "knxWriteUnits(knxReadUnits(false).addRow({key:" + newKey.toAxonCode +", names: \$namesInput, quantity: \$comboQuantity, scale: \"\$scaleInput\", offset: \"\$offsetInput\"}))"
if (oldKey != null) do
curVal : knxReadUnits(true).find(x=>x->key == oldKey)
isNewKey: oldKey != newKey
if (knxReadUnits(false).find(x=>x->key==oldKey) != null)
commitStr = "knxWriteUnits(knxReadUnits(false).map(x => if (x->key == " + oldKey.toAxonCode +") {key:" + newKey.toAxonCode +", names: \$namesInput, quantity: \$comboQuantity, scale: \"\$scaleInput\", offset: \"\$offsetInput\"} else x))"
if (curVal.has("names")) do
names = curVal->names
end
if (curVal.has("quantity")) do
quantityProvider.each((v,i) =>
if (v == curVal->quantity)
quantityIndex = i
)
end
if (curVal.has("scale"))
scale = curVal->scale
if (curVal.has("offset"))
offset = curVal->offset
body = body.add({name: "labelKey", editorType: "label", prompt: toLocale("knxExt::knxKey") + ":", text: if(isNewKey) oldKey else newKey})
if (isNewKey) do
body = body.add({name: "labelNewKey", editorType: "label", prompt: toLocale("knxExt::knxNewKey") + ":", text: newKey})
end
end
body = body.addAll([
{name: "namesInput", editorType: "textinput", prompt: toLocale("knxExt::knxNames") + ":", defVal: names},
{name: "comboQuantity", editorType: "combobox", prompt: toLocale("knxExt::knxQuantity") + ":", dataProvider: quantityProvider.toAxonCode, labelField: "val", selectedValueTags: "val", defIndex: quantityIndex},
{name: "scaleInput", editorType: "numericstepper", prompt: toLocale("knxExt::knxScale") + ":", defVal: scale},
{name: "offsetInput", editorType: "numericstepper", prompt: toLocale("knxExt::knxOffset") + ":", defVal: offset},
{name: "cancelButton", editorType: "button", label: toLocale("knxExt::knxCancel"), controlBar: true},
{name: "commitButton", editorType: "button", label: if(oldKey == null) toLocale("knxExt::knxAdd") else toLocale("knxExt::knxApply"), controlBar: true}
])
{
"dis": (if (oldKey == null) toLocale("knxExt::knxAddUnitBindingCustomUnit") else toLocale("knxExt::knxEditUnitBindingCustomUnit")),
"name": "knxFormAddEditCustomUnit",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$commitButton",
"commitAction": "knxFormNote(" + commitStr + ")",
"completeAction": "window.app.RefreshBuilderGridAt(0, 'panel')",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:knxFormAddEditExistingUnit
knxFormAddEditExistingUnit(oldKey: null, newKey)
Axon function
meta
| def | func:knxFormAddEditExistingUnit |
| is | func |
| lib | lib:knx |
| name | knxFormAddEditExistingUnit |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(oldKey: null, newKey) => do
isEdit: oldKey != null
quantityIndex: 0
symbolIndex: 0
body: []
quantityProvider: unitdb().colToList("quantity").unique
commitStr: "knxWriteUnits(knxReadUnits(false).addRow({key:" + newKey.toAxonCode +", names: \$comboSymbol}))"
if (oldKey != null) do
curVal : knxReadUnits(true).find(x=>x->key == oldKey)
isNewKey: oldKey != newKey
if (knxReadUnits(false).find(x=>x->key==oldKey) != null)
commitStr = "knxWriteUnits(knxReadUnits(false).map(x => if (x->key == " + oldKey.toAxonCode +") {key:" + newKey.toAxonCode +", names: \$comboSymbol} else x))"
if (curVal.has("names") and curVal->names != "" and curVal->names.toStr.split(",").size == 1) do
unit: unitdb().find(x=>x->symbol == curVal->names)
if (unit != null) do
quantityProvider.each((v,i) =>
if (v == unit->quantity)
quantityIndex = i
)
unitdb().findAll(x=>x->quantity == unit->quantity).colToList("symbol").each((v,i) =>
if (v == unit->symbol)
symbolIndex = i
)
end
else do
quantityProvider.each((v,i) =>
if (v == curVal->quantity)
quantityIndex = i
)
end
end
else if (curVal.has("quantity")) do
quantityProvider.each((v,i) =>
if (v == curVal->quantity)
quantityIndex = i
)
end
body = body.add({name: "labelKey", editorType: "label", prompt: toLocale("knxExt::knxKey") + ":", text: if(isNewKey) oldKey else newKey})
if (isNewKey) do
body = body.add({name: "labelNewKey", editorType: "label", prompt: toLocale("knxExt::knxNewKey") + ":", text: newKey})
end
end
body = body.addAll([
{name: "comboQuantity", editorType: "combobox", prompt: toLocale("knxExt::knxQuantity") + ":", dataProvider: quantityProvider.toAxonCode, labelField: "val", selectedValueTags: "val", defIndex: quantityIndex},
{name: "comboSymbol", editorType: "combobox", prompt: toLocale("knxExt::knxSymbol") + ":", dataProvider: "unitdb().findAll(x=>x->quantity == \$comboQuantity).colToList(" + "symbol".toAxonCode +")", labelField: "val", selectedValueTags: "val", defIndex: symbolIndex},
{name: "cancelButton", editorType: "button", label: toLocale("knxExt::knxCancel"), controlBar: true},
{name: "commitButton", editorType: "button", label: if(oldKey == null) toLocale("knxExt::knxAdd") else toLocale("knxExt::knxApply"), controlBar: true}
])
{
"dis": if (oldKey == null) toLocale("knxExt::knxAddUnitBindingExistingUnit") else toLocale("knxExt::knxEditUnitBindingExistingUnit"),
"name": "knxFormAddEditExistingUnit",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$commitButton",
"commitAction": "knxFormNote(" + commitStr + ")",
"completeAction": "window.app.RefreshBuilderGridAt(0, 'panel')",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:knxFormAddEditUnit
knxFormAddEditUnit(key: null)
Axon function
meta
| def | func:knxFormAddEditUnit |
| is | func |
| lib | lib:knx |
| name | knxFormAddEditUnit |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(key:null) => do
radioDefault: 1
if (key != null) do
curVal : knxReadUnits(true).find(x=>x->key == key)
if (unitdb().find(x=>x->symbol == curVal->names) == null)
radioDefault = 2
end
body: [
{name: "textKey", editorType: "textinput", prompt: toLocale("knxExt::knxKey")+":", defVal: key},
{name: "existingRadio", editorType: "radio", prompt: "Select Type Unit", label: toLocale("knxExt::knxExistingUnit"), group: "group1", selectedValue: 1, defVal: if (radioDefault == 1) true else null},
{name: "existingRadio", editorType: "radio", label: toLocale("knxExt::knxCustomUnit"), group: "group1", selectedValue: 2, defVal: if (radioDefault == 2) true else null},
{name: "cancelButton", editorType: "button", label: toLocale("knxExt::knxCancel"), controlBar: true},
{name: "commitButton", editorType: "button", label: toLocale("knxExt::knxNext"), controlBar: true}
]
{
"dis": if (key == null) toLocale("knxExt::knxAddUnitBinding") else toLocale("knxExt::knxEditUnitBinding"),
"name": "knxFormAddEditUnit",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$commitButton",
"commitAction": "if (\$existingRadio == 1.toStr) knxFormAddEditExistingUnit("+ key.toAxonCode + ", \$textKey) else knxFormAddEditCustomUnit("+ key.toAxonCode + ", \$textKey)",
"completeAction": "window.app.RefreshBuilderGridAt(0, 'panel')",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:knxFormDeleteUnit
knxFormDeleteUnit(keys: null)
Axon function
meta
| def | func:knxFormDeleteUnit |
| is | func |
| lib | lib:knx |
| name | knxFormDeleteUnit |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(keys:null) => do
body: [
{name: "labelOne", editorType: "label", text: toLocale("knxExt::knxSureToDelete") + " " + keys.concat(", ") + " ?"},
{name: "cancelButton", editorType: "button", label: toLocale("knxExt::knxCancel"), controlBar: true},
{name: "commitButton", editorType: "button", label: toLocale("knxExt::knxDelete"), controlBar: true}
]
{
"dis": toLocale("knxExt::knxDeleteUnit"),
"name": "knxFormDeleteUnit",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$commitButton",
"commitAction": "knxFormNote(knxWriteUnits(knxReadUnits(false).map(unit=>if ("+keys.toAxonCode+".contains(unit->key).equals(false))unit)))",
"completeAction": "window.app.RefreshBuilderGridAt(0, 'panel')",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:knxFormImportExportCustomUnitFile
knxFormImportExportCustomUnitFile(export: false)
Axon function
meta
| def | func:knxFormImportExportCustomUnitFile |
| is | func |
| lib | lib:knx |
| name | knxFormImportExportCustomUnitFile |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(export:false) => do
body: []
commitStr: null
complete: "window.app.RefreshBuilderGridAt(0, 'panel')"
if(export == false) do
body = body.addAll([
{name: "label", editorType: "label", text: toLocale("knxExt::knxWarningOverwriteCustomUnits")},
{name: "fileOne", editorType: "file", prompt: toLocale("knxExt::kxnSelectCustonUnitUpload"), fileTypes: ["props"], tags: {customUnitFile: marker()}}
])
commitStr = "knxImportUnits(\$fileOne)"
end else do
body = body.add({name: "label", editorType: "label", text: toLocale("knxExt::knxSureToDownload")})
complete = "window.open((finstack.pathPrefix || '')+'/api/"+context()->projName+"/ext/knx/customUnits.props','_blank')"
end
body = body.addAll([
{name: "cancelButton", editorType: "button", label: toLocale("knxExt::knxCancel"), controlBar: true},
{name: "commitButton", editorType: "button", label: if(export == false) toLocale("knxExt::knxUpload") else toLocale("knxExt::knxDownload"), controlBar: true}
])
{
"dis": (if (export == false) toLocale("knxExt::knxImportCustomUnitFile") else toLocale("knxExt::knxExportCustomUnitFile")),
"name": "knxFormImportExportCustomUnitFile",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$commitButton",
"commitAction": (if (export == false) "knxFormNote(" + commitStr + ")" else null),
"completeAction": complete,
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:knxFormNote
knxFormNote()
Axon function
meta
| def | func:knxFormNote |
| is | func |
| lib | lib:knx |
| name | knxFormNote |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
() => do
body: [
{name: "labelOne", editorType: "label", text: toLocale("knxExt::knxNoteChangeRequireSystemRestart")},
{name: "commitButton", editorType: "button", label: toLocale("knxExt::knxOkay"), controlBar: true}
]
{
"dis": " ",
"name": "knxFormNote",
"body": body.toJSON,
"cancelButton": null,
"commitButton": "\$commitButton",
"commitAction": null,
"completeAction": "window.app.RefreshBuilderGridAt(0, 'panel')",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:knxGetDataTypes
knxGetDataTypes(connId, level, id: null)
Retrieve the possible data types for the data point edit form's data type selectors
meta
| def | func:knxGetDataTypes |
| is | func |
| lib | lib:knx |
| name | knxGetDataTypes |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxGetQuantities
knxGetQuantities()
meta
| def | func:knxGetQuantities |
| is | func |
| lib | lib:knx |
| name | knxGetQuantities |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxImportUnits
knxImportUnits(recId)
meta
| def | func:knxImportUnits |
| is | func |
| lib | lib:knx |
| name | knxImportUnits |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxLearn
knxLearn(conn, arg)
Perform a synchronous learn read on the given connector. Following columns are returned:
dis: display name of pointkind: point kindmodbusCur: address to map to pointmodbusWrite: address if applicable to map to writable pointpoint: point markerunit: unit if defined
meta
| admin | ✓ |
| def | func:knxLearn |
| is | func |
| lib | lib:knx |
| name | knxLearn |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxPing
knxPing(conn)
Perform an async ping on the given connector. If there is not an open connector, then this call first opens a new connection, verifies it can read a register, and then closes the connection. The following tags are updated:
curStatus: ok if successful, down or fault is notcurErr: error message on failure
meta
| admin | ✓ |
| def | func:knxPing |
| is | func |
| lib | lib:knx |
| name | knxPing |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxProjectIsLocked
knxProjectIsLocked(knxProjFileRef)
meta
| def | func:knxProjectIsLocked |
| is | func |
| lib | lib:knx |
| name | knxProjectIsLocked |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxReadUnits
knxReadUnits(inclDef)
meta
| def | func:knxReadUnits |
| is | func |
| lib | lib:knx |
| name | knxReadUnits |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxReplaceProjectFile
knxReplaceProjectFile(original, replacement, hasPassword: false)
meta
| def | func:knxReplaceProjectFile |
| is | func |
| lib | lib:knx |
| name | knxReplaceProjectFile |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxSyncCur
knxSyncCur(points)
Asynchronously synchronize current values for given list of proxy points. The point list may be any value supported by <toRecs>. The points must have the following tags configured:
modbusConnRefmodbusCur
This call updates the following point tags:
curVal: current value of the pointcurStatus: status of the point (down/fault on failure)curErr: error message on failure
meta
| admin | ✓ |
| def | func:knxSyncCur |
| is | func |
| lib | lib:knx |
| name | knxSyncCur |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxUpdateDataPoints
knxUpdateDataPoints(connId, fileUri, points)
Receives the updated values from the data point edit form
meta
| def | func:knxUpdateDataPoints |
| is | func |
| lib | lib:knx |
| name | knxUpdateDataPoints |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxUpdateIndividualAddress
knxUpdateIndividualAddress(conn, addr)
Method to configure KNX individual address Parameters
conn: the KNX connection used to query the object propertiesaddr: KNX individual address
Example:
knxUpdateIndividualAddress(@connRef, "1.0.0")
meta
| admin | ✓ |
| def | func:knxUpdateIndividualAddress |
| is | func |
| lib | lib:knx |
| name | knxUpdateIndividualAddress |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxUploadProject
knxUploadProject(knxProjFileRef, secret: "")
meta
| def | func:knxUploadProject |
| is | func |
| lib | lib:knx |
| name | knxUploadProject |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxWatchdogDisable
knxWatchdogDisable(conn)
Disable the KNX watchdog for the given connector. Removes the knxWatchdogEnabled and knxWatchdogFreq tags.
Parameters:
- conn: connector reference or id
Example:
knxWatchdogDisable(@myKnxConn)meta
| admin | ✓ |
| def | func:knxWatchdogDisable |
| is | func |
| lib | lib:knx |
| name | knxWatchdogDisable |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxWatchdogEnable
knxWatchdogEnable(conn, freq: null, batchSize: null, routerAware: true)
Enable or configure the KNX watchdog for the given connector. Adds the knxWatchdogEnabled marker tag and optionally sets the poll frequency, batch size, and router-aware mode.
Parameters:
- conn: connector reference or id
- freq: optional poll frequency (default 5min, minimum 5min). Examples: 5min, 10min, 1hr
- batchSize: optional number of devices to ping per poll cycle (default 10, minimum 1)
- routerAware: optional boolean to enable router-aware mode (default true). When true, adds the
knxRoutermarker tag so the watchdog pings routers first and skips bus devices if their router is down.
Example:
knxWatchdogEnable(@myKnxConn) // default 5min freq, batch 10, router-aware
knxWatchdogEnable(@myKnxConn, 30min) // 30min freq, batch 10, router-aware
knxWatchdogEnable(@myKnxConn, 5min, 20) // 5min freq, batch 20, router-aware
knxWatchdogEnable(@myKnxConn, 5min, null, false) // 5min freq, batch 10, no router awarenessmeta
| admin | ✓ |
| def | func:knxWatchdogEnable |
| is | func |
| lib | lib:knx |
| name | knxWatchdogEnable |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxWatchdogStatus
knxWatchdogStatus(conn)
Return a grid showing the cached watchdog connectivity status for all KNX devices. No bus traffic — reads from in-memory cache populated by the periodic watchdog poll. Columns: individualAddr, dis, status, isRouter, lastChecked.
The watchdog must be enabled on the connector by adding the knxWatchdogEnabled marker tag. Poll frequency is controlled by knxWatchdogFreq (default 5min).
Example:
knxWatchdogStatus(@myKnxConn)meta
| admin | ✓ |
| def | func:knxWatchdogStatus |
| is | func |
| lib | lib:knx |
| name | knxWatchdogStatus |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:knxWriteUnits
knxWriteUnits(units)
Write units
meta
| def | func:knxWriteUnits |
| is | func |
| lib | lib:knx |
| name | knxWriteUnits |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
knxAddr
The KNX Group Address used on a particular KnxConn.
meta
| def | knxAddr |
| is | str |
| lib | lib:knx |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| str | Unicode string of characters |
def
knxConn
Marker tag for the KNX connector record which stores the
connectivity configuration used to access a KNX access point.
The connector must also define a *.knxproj file and an Uri.meta
| def | knxConn |
| is | marker |
| lib | lib:knx |
supertypes
| marker | Marker labels a dict with typing information |
tags
| knxRouter | When present on a knxConn, the watchdog will ping router devices (detected from the ETS project file) first and skip bus device checks if the router is unreachable |
| knxWatchdogEnabled | Enable periodic KNX device connectivity watchdog polling |
| knxWatchdogFreq | KNX watchdog polling interval |
def
knxConnRef
Assocation with knxConn
meta
| def | knxConnRef |
| is | ref |
| lib | lib:knx |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| ref | Reference to an entity |
def
knxCur
Uri to use for current value subscriptions.
meta
| def | knxCur |
| is | uri |
| lib | lib:knx |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| uri | Universal resource identifier |
def
knxDevice
Marker tag on records that represent a physical KNX device. Created automatically by the watchdog when alarm integration is enabled.
meta
| def | knxDevice |
| is | marker |
| lib | lib:knx |
supertypes
| marker | Marker labels a dict with typing information |
def
knxIndividualAddr
The KNX individual address of a physical device record (e.g. "1.1.2"). Set automatically by the watchdog on knxDevice records.
meta
| def | knxIndividualAddr |
| is | str |
| lib | lib:knx |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| str | Unicode string of characters |
def
knxProjFileRef
A reference to the *knxproj file attached to a given KnxConn.meta
| def | knxProjFileRef |
| is | ref |
| lib | lib:knx |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| ref | Reference to an entity |
def
knxRouter
When present on a knxConn, the watchdog will ping router devices (detected from the ETS project file) first and skip bus device checks if the router is unreachable. If absent, all devices are checked directly.
meta
| def | knxRouter |
| is | marker |
| lib | lib:knx |
| tagOn | knxConn |
supertypes
| marker | Marker labels a dict with typing information |
def
knxWatchdogEnabled
Enable periodic KNX device connectivity watchdog polling. When present on a knxConn record, the connector will periodically ping devices to check their status.
meta
| def | knxWatchdogEnabled |
| is | marker |
| lib | lib:knx |
| tagOn | knxConn |
supertypes
| marker | Marker labels a dict with typing information |
def
knxWatchdogFreq
KNX watchdog polling interval. Controls how often the connector checks device connectivity. Default is 5min.
meta
| def | knxWatchdogFreq |
| is | number |
| lib | lib:knx |
| tagOn | knxConn |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| number | Integer or floating point numbers annotated with an optional unit |
def
knxWrite
Stores the Uri to be used when writing to the datapoint.
Can be the same as knxCur or different, as defined in the *.knxProj file.meta
| def | knxWrite |
| is | uri |
| lib | lib:knx |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| uri | Universal resource identifier |