PHP Modules by Tommi2Day 7.0
Modules for Symon
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes
SwitchDev Class Reference

generic Switch Device Module Class for IPSymcon More...

Inheritance diagram for SwitchDev:
T2DModule

Public Member Functions

 __construct ($InstanceID)
 [capvars]
 
 Create ()
 overload internal IPS_Create($id) function
 
 Destroy ()
 Destructor.
 
 ApplyChanges ()
 overload internal IPS_ApplyChanges($id) function
 
 RequestAction ($Ident, $val)
 define default module actions
 
 ReceiveData ($JSONString)
 Receive Data from Parent(IO)
 
 TimerEvent ()
 Timer event to simulate internal FS20(or similar) timed functions.
 
 DimUp ()
 Set dimmer an level (step if fs20) up.
 
 DimDown ()
 Set dimmer an level (step if fs20) down.
 
 SetIntensity (int $percent)
 Dim to the given level Range 0..100.
 
 SetDuration (int $duration, string $action=null)
 Set Timer to execute Tasks defined in Var TimerActionCode.
 
 SetSwitchMode (bool $val)
 change switch status
 
- Public Member Functions inherited from T2DModule
 __construct ($InstanceID, $json_file)
 Constructor.
 

Protected Member Functions

 SendDataToParent ($Data)
 Forward command to Splitter parent.
 
 SetStatusVariables ()
 overloaded function to maintain variables and timer
 
- 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
 
 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

 $capvars
 [capvars]
 
- 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)
 

Additional Inherited Members

- 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.
 

Detailed Description

generic Switch Device Module Class for IPSymcon

Constructor & Destructor Documentation

◆ __construct()

__construct (   $InstanceID)

[capvars]

Constructor

Parameters
$InstanceID

Member Function Documentation

◆ DimDown()

DimDown ( )

Set dimmer an level (step if fs20) down.

Returns
bool

◆ DimUp()

DimUp ( )

Set dimmer an level (step if fs20) up.

Returns
bool

◆ ReceiveData()

ReceiveData (   $JSONString)

Receive Data from Parent(IO)

Parameters
string$JSONString
Returns
void

◆ RequestAction()

RequestAction (   $Ident,
  $val 
)

define default module actions

Parameters
String$Ident
mixed$val
Returns
void

◆ SendDataToParent()

SendDataToParent (   $Data)
protected

Forward command to Splitter parent.

Parameters
string$Data
Returns
bool

◆ SetDuration()

SetDuration ( int  $duration,
string  $action = null 
)

Set Timer to execute Tasks defined in Var TimerActionCode.

Parameters
integer$durationDuration in sec
String$actioninitial action, otherewise will do the opposite
Returns
bool

◆ SetIntensity()

SetIntensity ( int  $percent)

Dim to the given level Range 0..100.

Parameters
integer$percentDimmer value percent
Returns
bool

◆ SetSwitchMode()

SetSwitchMode ( bool  $val)

change switch status

Parameters
bool$valOn or Off
Returns
bool

Field Documentation

◆ $capvars

array $capvars
protected
Initial value:
= array(
'Name' => array("ident" => 'Name', "type" => self::VT_String, "name" => 'Name', 'profile' => '', "pos" => 0),
"Switch" => array("ident" => 'Switch', "type" => self::VT_Boolean, "name" => 'Status', "profile" => 'Switch', "pos" => 1),
"SimpleSwitch" => array("ident" => 'SimpleSwitch', "type" => self::VT_Boolean, "name" => 'Status', "profile" => 'Switch', "pos" => 1),
"LevelPct" => array("ident" => 'LevelPct', "type" => self::VT_Integer, "name" => 'Level %', "profile" => 'Intensity.100', "pos" => 2),
"Level" => array("ident" => 'Level', "type" => self::VT_Integer, "name" => 'Level', "profile" => 'Intensity.255', "pos" => 2),
"ColorSat" => array("ident" => 'ColorSat', "type" => self::VT_Integer, "name" => 'Color Saturation', "profile" => 'Intensity.100', "pos" => 3),
"ColorHue" => array("ident" => 'ColorHue', "type" => self::VT_Integer, "name" => 'Color Hue (Grd)', "profile" => '', "pos" => 3),
"ColorTemp" => array("ident" => 'ColorTemp', "type" => self::VT_Integer, "name" => 'Color Temp', "profile" => '~TWColor', "pos" => 3),
"Dimmer" => array("ident" => 'Dimmer', "type" => self::VT_Integer, "name" => 'Dimmer', "profile" => 'Intensity.100', "pos" => 2),
"Shutter" => array("ident" => 'Shutter', "type" => self::VT_Integer, "name" => 'Shutter', "profile" => 'Shutter', "pos" => 2),
"BlindEndPos" => array("ident" => 'BlindEndPos', "type" => self::VT_Integer, "name" => 'Blind Pos', "profile" => 'Shutter', "pos" => 2),
"BlindMode" => array("ident" => 'BlindMode', "type" => self::VT_String, "name" => 'Blind Mode', "profile" => '', "pos" => 2),
"Timer" => array("ident" => 'Timer', "type" => self::VT_Integer, "name" => 'Timer', "profile" => '', "pos" => 3),
'TimerActionCode' => array("ident" => 'TimerActionCode', "type" => self::VT_String, "name" => 'next Timer Action', "profile" => '', "pos" => 3, "hidden" => true),
"FS20" => array("ident" => 'FS20', "type" => self::VT_String, "name" => 'last FS20 code', "profile" => '', "pos" => 4,"hidden" => true),
"Lock" => array("ident" => 'Lock', "type" => self::VT_Boolean, "name" => 'Locked', "profile" => 'Lock', "pos" => 5),
"Alert" => array("ident" => 'Alert', "type" => self::VT_Boolean, "name" => 'Alarm', "profile" => 'Alert.Reversed', "pos" => 5),
"Battery" => array("ident" => "Battery", "type" => self::VT_Boolean, "name" => 'Battery', "profile" => 'Battery.Reversed', "pos" => 10),
"BatteryPct" => array("ident" => "BatteryPct", "type" => self::VT_Integer, "name" => 'Battery percent', "profile" => 'Battery.100', "pos" => 10),
'Signal' => array("ident" => 'Signal', "type" => self::VT_Integer, "name" => 'Signal', 'profile' => 'Signal', "pos" => 40,"hidden" => true),
"TS" => array("ident" => "TS", "type" => self::VT_Integer, "name" => 'Timestamp', "profile" => 'UnixTimestamp', "pos" => 41,"hidden" => true)
)

[capvars]

mapping array for capabilities to variables


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