Woersty / LoxBerry-Plugin-KNXd

A LoxBerry Plugin - see plugins.loxberry.de
http://plugins.loxberry.de
Apache License 2.0
2 stars 0 forks source link

gad_query function no longer supported #11

Open cavoknosig opened 4 years ago

cavoknosig commented 4 years ago

KNXd used to support a function, where a preconfigured list of group addresses was queried sequentially after a generic http request. This was extremely helpful to synchronize the miniserver KNX function blocks to the current state of the home, e.g. after a reboot or power outage.

even on the documentation page https://www.loxwiki.eu/display/LOXBERRY/KNXd the feature is mentioned:

Eine weitere Funktion ist die sequentielle Abfrage von einer KNX-Gruppenadressen-Liste, gestartet durch einen beliebigen Trigger über einen Virtuellen Ausgang

http://KNXd:loxberry@/plugins/knxd/?mode=gad_query Der LoxBerry fragt dann alle 250 ms eine Gruppenadresse ab. Der Miniserver erhält dann ggf. die Antwort auf dem Bus, falls ein Gerät antwortet.. Die Gruppen-Adressen müssen das 3-stellige Format haben: xx/x/xxx.

in the V2 version of the plugin, the UI to configure the list of group addresses is missing. when trying to place the request, the following result is returned after some seconds:

Feature disabled. Exiting.

would be great if that feature could be reenabled.

thanks for all the work!

Woersty commented 4 years ago

Hi, sorry for the delay. I'm often quite busy. I use version KNXd 2019.7.18.1 - which should be the latest version and I see no problem yet. I will try to explain how it works.

First of all the Checkbox "Cyclic query of groupaddresses" must be checked. If not, the input field is hidden and the function aborts with "Feature disabled. Exiting." See https://github.com/Woersty/LoxBerry-Plugin-KNXd/blob/master/webfrontend/htmlauth/bin/gad_query.pl#L48

I have put 2/0/1 here for testing.

image

image

image

As you can see, the Bus Monitor shows the read request and answer. The function itself must be triggered by calling the URL. It's not a cron job. Maybe that is also confusing. That means you have to configure http://KNXd:loxberry@loxberrydev/plugins/knxd/?mode=gad_query somewhere as URL to be called in the frequency you want.

But one thing I have noticed is, that the username and password is not passed anymore in new browsers. I get a login when opening http://KNXd:loxberry@loxberrydev/plugins/knxd/?mode=gad_query and have to enter user KNXd and pass loxberry manually.

But I can disable or modify this password check. Let me know your opinion.

BR C

Woersty commented 4 years ago

As workaround http://loxberry/plugins/knxd/?mode=gad_query&user=KNXd&pass=loxberry is now possible, too. But it's much weaker regarding the security... but who cares 😄

cavoknosig commented 4 years ago

thank you very much!

URL adaptation is no problem. already using default user/pass in a http GET string anyway.

i think the main confusion stems from the "cyclic query of group adress" labelling... under that title, i would expect a cronjob type function which queries the group address list every x (configurable) time interval.

a "query once, triggered by URL request" use case/function is therefore quite the opposite.

Woersty commented 4 years ago

Will update the label. The function itself is documented like that (you have to use a virtual out in miniserver to trigger the query)

https://www.loxwiki.eu/display/LOXBERRY/KNXd#KNXd-FunktiondesPlugins