Ankündigung

Einklappen
Keine Ankündigung bisher.

PyKNX (pyknxexecute.py) auf Linknx zugreifen

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    PyKNX (pyknxexecute.py) auf Linknx zugreifen

    Hallo Zusammen,

    ich versuche auf Linknx mit dem PyKNX (pyknxexecute.py) zuzugreifen.

    Vorab, folgende Anweisung liefert mir ein Ergebnis:
    Kommando:
    Code:
    #> pyknxread.py -s 192.168.1.20 -p 1028 -R "EG.WC.JA.AUFZU"
    Antwortet :
    Code:
    EG.WC.JA.AUFZU  1
    In PyKNX findet man ein weiteres py-Modul, das pyknxexecute.py.
    Mit diesem Modul kann man XML-formatiert Aktionen durchführen, bspw.
    Kommando:
    Code:
    #> pyknxexecute.py -s 192.168.1.20 -p 1028 --action "<read><config><rules/></config></read>"
    Ausgabe:
    Code:
    2018-10-16 09:19:12,549 [[B]ERROR[/B]] [SendMessageThread Execute <read><config><rules/></config></read> (id=140073079917200)] [linknx.py:61] [B]Unknown execute element[/B]
    Als Ausgabe sollte laut Dokumentation eine Liste der in Linknx.xml konfigurierten "rules" zurückkommen.
    Hat jemand damit schon gearbeitet? Was mach ich hier falsch?

    BG

    #2
    This post is already over one year old but for the sake of completeness, let me answer in case others have the same question: pyknxexecute.py is meant to wrap the "execute action" part of Linknx XML protocol. It cannot be used to send a full XML request as itarch wanted to do.
    There is currently no standalone script that can retrieve the rules configuration. But it is easily doable with the linknx.py module in the package:
    Code:
    from pyknx import linknx
    server = linknx.Linknx('hostname')
    print(server.config.toxml())
    The above snippet prints the whole configuration. If one wants to get only the <rules/> section, it can be done by navigating the DOM held with server.config.

    Kommentar

    Lädt...
    X