LoxBerry::IO::mqtt_connect — Connects to the MQTT broker defined in MQTT Gateway. Returns a $mqttobj object that can be used with Perl Modul Net::MQTT::Simple
LoxBerry::IO::mqtt_connectiondetails — Checks if the MQTT Gateway plugin is installed, and returns the configured host and authentication data from the MQTT Gateway plugin.
LoxBerry::IO::mqtt_get — Aquires a MQTT topic from the broker. The MQTT connection is implicitely opened to get the value. (MQTT Gateway plugin required)
LoxBerry::IO::mqtt_publish/mqtt_retain/mqtt_set — Publishes a value to a MQTT topic with or without retain flag. The MQTT connection is implicitely opened to call the publish. (MQTT Gateway plugin required)
LoxBerry::IO::mshttp_call — Sends a HTTP REST request to the specified Miniserver and returns the status code and value, and also the raw content of the response.
LoxBerry::IO::mshttp_call2 — Sends a HTTP REST request to the specified Miniserver the raw response, and optional a hash with further information.
LoxBerry::IO::mshttp_get — Requests values from one or multiple Loxone inputs/blocks/outputs via HTTP REST.
LoxBerry::IO::mshttp_send — Sends a value to a Loxone Miniserver input, or sends multiple values to multiple inputs.
LoxBerry::IO::mshttp_send_mem — Sends a value to a Loxone Miniserver input, or sends multiple values to multiple inputs. The function automatically saves the last state and only sends values that have changed.
LoxBerry::IO::msudp_send — Sends one or multiple values to the specified Loxone Miniserver via UDP.
LoxBerry::IO::msudp_send_mem — Sends one or multiple values to the specified Loxone Miniserver via UDP. The function automatically saves the last state and only sends values that have changed.
LoxBerry::Log::get_logs — Returns the current available logfiles, optional filtered by $package or $package and $name. Returns an array with a hashref to each logfile.
LoxBerry::Log::get_notifications — Reads the notifications, optional filtered by $package or $package and $name. Returns an array with a hashref to each notification.
LoxBerry::Log::get_notifications_html — Returns HTML code that shows all notifications of the specific package, and/or name and type. The HTML includes buttons to delete the notifications.
LoxBerry::Log::new (logging constructor) — Creates a log object to do LoxBerry-specific logging to a logfile or to the standard output (stderr, stdout). The LoxBerry logging module uses the user-defined loglevel from the plugin management, therefore no plugin-own setting and own loglevel-filtering is required.
LoxBerry::Log::notify — Creates an information or error notification that can be displayed in a plugin. This can be used in automated scripts like daemons or cronjobs to notify the user about good or bad news about the status of your plugin.
LoxBerry::Log::notify_ext — Creates an information or error notification with extended attributes. Use this function, if you want to store more information in your notification than a simple LoxBerry::Log::notify.
LoxBerry::Storage::get_netservers — Die Funktion get_netservers liest alle erreichbaren Netzwerk-Server, die über das Netzwerk Freigaben Widget eingerichtet wurden, ein und liefert einen Array zurück, der auch direkt in HTML::Template verwendet werden kann.
LoxBerry::Storage::get_netshares — Die Funktion get_netshares liest alle erreichbaren Netzwerk-Freigaben, die über das Netzwerk Freigaben Widget eingerichtet wurden, ein und liefert einen Array zurück, der auch direkt in HTML::Template verwendet werden kann.
LoxBerry::Storage::get_storage — Die Funktion get_storage sammelt alle vorhandenen Storage-Punkte (USB, Netzwerk, Lokal) und liefert einen Array zurück, der auch direkt in HTML::Template verwendet werden kann.
LoxBerry::Storage::get_storage_html — Die Funktion get_storage_html liefert ein fertiges HTML-Dropdown zur Auswahl von externen Storage-Devices, inkl. JavaScript. Dies vereinfacht dem Plugin-Entwickler die Ermittlung und Auswahl eines externen Pfades entsprechend der LoxBerry-Konfiguration des Benutzers.
LoxBerry::Storage::get_usbstorage — Die Funktion get_usbstorages liest alle erreichbaren USB-Storage-Geräte, die an den LoxBerry angeschlossen sind, ein und liefert einen Array zurück, der auch direkt in HTML::Template verwendet werden kann.
LoxBerry::System::begins_with — Gibt 1 zurück, wenn der $searchstring am Beginn des $fullstrings steht. Das ist praktisch, wenn in Konfigurationsdateien, die nicht mit Config::Simple geladen werden können, nach eindeutigen Schlüsselwörtern gesucht wird.
LoxBerry::System::bytes_humanreadable — Submit a size (e.g. a filesize) and it's input factor (B, KB, MB, GB, TB) to this function. It returns a human-readable string of your size value.
LoxBerry::System::currtime — Liefert einen vorformatierten Datum-/Zeit-String, zum Beispiel für Logfiles, zurück. Ohne Parameter wird human-readable, mit Parameter kann ein für Dateinamen optimierter Datumsstring, oder im ISO-Format, abgerufen werden.
LoxBerry::System::diskspaceinfo — Gibt Speicherplatzinformationen für einen einzelnen Pfad, oder für alle Mountpoints zurück.
LoxBerry::System::epoch2lox — Diese Funktion liefert aus einem Unix Epoch Timestamp den Loxone Timestamp (oder wahlweise den Loxone Timestamp von der aktuellen Zeit).
LoxBerry::System::execute — This function executes a shell command, and returns exitcode and it's output. With named parameters, also logging is done into a LoxBerry::Log object.
LoxBerry::System::get_binaries — Die LoxBerry-Konfiguraton enthält die Binary-Pfade zu häufig verwendeten Binaries, um systemunabhängig zu bleiben. Nach Möglichkeit sollen bei der Verwendung diese Pfade statt hart kodierter Pfade verwendet werden.
LoxBerry::System::get_ftpport — Der FTP-Port des Miniservers ist nicht in der LoxBerry-Konfiguration (bzw. nicht bei get_miniservers() ) enthalten, sondern wird mit dieser Funktion abgefragt. Die Funktion unterstützt Loxone Cloud DNS.
LoxBerry::System::get_miniserver_by_ip — Sucht in den konfigurierten Miniservern nach der übergebenen IP-Adresse und liefert die MS-Nummer zurück. Die Nummer kann im Hash von get_miniservers verwendet werden.
LoxBerry::System::get_miniserver_by_name — Sucht in den konfigurierten Miniservern nach dem übergebenen MS-Namen und liefert die MS-Nummer zurück. Die Nummer kann im Hash von get_miniservers verwendet werden.
LoxBerry::System::get_miniservers — Die Funktion get_miniservers liefert einen mehrdimensionalen Hash mit der gesamten Konfiguration aller Miniserver zurück.
LoxBerry::System::get_plugins — Die Funktion get_plugins liest die Pluginliste des LoxBerry und liefert einen Array zurück, der auch direkt in HTML::Template verwendet werden kann.
plugindatabase.dat — This table describes the keys to read from plugin database, and the log level of the LB module functions LoxBerry::System::get_plugins and LoxBerry::System::plugindata (Perl), and LBSystem::get_plugins and LBSystem::plugindata (PHP).
LoxBerry::System::is_disabled — Liefert nach Übergabe eines Strings (z.B. "disabled") zurück, ob dessen Inhalt wahr oder falsch ist. Dies kann beispielsweise beim Lesen eines Config-Files verwendet werden. Der Wert wird übergeben, und liefert True oder undef zurück.
LoxBerry::System::is_enabled — Liefert nach Übergabe eines Strings (z.B. "enabled") zurück, ob dessen Inhalt wahr oder falsch ist. Dies kann beispielsweise beim Lesen eines Config-Files verwendet werden. Der Wert wird übergeben, und liefert 1 oder undef zurück.
LoxBerry::System::lbfriendlyname — Liefert den vom Benutzer selbst definierbaren Namen dieses LoxBerrys als String zurück. Wenn du in deinem Plugin auf den LoxBerry verweist, kannst du auch direkt seinen Namen nennen.
LoxBerry::System::lblanguage — Wertet eine als URL-Querystring übergebene lang-Variable aus. Ist diese nicht vorhanden, wird die in LoxBerry definierte Systemsprache zurückgegeben.
LoxBerry::System::lock — Erstellt ein Lock-File, das die PID des laufenden Prozesses enthält. Dieses Lock-File kann nur erstellt werden, wenn keine wichtigen Systemprozesse laufen. Es ist möglich, eine angegebene Zeit abzuwarten, sollte der Lock nicht freigegeben sein.
LoxBerry::System::plugindata — Diese Funktion liefert einen Hash mit allen Daten des aktuell aufrufenden Plugins aus der Plugindatenbank. Optional kann ein Pluginname oder ein Pluginfolder übergeben werden, um die Daten des angegebenen Plugins zu erhalten.
LoxBerry::System::pluginloglevel — Diese Funktion liefert den aktuell durch den Benutzer in der Plugin-Verwaltung eingestellten Loglevel.
LoxBerry::System::pluginversion — Diese Funktion liefert den Versionsstring des aufrufenden Plugins aus der Plugin-Datenbank.
LoxBerry::System::read_file — Liest den Inhalt der angegebenen Datei komplett aus und liefert ihn als String zurück.
LoxBerry::System::reboot_required — Setzt den Status des LoxBerry, dass ein Reboot erforderlich ist. Dies kann beispielsweise an einer Änderung einer Plugin-Konfiguration getriggert werden, die einen Reboot erfordert.
LoxBerry::System::systemloglevel — Diese Funktion liefert den System-Loglevel von LoxBerry zurück. Diese Funktion ist vorrangig für LoxBerry-Core Entwickler.
LoxBerry::System::trim / ltrim / rtrim — Entspricht der aus anderen Sprachen bekannten Trim-Funktionen. ltrim entfernt alle linken, rtrim alle rechten, und trim beidseitig alle Leerzeichen.
LoxBerry::System::vers_tag — Fügt einem Versions-Tag den Buchstaben 'v' voran, sollte dieser fehlen. Dies wird für Versionen des Perl-Moduls version benötigt.
LoxBerry::System::write_file — Schreibt den Inhalt von $content in die Datei mit Dateinamen $filename. Gibt undef bei OK, oder den Fehler als String zurück.
Funktionen zum Erstellen des Templates — In diesem Artikel ist beschrieben, wie mit LoxBerry::Web die Webseite mit dem LoxBerry-Template aufgebaut wird. Neue Plugins in Perl sollten diese Methode verwenden.
LoxBerry::Web::foot — Gibt direkt das Ende der HTML-Seite aus. Siehe Funktionen zum Erstellen des Templates
LoxBerry::Web::head — Gibt direkt den <head> Teil des Templates aus. Siehe Funktionen zum Erstellen des Templates
LoxBerry::Web::iso_languages — Diese Funktion gibt entweder alle verfügbaren, oder alle Sprachen nach ISO-639-1 aus, wahlweise als Array oder Hash.
LoxBerry::Web::lbfooter — Abkürzung für pageend und foot. Gibt direkt das pageend und den foot des Templates aus. Siehe Funktionen zum Erstellen des Templates
LoxBerry::Web::lbheader — Abkürzung für head und pagestart. Gibt direkt den head und einen pagestart des Templates aus. Siehe Funktionen zum Erstellen des Templates
LoxBerry::Web::logfile_button_html — Returns HTML code for a logfile button. This function accepts parameters from LoxBerry::Log to open the lastest logfile, and also directly a logfile name.
LoxBerry::Web::loglevel_select_html — Returns ready HTML code for the plugin loglevel dropdown list. The loglevel setting of the html is saved in the LoxBerry plugin database, therefore this is the same selection as in the plugin management.
LoxBerry::Web::loglist_button_html — Returns HTML code for a button to a webpage with all logfiles of your plugin. This function lists all logfiles of your plugin, and additionally accepts the NAME parameter from LoxBerry::Log to filter to a specific log group name.
LoxBerry::Web::loglist_html — Returns HTML of the logfile list to directly show the overview of your logfiles in your plugin. It is thought to show the list on navigating a Logfiles tab ($navbar), but you can integrate the HTML as ever you like. .
LoxBerry::Web::loglist_url — Returns the URL to use as link to the loglist webpage of all the plugins logfiles. Using the NAME parameter filters to a specific NAME group (e.g. LoxBerry::Log (name => 'Daemon').
LoxBerry::Web::mslist_select_html — Returns ready HTML code for a Miniserver dropdown list. You can pre-select the current configured Miniserver from a config file.
LoxBerry::Web::pageend — Gibt direkt das Ende einer jQuery Mobile Page aus. Siehe Funktionen zum Erstellen des Templates
LoxBerry::Web::pagestart — Gibt direkt den Start einer jQuery Mobile Page aus. Siehe Funktionen zum Erstellen des Templates
Navigation Bar (Perl) — Bei Verwendung von Perl LoxBerry::Web::pagestart und LoxBerry::Web::lbheader bzw. PHP LBWeb::pagestart und LBWeb::lbheader kann oben, unterhalb der Titelzeile, eine Navigation Bar eingeblendet werden. Damit kann man beispielsweise innerhalb des Plugins über mehrere Einstellungsseiten navigieren. Es können auch Notification Bullets eingeblendet werden.
mqtt_connect — Connects to the MQTT broker defined in MQTT Gateway. Returns a $mqttobj object of the shipped class Bluerhinos/phpMQTT (MQTT library phpMQTT.php)
mqtt_connectiondetails — Checks if the MQTT Gateway plugin is installed, and returns the configured host and authentication data from the MQTT Gateway plugin.
mqtt_get — Aquires a MQTT topic from the broker. The MQTT connection is implicitely opened to get the value. (MQTT Gateway plugin required)
mqtt_publish/mqtt_retain/mqtt_set — Publishes a value to a MQTT topic with or without retain flag. The MQTT connection is implicitely opened to call the publish. (MQTT Gateway plugin required)
mshttp_call — Sends a HTTP REST request to the specified Miniserver and returns the status code and value, and also the raw full response.
mshttp_get — Requests values from one or multiple Loxone inputs/blocks/outputs via HTTP REST.
mshttp_send — Sends a value to a Loxone Miniserver input, or sends multiple values to multiple inputs.
mshttp_send_mem — Sends a value to a Loxone Miniserver input, or sends multiple values to multiple inputs. The function automatically saves the last state and only sends values that have changed.
msudp_send — Sends one or multiple values to the specified Loxone Miniserver via UDP.
msudp_send_mem — Sends one or multiple values to the specified Loxone Miniserver via UDP. The function automatically saves the last state and only sends values that have changed.
LBLog::get_notifications — Reads the notifications, optional filtered by $package or $package and $name. Returns an array of notifications, containing a labeled array of all attributes of a notification.
LBLog::get_notifications_html — Returns HTML that shows all notifications of the specific package, and/or name and type. The HTML includes buttons to delete the notifications.
LBLog::newLog (logging constructor PHP) — Creates a log object to do LoxBerry-specific logging to a logfile or to the standard output (stderr, stdout). The LoxBerry logging module uses the user-defined loglevel from the plugin management, therefore no plugin-own setting and own loglevel-filtering is required.
LBLog::notify — Creates an information or error notification that can be displayed in a plugin. This can be used in automated scripts like daemons or cronjobs to notify the user about good or bad news about the status of your plugin.
LBLog::notify_ext — Creates an information or error notification with extended attributes. Use this function, if you want to store more information in your notification than a simple LBLog::notify.
LBStorage::get_storage_html — get_storage_html returns a ready html dropdown including JavaScript to select external storage configured by the user in the LoxBerry widgets (network, usb, local). The selected storage can be submitted in your HTML form, or directly used in JavaScript.
LBSystem::currtime — Returns a pre-formatted date/time string, e.g. to use in logfiles. Without parameter the format is human-readable. With parameters you can request a string that is optimized for file names, or an ISO formatted string.
LBSystem::epoch2lox — This function returns from a Unix Epoch timestamp the Loxone timestamp, or, without parameter, the current time as Loxone timestamp.
LBSystem::get_binaries — LoxBerry's configuration saves execution paths to common binaries to stay system independend. As the required binary exists in the binary list, you should favor the variable instead of hard-coding the execution pathes in your plugin.
LBSystem::get_ftpport — Miniserver's FTP port is not included in Loxberry's configuration because it is requested on-demand by a webservice call. This function additionally supports Loxone CloudDNS and therefore always returns the correct FTP port.
LBSystem::get_miniserver_by_ip — Searches for the given ip address in the Miniserver list and returns the list number. Use the list number in the array of get_miniservers.
LBSystem::get_miniserver_by_name — Searches for the given Miniserver name and returns the list number. Use the list number in the array of get_miniservers.
LBSystem::get_miniservers — This function returns an two dimension array of LoxBerry's configured Miniservers.
LBSystem::get_plugins — Returns an array with all installed plugins, including version information and icon uri.
LBSystem::is_disabled($text) — Used for config parameters. Returns True if the $text contains a word that fuzzy could mean False.
LBSystem::is_enabled($text) — Used for config parameters. Returns True if the $text contains a word that fuzzy could mean True.
LBSystem::lbcountry — Returns the current user country of LoxBerry (e.g. "at")
LBSystem::lbfriendlyname — Returns the user defined friendly name of this LoxBerry. This is not the hostname.
LBSystem::lox2epoch — This function returns from a Loxone timestamp the Unix Epoch timestamp .
LBSystem::plugindata — This function returns a named array with all data of the current plugin from the plugin database. Optionally you can use the pluginname or foldername as parameter, to get the data from the named plugin.
LBSystem::pluginloglevel — This function returns the currently set plugin loglevel, that the user has set in the plugin management.
LBSystem::pluginversion — Returns the plugin version of your plugin from LoxBerry's plugin database.
LBSystem::reboot_required — Sets the state of LoxBerry to require a reboot. This can be used for example in a plugin, where a change of a setting requires a reboot of LoxBerry.
LBWeb::logfile_button_html — Returns HTML code for a logfile button. This function accepts parameters from LBLog / LoxBerry::Log to open the lastest logfile, and also directly a logfile name.
LBWeb::loglevel_select_html — Returns ready HTML code for the plugin loglevel dropdown list. The loglevel setting of the html is saved in the LoxBerry plugin database, therefore this is the same selection as in the plugin management and Log Manager.
LBWeb::loglist_button_html — Returns HTML code for a button to a list of logfiles. This function accepts parameters from LBLog / LoxBerry::Log to show all logfiles of your plugin, and also can filter to a log group name with the NAME parameter.
LBWeb::loglist_html — Returns HTML of the logfile list to directly show the overview of your logfiles in your plugin. It is thought to show the list on navigating a Logfiles tab ($navbar), but you can integrate the HTML where you like.
LBWeb::loglist_url — Returns the URL to a webpage showing a list of your plugins logfiles. This function accepts parameters from LBLog / LoxBerry::Log to show all logfiles of your plugin, and also can filter to a log group name with the NAME parameter.
LBWeb::mslist_select_html — Returns ready HTML code for a Miniserver dropdown list. You can pre-select the current configured Miniserver from a config file.
Navigation Bar (PHP) — Using the PHP functions LBWeb::header or LBWeb::pagestart, it is possible to add a customized navigation bar to your plugin. The navigration bar can be used for internal and external links, and also can show notification bullets. With the navigation bar it is very easy to split up settings to multiple pages.
PHP functions to create your webpage with LoxBerry design — This article explains how to create your PHP plugin website with the design and features from LoxBerry. For developing new plugins it is recommended to use these features.
Stats4Lox::influx_lineprot — Creates text in InfluxDB line format protocol for writing points to an Influx database. For details about the line protocol, please visit the Influx DB documentation: https://docs.influxdata.com/influxdb/v1.8/write_protocols/line_protocol_tutorial/ https://docs.influxdata.com/influxdb/v1.8/write_protocols/line_protocol_tutorial/
Stats4Lox::lox2telegraf — Creates an array with InfluxDB line format protocol lines of all submitted values. Data can be send to telegraf directly.
Stats4Lox::msget_value — Sends a HTTP REST request to the specified Miniserver and get all values of the specified block. All values including additional outputs are get back as a hash. It is the same as sending a request to Loxone's HTTP API with /all in the request url.
Stats4Lox::telegrafinternals — Creates a hash with internal telegraf statistics. The statistics will be created by telegraf every 10s. This function just gathers these statistics and put them into a hash.