Skip to content

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)
  • 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 ​

knxAddrThe KNX Group Address used on a particular KnxConn
knxConnMarker tag for the KNX connector record which stores the connectivity configuration used to access a KNX access point
knxConnRefAssocation with knxConn
knxCurUri to use for current value subscriptions
knxDeviceMarker tag on records that represent a physical KNX device
knxIndividualAddrThe KNX individual address of a physical device record (e.g
knxProjFileRefA reference to the *knxproj file attached to a given KnxConn
knxRouterWhen 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
knxWatchdogEnabledEnable periodic KNX device connectivity watchdog polling
knxWatchdogFreqKNX watchdog polling interval
knxWriteStores the Uri to be used when writing to the datapoint

funcs ​

finAddEditKnxConnCommitAxon function
finFormAddEditKnxConnAxon function
finFormConfirmKnxProjAxon function
finFormKnxProjErrorAxon function
finFormReplaceKnxProjAxon function
finFormReplaceKnxProjCommitAxon function
finFormSelectKnxConnEditAxon function
finFormUnlockKnxProjAxon function
finFormUnlockKnxProjCommitAxon function
finFormUploadKnxProjAxon function
finFormUploadKnxProjCommitAxon function
finRemoveStaleLockedKnxProjAxon function
knxDeleteProjectFiles
knxDeviceStatusNOTE
knxDevicesReturn a grid of all KNX devices found in the ETS project file for the given connector
knxDpEditFormLaunches the data point edit form
knxEnableCustomEncodingMethod to configure encoding if KNX project import fail Parameters - enable
knxFindProjectFiles
knxFormAddEditCustomUnitAxon function
knxFormAddEditExistingUnitAxon function
knxFormAddEditUnitAxon function
knxFormDeleteUnitAxon function
knxFormImportExportCustomUnitFileAxon function
knxFormNoteAxon function
knxGetDataTypesRetrieve the possible data types for the data point edit form's data type selectors
knxGetQuantities
knxImportUnits
knxLearnPerform a synchronous learn read on the given connector
knxPingPerform an async ping on the given connector
knxProjectIsLocked
knxReadUnits
knxReplaceProjectFile
knxSyncCurAsynchronously synchronize current values for given list of proxy points
knxUpdateDataPointsReceives the updated values from the data point edit form
knxUpdateIndividualAddressMethod to configure KNX individual address Parameters - conn
knxUploadProject
knxWatchdogDisableDisable the KNX watchdog for the given connector
knxWatchdogEnableEnable or configure the KNX watchdog for the given connector
knxWatchdogStatusReturn a grid showing the cached watchdog connectivity status for all KNX devices
knxWriteUnitsWrite 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 KnxConn


def ​

func:finAddEditKnxConnCommit ​

finAddEditKnxConnCommit(id, knxProjInput, disInput, hostInput, localAddrInput, knxRadio) ​

Axon function


meta ​

deffunc:finAddEditKnxConnCommit
isfunc
liblib:knx
namefinAddEditKnxConnCommit

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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
      }
    )
end


def ​

func:finFormAddEditKnxConn ​

finFormAddEditKnxConn(addEdit: true, id: null, refill: null) ​

Axon function


meta ​

deffunc:finFormAddEditKnxConn
isfunc
liblib:knx
namefinFormAddEditKnxConn

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:finFormConfirmKnxProj ​

finFormConfirmKnxProj(target, sources) ​

Axon function


meta ​

deffunc:finFormConfirmKnxProj
isfunc
liblib:knx
namefinFormConfirmKnxProj

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:finFormKnxProjError ​

finFormKnxProjError(title, errMsg, retryAction) ​

Axon function


meta ​

deffunc:finFormKnxProjError
isfunc
liblib:knx
namefinFormKnxProjError

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:finFormReplaceKnxProj ​

finFormReplaceKnxProj(orig) ​

Axon function


meta ​

deffunc:finFormReplaceKnxProj
isfunc
liblib:knx
namefinFormReplaceKnxProj

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:finFormReplaceKnxProjCommit ​

finFormReplaceKnxProjCommit(orig, fileRef) ​

Axon function


meta ​

deffunc:finFormReplaceKnxProjCommit
isfunc
liblib:knx
namefinFormReplaceKnxProjCommit

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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
end


def ​

func:finFormSelectKnxConnEdit ​

finFormSelectKnxConnEdit() ​

Axon function


meta ​

deffunc:finFormSelectKnxConnEdit
isfunc
liblib:knx
namefinFormSelectKnxConnEdit

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:finFormUnlockKnxProj ​

finFormUnlockKnxProj(knxProjRef, reopened: 0) ​

Axon function


