PHP Modules by Tommi2Day 7.0
Modules for Symon
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
MQTTPUB Class Reference

MQTTPUB IPSymcon PHP IO Module Class More...

Inheritance diagram for MQTTPUB:
T2DModule

Public Member Functions

 __construct ($InstanceID)
 Constructor.
 
 Create ()
 overload internal IPS_Create($id) function
 
 Destroy ()
 Destructor.
 
 ApplyChanges ()
 overwrite internal IPS_ApplyChanges($id) function
 
 MessageSink ($TimeStamp, $SenderID, $Message, $Data)
 Handle Message Events will be called from IPS message loop for registered objects and events.
 
 Subscribe (int $id)
 Subscribe variables by ID.
 
 Subscribe_All (int $id, string $ident=null)
 Subscribe all variables below Parent ID.
 
 UnSubscribe (int $id)
 UnSubscribe variables by ID.
 
 UnSubscribe_All (int $id, string $ident=null)
 UnSubscribe variables below parent ID.
 
 Publish (int $id)
 Publish data of a variable to MQTT.
 
- Public Member Functions inherited from T2DModule
 __construct ($InstanceID, $json_file)
 Constructor.
 

Data Fields

const MQTT_QOS_0_AT_MOST_ONCE =0
 MQTT QOS constant "At Most once" (Fire and forget) Used here for publishing, no need to take care.
 
- Data Fields inherited from T2DModule
const IPS_KERNELMESSAGE = 10100
 IPS Message IDs.
 
const KR_INIT = 10102
 Kernel Status "INIT".
 
const KR_READY = 10103
 Kernel Status "Ready".
 
const KR_UNINIT = 10104
 Kernel Status "UnInit".
 
const ST_AKTIV = 102
 Module Status aktive.
 
const ST_INACTIV = 104
 Module Status "inactive".
 
const ST_ERROR = 201
 Module Status "Error".
 
const ST_NOPARENT = 202
 Custom Module Status "NoParent".
 
const VT_Boolean = 0
 IPS Variable Type Boolean.
 
const VT_Integer = 1
 IPS Variable Type Integer.
 
const VT_Float = 2
 IPS Variable Type Float.
 
const VT_String = 3
 IPS Variable Type String.
 
const IM_CHANGESTATUS =10505
 Instance Message Status change.
 
const VM_DELETE =10602
 Variable Message Delete.
 
const VM_UPDATE =10603
 Variable Message Update.
 

Additional Inherited Members

- Protected Member Functions inherited from T2DModule
 HasActiveParent ($id=0)
 Check if a parent is active.
 
 isActive ($id=0)
 Check if the given Instance is active.
 
 GetInstanceStatus ($id=0)
 Retrieve instance status.
 
 GetParent ($id=0)
 Check if a parent for Instance $id exists.
 
 GetCapList ()
 Get Property Caplist.
 
 GetCaps ()
 returns array of defined capabilities for this device Format:"cap:action;"
 
 GetActions ()
 returns array of defined Actions for this device
 
 CreateStatusVars ()
 create status variables out of capvar definitions from device
 
 SetStatusVariables ()
 remove variables not matching actual capabilities
 
 SwitchStatus ($val)
 parses switch status values to true/false
 
 SemEnter ($resource)
 Enter/Lock semaphore.
 
 SemLeave ($resource)
 Leave/unlock Semaphore.
 
 check_profile ($pname, $typ, $prefix, $suffix, $icon, $min, $max, $step, $digit=0, $drop=false)
 Check profile by name if exists, else create.
 
 drop_var ($ident)
 Delete a Variable by name if exists and assigned events.
 
 GetLocalBuffer ()
 Get status variable Buffer contains incoming data from IO, act as regVar.
 
 SetLocalBuffer ($val)
 Set status variable Buffer.
 
 debug ($topic, $data)
 Log an debug message PHP modules cannot enter data to debug window,use messages instead.
 
 isDebug ()
 check if debug is enabled
 
 debuglog ($data)
 Log Debug to its own file.
 
- Protected Attributes inherited from T2DModule
 $module_data = array()
 Vital module data build out of module.json.
 
 $DEBUGLOG = ''
 optional filename of a debug log (fully qualified)
 
 $name = ''
 Modul name for fast access.
 
 $capvars = array()
 Device capabilities to be overwrite in implementation.
 
 $actions = array()
 Device action capabilities to be overwrite in implementation.
 
 $module_interfaces
 often needed module GUIDs
 
 $useBufferVar =false
 Use StatusVariable as buffer (if Get/SetBuffer module functions are not available in IPS <4.1)
 

Detailed Description

MQTTPUB IPSymcon PHP IO Module Class

Constructor & Destructor Documentation

◆ __construct()

__construct (   $InstanceID)

Constructor.

Parameters
$InstanceID

Member Function Documentation

◆ MessageSink()

MessageSink (   $TimeStamp,
  $SenderID,
  $Message,
  $Data 
)

Handle Message Events will be called from IPS message loop for registered objects and events.

Parameters
int$TimeStampTimestamp of Event (looks not filled)
int$SenderIDrelated object ID
int$Messagerelated Message ID
array$DataPayload (content depends on Message ID)
See also
https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/nachrichten/

◆ Publish()

Publish ( int  $id)

Publish data of a variable to MQTT.

Parameters
int$idVariable ID

◆ Subscribe()

Subscribe ( int  $id)

Subscribe variables by ID.

Parameters
int$idvariable ID to subscribe

◆ Subscribe_All()

Subscribe_All ( int  $id,
string  $ident = null 
)

Subscribe all variables below Parent ID.

Parameters
int$idsubscribe all variables below this object id
string$identsubscribe only if has the variable this ident, default all

◆ UnSubscribe()

UnSubscribe ( int  $id)

UnSubscribe variables by ID.

Parameters
int$idvariable ID to unsubscribe

◆ UnSubscribe_All()

UnSubscribe_All ( int  $id,
string  $ident = null 
)

UnSubscribe variables below parent ID.

Parameters
int$idUnsubscribe all below object id
string$identsubscribe only if has the variable this name, default all

Field Documentation

◆ MQTT_QOS_0_AT_MOST_ONCE

const MQTT_QOS_0_AT_MOST_ONCE =0

MQTT QOS constant "At Most once" (Fire and forget) Used here for publishing, no need to take care.

See also
http://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels

The documentation for this class was generated from the following file: