$miniservers = LBSystem::get_miniservers();
This function returns an two dimension array of LoxBerry's configured Miniservers.Using defined keywords, you can access Miniserver connection data and credentials.
|Name (not hostname!) of the Miniservers|
|Miniserver's administrative user (URL encoded)|
|Passwort of the administrative user (URL encoded)|
|Miniserver's administrative user (not URL encoded)|
|Passwort of the administrative user (not URL encoded)|
|User specified note or link|
|Returns 1 if a Loxone CloudDNS connection is needed|
|The MAC address used for CloudDNS|
|Use get_ftpport instead to fetch the correct FTP port.|
|1 if this Miniserver should use encrypted REST calls|
|1 if the response from encrypted Miniserver REST requests should be encrypted|
Requesting the credentials can be done in different ways: Admin, Pass or the combined Credentials, or the non-URL-encoded variants in RAW.
Web requests should always use the URL encoded style as they can directly been passed to the Miniserver.
For FTP connection, you need to use the RAW variants as FTP needs plain strings.
RAW credentials and Miniserver webservice
If you wrongly use the RAW credentials to connect to the webservice of the Miniserver, your plugin, your users and you will get mental problems about special characters in users and/or passwords.
get_miniservers always returns the correct
Port, independent from a local or CloudDNS configuration. If the user configures CloudDNS, LoxBerry queries IP and port and returns the external address in the
Port fields. Therefore, the plugin does not need to handle CloudDNS Miniservers in a special way.
Check if entries are available
To reduce misbehaviour of your plugin, you should double-check, if get_miniservers returns values, or a specific Miniserver entry is available.
Check, if any Miniservers are configured
This can be helpful on select dropdowns or scripts.
If your plugin requests at least one configured Miniserver, the check can be useful to signal the user to properly configure his Miniserver in the web interface.
Check if a specific Miniserver is available
This check for a specific Miniserver (number) is especially interesting, if the user has selected a Miniserver in the UI and, later, your script needs to check if that Miniserver is still available.