IPSymcon JSON API Wrapper 7.0 (IPS V7.0)
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes
IPS_JSON Class Reference

Symcon JSON API wrapper class. More...

Public Member Functions

 get_ips_vartypes ()
 return $ips_vartypes
 
 __construct (string $url, string $user, string $password, bool $exception_flag=false)
 Constructor.
 
 getErrorMessage ()
 retrieves last error message
 
 getMethod ()
 retrieves last called method
 
 isError ()
 check if an error occured
 
 get_var (int $id)
 retrieves IPS Variable details
 
 get_script (int $id)
 get script details
 
 __call (string $name, mixed $arguments)
 main function (class autoloader)
 

Private Member Functions

 setError (string $message)
 set error variable
 
 get_object_name (int $id)
 retrieves name of object
 

Private Attributes

string $url
 URL to reach Symcon.
 
string $user
 API Username (Lizenz-Benutzername e.g.
 
string $password
 API Password (remote access = Fernzugriff Kennwort)
 
string $method
 last called method
 
bool $exception_flag
 should throw an Exception in case of error
 

Detailed Description

Symcon JSON API wrapper class.

Exceptions
Exception(disabled by default)
Version
7.0
Date
2024-01-24

Descriptions :

See also
https://www.tdressler.net/ipsymcon/jsonapi.html
https://www.symcon.de/service/dokumentation/entwicklerbereich/datenaustausch/
https://www.symcon.de/service/dokumentation/komponenten/verwaltungskonsole/

// ips methods used in this class via _call (to make ide happy) @method IPS_GetObject(int $id) @method IPS_VariableExists(int $id) @method IPS_GetVariable(int $id) @method IPS_GetVariableProfile($profilename) @method GetValue(int $id) @method IPS_ScriptExists(int $id) @method IPS_GetScript(int $id) @method IPS_RunScriptWait(int $script_id) @method IPS_GetKernelVersion() @method IPS_InstanceExists(int $id) @method IPS_GetInstance(int $id) @method FS20_SwitchMode(int $id, bool $switch)

Examples
check_ips_json.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( string  $url,
string  $user,
string  $password,
bool  $exception_flag = false 
)

Constructor.

Parameters
string$urlfull url to reach ipsymcon json api service
string$userIPSymcon License Username (e.g. Email)
string$passwordIPSymcon "Fernzugriff/Remote Access"-Password
boolean$exception_flagindicates if aan exception should occur
Exceptions
Exception

Member Function Documentation

◆ __call()

__call ( string  $name,
mixed  $arguments 
)

main function (class autoloader)

called if a method with a given name doesn't exist will catch method name and translate into api call

Parameters
string$namemethod
mixed$arguments
Returns
mixed result of called function
Exceptions
Exception

◆ get_ips_vartypes()

get_ips_vartypes ( )

return $ips_vartypes

Returns
array

◆ get_object_name()

get_object_name ( int  $id)
private

retrieves name of object

Parameters
int$idIPS Object-ID
Returns
string

◆ get_script()

get_script ( int  $id)

get script details

Parameters
int$idIPS Script-ID
Returns
?array Assoc Array mit Last Execution Time(last), ScriptName(name), FileName(file), Broken(is_broken)

◆ get_var()

get_var ( int  $id)

retrieves IPS Variable details

Parameters
int$idIPS Variable-ID
Returns
?array Assoc Array mit Value(value), Type(type), Name(name),Last Update(last), Suffix(suffix),Digits(digits) vom Profile

◆ getErrorMessage()

getErrorMessage ( )

retrieves last error message

Returns
string

◆ getMethod()

getMethod ( )

retrieves last called method

Returns
string

◆ isError()

isError ( )

check if an error occured

Returns
bool

◆ setError()

setError ( string  $message)
private

set error variable

Parameters
string$messageError Message

Field Documentation

◆ $exception_flag

array of String $exception_flag
private

should throw an Exception in case of error

IPS Variable Types.

matches IPS Variable API type return codes to API type field names ("ValueXYZ")

◆ $password

array of string $password
private

API Password (remote access = Fernzugriff Kennwort)

last Error

$error=array('message'=>$message,'code'=>$code)

Parameters
string$message
int$code

◆ $user

string $user
private

API Username (Lizenz-Benutzername e.g.

Email)

See also
http://www.ip-symcon.de/service/dokumentation/komponenten/verwaltungskonsole/

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