meta ​

deffunc:finFormUnlockKnxProj
isfunc
liblib:knx
namefinFormUnlockKnxProj

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:finFormUnlockKnxProjCommit ​

finFormUnlockKnxProjCommit(knxProjRef, secret) ​

Axon function


meta ​

deffunc:finFormUnlockKnxProjCommit
isfunc
liblib:knx
namefinFormUnlockKnxProjCommit

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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
end


def ​

func:finFormUploadKnxProj ​

finFormUploadKnxProj() ​

Axon function


meta ​

deffunc:finFormUploadKnxProj
isfunc
liblib:knx
namefinFormUploadKnxProj

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:finFormUploadKnxProjCommit ​

finFormUploadKnxProjCommit(fileRef) ​

Axon function


meta ​

deffunc:finFormUploadKnxProjCommit
isfunc
liblib:knx
namefinFormUploadKnxProjCommit

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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
end


def ​

func:finRemoveStaleLockedKnxProj ​

finRemoveStaleLockedKnxProj(fileRef, isTask: false, staleTime: 30min) ​

Axon function


meta ​

deffunc:finRemoveStaleLockedKnxProj
isfunc
liblib:knx
namefinRemoveStaleLockedKnxProj

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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
end


def ​

func:knxDeleteProjectFiles ​

knxDeleteProjectFiles(files) ​


meta ​

deffunc:knxDeleteProjectFiles
isfunc
liblib:knx
nameknxDeleteProjectFiles

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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 timeout

meta ​

admin✓
deffunc:knxDeviceStatus
isfunc
liblib:knx
nameknxDeviceStatus

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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✓
deffunc:knxDevices
isfunc
liblib:knx
nameknxDevices

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxDpEditForm ​

knxDpEditForm(connId, dpAddrs) ​

Launches the data point edit form


meta ​

deffunc:knxDpEditForm
isfunc
liblib:knx
nameknxDpEditForm

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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✓
deffunc:knxEnableCustomEncoding
isfunc
liblib:knx
nameknxEnableCustomEncoding

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxFindProjectFiles ​

knxFindProjectFiles() ​


meta ​

deffunc:knxFindProjectFiles
isfunc
liblib:knx
nameknxFindProjectFiles

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxFormAddEditCustomUnit ​

knxFormAddEditCustomUnit(oldKey: null, newKey) ​

Axon function


meta ​

deffunc:knxFormAddEditCustomUnit
isfunc
liblib:knx
nameknxFormAddEditCustomUnit

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:knxFormAddEditExistingUnit ​

knxFormAddEditExistingUnit(oldKey: null, newKey) ​

Axon function


meta ​

deffunc:knxFormAddEditExistingUnit
isfunc
liblib:knx
nameknxFormAddEditExistingUnit

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:knxFormAddEditUnit ​

knxFormAddEditUnit(key: null) ​

Axon function


meta ​

deffunc:knxFormAddEditUnit
isfunc
liblib:knx
nameknxFormAddEditUnit

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:knxFormDeleteUnit ​

knxFormDeleteUnit(keys: null) ​

Axon function


meta ​

deffunc:knxFormDeleteUnit
isfunc
liblib:knx
nameknxFormDeleteUnit

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:knxFormImportExportCustomUnitFile ​

knxFormImportExportCustomUnitFile(export: false) ​

Axon function


meta ​

deffunc:knxFormImportExportCustomUnitFile
isfunc
liblib:knx
nameknxFormImportExportCustomUnitFile

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:knxFormNote ​

knxFormNote() ​

Axon function


meta ​

deffunc:knxFormNote
isfunc
liblib:knx
nameknxFormNote

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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()})
end


def ​

func:knxGetDataTypes ​

knxGetDataTypes(connId, level, id: null) ​

Retrieve the possible data types for the data point edit form's data type selectors


meta ​

deffunc:knxGetDataTypes
isfunc
liblib:knx
nameknxGetDataTypes

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxGetQuantities ​

knxGetQuantities() ​


meta ​

deffunc:knxGetQuantities
isfunc
liblib:knx
nameknxGetQuantities

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxImportUnits ​

knxImportUnits(recId) ​


meta ​

deffunc:knxImportUnits
isfunc
liblib:knx
nameknxImportUnits

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxLearn ​

knxLearn(conn, arg) ​

Perform a synchronous learn read on the given connector. Following columns are returned:

  • dis: display name of point
  • kind: point kind
  • modbusCur: address to map to point
  • modbusWrite: address if applicable to map to writable point
  • point: point marker
  • unit: unit if defined

meta ​

admin✓
deffunc:knxLearn
isfunc
liblib:knx
nameknxLearn

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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 not
  • curErr: error message on failure

