ioBroker / AdapterRequests

This Place is used to track the status of new Adapter-Requests.
248 stars 36 forks source link

KNX - LuxorLiving adapter #691

Open phismith91 opened 2 years ago

phismith91 commented 2 years ago

LuxorLiving from Theben is a kind of simple KNX system without having to use ETS. Theben provides free software for this. If larger projects have to be linked with other manufacturers, LuxorLiving components can also be programmed very easily with ETS. In my eyes there are two options. Either you expand the current ETS adapter or generate a new LuxorLiving adapter.

Here Link for the free software and further documentations. https://www.luxorliving.co.uk/luxorplug/

boellner commented 2 years ago

Is the export csv format documented ? Can you provide an example ?

phismith91 commented 2 years ago

Hello, sorry for the late answer. Here is the generated projectfile from the LuxorLiving Software "LuxorPlug". Thank you Example_V0.3.lxp.zip

Juntaxy commented 2 years ago

Ich bin auch auf der Suche nach einem Adapter der meine LuxorLiving Installation in iobroker einbinden kann. Habe leider keine Programmierkenntnisse, aber falls ich helfen kann einfach melden.

horst789github commented 2 years ago

+1 ich schließe mich an...

phismith91 commented 2 years ago

Könnt ihr auch noch ein Beispiel hochladen?

horst789github commented 2 years ago

test-v20.lxp.txt die datei hat normal die endung .lxp , habe es in .txt umbenannt, da github lxp nicht mag...

phismith91 commented 1 year ago

Wie sieht es mit eurer Erfahrung aus? Habt ihr einen Workaround gefunden?

Juntaxy commented 1 year ago

Nein nichts gefunden. Ich weiß nicht mal, ob die IP1 sich überhaupt von einer anderen Software außer LuxorPlug ansprechen lässt. Ich hoffe, dass Theben ihre IP1 Matter kompatibel macht, dann sollte alles darüber funktionieren. Hab das mal an Theben geschrieben.

mathias-goebel commented 8 months ago

Nein nichts gefunden. Ich weiß nicht mal, ob die IP1 sich überhaupt von einer anderen Software außer LuxorPlug ansprechen lässt. Ich hoffe, dass Theben ihre IP1 Matter kompatibel macht, dann sollte alles darüber funktionieren. Hab das mal an Theben geschrieben.

Ja, das tut sie und eine besonders schlechte Wahl ist das Gerät definitiv nicht. Schaut mal auf das Webinterface. Einfach im Browser die IP des Gerätes ansteuern. Das Gerät ist von theben nicht selbst gefertigt. Es stammt von Weinzierl und läuft dort unter dem Namen BAOS 777. Es bietet eine Programmierschnittstelle an, sog. REST interface. Damit geht schon viel, nur für die Einrichtung ist man auf die proprietäre Software angewiesen. (Die auch nicht so schlecht ist.) Mittels ETS lässt sich IP1 übrigens nicht ansteuern. Zumindest habe ich noch kein IP Tunneling nutzen können. Daher gehen auch Home Assistant KNX integration nicht, was sehr schade ist. Dennoch, wer selbst ein wenig programmieren kann, der hat ganz schnell die Wetterdaten auch ohne Wetterstation in diesem System. Dann ist es letztlich egal ob Shelly, Matter oder Thread genutzen werden sollen, das kriegt man alles hin. Ob und wie nun ioBroker angesteuert werden kann, kann ich nicht sagen. Damit kenne ich mich nicht aus. Aber mit IP1 kann ich alle Werte auslesen und setzen, wie ich es möchte. Derzeit noch mit einfachen bash-skripten und cron-jobs. Hier nur ein kleines Bsp für die Höhe eines Rolladens in % (Werte sind 0..255; hier: 0):

