Metainformationen zur Seite

PHP Module loxberry_io.php

loxberry_io.php provides functions for frequently used communication protocols, especially to the Miniserver.

LoxBerry Compatibility

Features of this library are available from LoxBerry 1.2.5, or from the LoxBerry version mentioned at the function. Use the LB_MINIMUM parameter in your plugin.cfg.

Inclusion

require_once "loxberry_io.php";

 loxberry_io.php automatically loads loxberry_system.php, so it is not needed to give both libs.

 It's not required to add a path to the PHP library.

Global variables

Variable Usage
$mem_sendall_sec = 3600For the "mem" functions, this indicates the time until all values are retransmitted independent of they were changed.
$mem_sendall = 0 For the "mem" functions, setting this to 1 forces the functions to one-time dropping the cache (all values are sent again)

 

See also 


Functions

Most function names and features are identical to the Perl sibling LoxBerry::IO with PHP adjusted syntax. Please be very attentive to LoxBerry Version hints on top of every function. Most functions are available from V1.2.5.

 

 

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.