meta ​

admin✓
deffunc:knxPing
isfunc
liblib:knx
nameknxPing

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxProjectIsLocked ​

knxProjectIsLocked(knxProjFileRef) ​


meta ​

deffunc:knxProjectIsLocked
isfunc
liblib:knx
nameknxProjectIsLocked

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxReadUnits ​

knxReadUnits(inclDef) ​


meta ​

deffunc:knxReadUnits
isfunc
liblib:knx
nameknxReadUnits

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxReplaceProjectFile ​

knxReplaceProjectFile(original, replacement, hasPassword: false) ​


meta ​

deffunc:knxReplaceProjectFile
isfunc
liblib:knx
nameknxReplaceProjectFile

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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:

  • modbusConnRef
  • modbusCur

This call updates the following point tags:

  • curVal: current value of the point
  • curStatus: status of the point (down/fault on failure)
  • curErr: error message on failure

meta ​

admin✓
deffunc:knxSyncCur
isfunc
liblib:knx
nameknxSyncCur

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxUpdateDataPoints ​

knxUpdateDataPoints(connId, fileUri, points) ​

Receives the updated values from the data point edit form


meta ​

deffunc:knxUpdateDataPoints
isfunc
liblib:knx
nameknxUpdateDataPoints

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxUpdateIndividualAddress ​

knxUpdateIndividualAddress(conn, addr) ​

Method to configure KNX individual address Parameters

  • conn : the KNX connection used to query the object properties
  • addr: KNX individual address

Example:

knxUpdateIndividualAddress(@connRef, "1.0.0")


meta ​

admin✓
deffunc:knxUpdateIndividualAddress
isfunc
liblib:knx
nameknxUpdateIndividualAddress

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxUploadProject ​

knxUploadProject(knxProjFileRef, secret: "") ​


meta ​

deffunc:knxUploadProject
isfunc
liblib:knx
nameknxUploadProject

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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✓
deffunc:knxWatchdogDisable
isfunc
liblib:knx
nameknxWatchdogDisable

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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 knxRouter marker 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 awareness

meta ​

admin✓
deffunc:knxWatchdogEnable
isfunc
liblib:knx
nameknxWatchdogEnable

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon 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✓
deffunc:knxWatchdogStatus
isfunc
liblib:knx
nameknxWatchdogStatus

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:knxWriteUnits ​

knxWriteUnits(units) ​

Write units


meta ​

deffunc:knxWriteUnits
isfunc
liblib:knx
nameknxWriteUnits

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

knxAddr ​

The KNX Group Address used on a particular KnxConn.


meta ​

defknxAddr
isstr
liblib:knx

supertypes ​

valData value type
scalarScalar is an atomic value kind
strUnicode 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 ​

defknxConn
ismarker
liblib:knx

supertypes ​

markerMarker labels a dict with typing information

tags ​

knxRouterWhen 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
knxWatchdogEnabledEnable periodic KNX device connectivity watchdog polling
knxWatchdogFreqKNX watchdog polling interval


def ​

knxConnRef ​

Assocation with knxConn


meta ​

defknxConnRef
isref
liblib:knx

supertypes ​

valData value type
scalarScalar is an atomic value kind
refReference to an entity


def ​

knxCur ​

Uri to use for current value subscriptions.


meta ​

defknxCur
isuri
liblib:knx

supertypes ​

valData value type
scalarScalar is an atomic value kind
uriUniversal 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 ​

defknxDevice
ismarker
liblib:knx

supertypes ​

markerMarker 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 ​

defknxIndividualAddr
isstr
liblib:knx

supertypes ​

valData value type
scalarScalar is an atomic value kind
strUnicode string of characters


def ​

knxProjFileRef ​

A reference to the *knxproj file attached to a given KnxConn.

meta ​

defknxProjFileRef
isref
liblib:knx

supertypes ​

valData value type
scalarScalar is an atomic value kind
refReference 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 ​

defknxRouter
ismarker
liblib:knx
tagOnknxConn

supertypes ​

markerMarker 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 ​

defknxWatchdogEnabled
ismarker
liblib:knx
tagOnknxConn

supertypes ​

markerMarker labels a dict with typing information


def ​

knxWatchdogFreq ​

KNX watchdog polling interval. Controls how often the connector checks device connectivity. Default is 5min.


meta ​

defknxWatchdogFreq
isnumber
liblib:knx
tagOnknxConn

supertypes ​

valData value type
scalarScalar is an atomic value kind
numberInteger 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 ​

defknxWrite
isuri
liblib:knx

supertypes ​

valData value type
scalarScalar is an atomic value kind
uriUniversal resource identifier