IP1PASS="admin"
IP1IP="192.168.1.200"
thebenuser=$(curl --silent --insecure "https://${IP1IP}/rest/login' -X POST --data-raw "{\"username\":\"admin\",\"password\":\"$IP1PASS\"}")
curl https://${IP1IP}/rest/datapoints/325 --silent --insecure -H "Cookie: user=%22$thebenuser%22" | jq
{
  "Format": "DPT5",
  "description": {
    "datapoint_type": "5.010",
    "flags": {
      "is_communication": true,
      "is_read": false,
      "is_read_on_init": false,
      "is_transmit": true,
      "is_update": false,
      "is_write": false
    },
    "name": "J13 Hohe%",
    "size": {
      "bits": 8,
      "bytes": 1
    }
  },
  "id": 325,
  "state": {
    "is_update": false,
    "is_valid": false
  },
  "value": 0
}
horst789github commented 8 months ago

Aber mit IP1 kann ich alle Werte auslesen und setzen

wow nice, danke dir schonmal für die info. falls du lust hast, könntest du das alles irgendwie etwas näher erklären, wo bekomm ich die daten her z.b. J13 Hohe% das klingt ja nach dem Jalosie aktor aber hat der nicht eigentlich eine viel längere id weil J13 ist doch nur das gerät wo 1 jalosie angeschlossen wird oder? mich persönlich würde z.b. gerade interessieren wie ich eine Scene starten kann

mathias-goebel commented 8 months ago

wie ich eine Scene starten

  1. Gehe auf das Webinterface des IP1 unter https://[IP1 IP ADDRESSE]/#/dashboard/datapoints
  2. Finde den Datenpunkt (genauer: die ID) zu der gewünschten Szene: image
  3. Klicke auf den Schalter, um zu testen, ob das funktioniert.
  4. Schaue in der Browserkonsole, was da genau passiert: Im Firefox mache ich eine Rechtsklick, klicke auf "Inspect (Q)" und wechsel im neuen Fenster auf das "Network" Tab. Dort sehe ich für die Betätigung das Schalters, welcher HTTP-Befehl über an IP1 geschickt wird: image

Alle Informationen zu den “commands” und so weiter werden auch hier gezeigt: https://weinzierl.de/images/download/products/777/weinzierl_knx_ip_baos_777_rest_samples.zip

Damit sollte sich auch ioBroker schnell einbinden lassen, um hier mal zum Thema zurückzukommen. Denn das hier ist kein Forum, sondern ein Issue for AdapterRequest.

mathias-goebel commented 8 months ago

:us: :england: back to english, i suggest… So basically everything is documented well in the referenced package above and ioBroker adapter developer can get started. Personally I am new to smart home things and I am currently thinking about a Home Assistant integration. I dont know about ioBroker, so I can not promise anything. But if an ioBroker developer would like to start, i am happy to assist in any way. Best, Mathias

mathias-goebel commented 7 months ago

just one addition here: i suspect iobroker comes with support for knx, so you can use the UDP tunneling connection to integrate all actuators. check for group addresses with something like

curl --silent --insecure -H 'Cookie: user=%22[YOUR_TOKEN]%22' 'https://192.168.foo.bar/rest/datapoints/addresses' | jq

to enable a UDP connection you have to login at the REST interface and set serveritem 22 to true. Then a KNXnet/IP UDP tunnel (port 3671) becomes available for the IP adress you called the REST service from.

hope this helps.

phismith91 commented 7 months ago

I tried now the rest command. Is my method right? Is there something missing?! ID 171 is the S16-switching actuator

rest_command: knx_control: url: "https://192.168.1.177/rest/datapoints/values" method: POST # Ändern Sie dies entsprechend Ihrer Anforderung (z.B., GET) username: "admin" password: "password" payload: '{"datapoints_values": [{"id": 171, "value": true}], "command": 3}' content_type: "application/json" verify_ssl: true # Setzen Sie auf 'true', wenn SSL überprüft werden soll

mathias-goebel commented 7 months ago

No, i dont think this will work for 2 reasons:

  1. You have to make a login beforehand to get a token, this token needs to be set in the Cookies header like Cookies: user=%22[token]%22. Send username and password to /rest/login as it is specified in section 5.1 here
  2. verify_ssl wont work since the server certificate is self-signed.

Command seems to be correct, of course i cannot check the datapoint id.

phismith91 commented 7 months ago

Okay, with VS Code I can control the datapoint, but I get this issue in the protocol. I'm not sure now what to do. Faced similar problem?

Client error. Url: http://192.168.1.177/rest/login. Error: Cannot connect to host 192.168.1.177:443 ssl:default [[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1006)] Client error. Url: http://192.168.1.177/rest/datapoints/values. Error: Cannot connect to host 192.168.1.177:443 ssl:default [[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1006)]

Config.yaml looks like that now

rest_command: login: url: "http://192.168.1.177/rest/login" method: POST payload: '{"username": "admin", "password": "test"}' content_type: "application/json" verify_ssl: false knx_control: url: "http://192.168.1.177/rest/datapoints/values" method: PUT payload: '{"datapoints_values": [{"id": 171, "value": true}], "command": 3}' content_type: "application/json" verify_ssl: false headers: cookies: "user=%22{{ state_attr('rest_command.login', 'json')['token'] }}%22"

mathias-goebel commented 7 months ago

maybe because you are calling for http instead of https. Not sure about the behavior in this case, i suspect your call will be redirected to https. Can you set something like follow-redirects (in curl usually --location -- Follow redirects) or just move to https? (Wild guess, since i do not know what you are doing in VS Code exactly.)