Jeedom Core

cmd
in package

Jeedom command management class

Tags
see
eqLogic
see
jeeObject

Table of Contents

Properties

$_changed  : bool
$_collectDate  : string
$_eqLogic  : eqLogic|null
$_needRefreshAlert  : bool
$_needRefreshWidget  : bool
$_templateArray  : array<string, string>
$_unite_conversion  : array<string, int|string>
$_valueDate  : string
$alert  : array<string, mixed>
$configuration  : string|null
$display  : array<string, mixed>
$eqLogic_id  : int|""|null
$eqType  : string|null
$generic_type  : string|null
$id  : int|""|null
$isHistorized  : int
$isVisible  : int
$logicalId  : int|null
$name  : string|null
$order  : int|null
$subType  : string|null
$template  : array<string, mixed>
$type  : string|null
$unite  : string
$value  : mixed|null

Methods

actionAlertLevel()  : void
Execute alert level actions
addHistoryValue()  : void
Add value to command history
all()  : array<string|int, static>
Get all commands
allHistoryCmd()  : array<string|int, static>
Get all history commands
allSubType()  : array<string|int, string>
Get all distinct command subtypes
allType()  : array<string|int, string>
Get all distinct command types
allUnite()  : array<string|int, string>
Get all distinct command units
alreadyInState()  : bool
Check if command is in specific state
askResponse()  : bool
Process ask response
autoValueArray()  : array<string|int, float|int|string>
Auto-format value and unit
availableWidget()  : array<string, array<string, array<string, array<string, int|string>>>>
Get available widgets for version
byEqLogicId()  : array<string|int, static>
Get commands by equipment ID
byEqLogicIdAndGenericType()  : static|array<string|int, static>
Get command by equipment ID and generic type
byEqLogicIdAndLogicalId()  : static|array<string|int, static>
Get command by equipment ID and logical ID
byEqLogicIdCmdName()  : static
Get command by equipment ID and command name
byGenericType()  : static|array<string|int, static>
Get commands by generic type
byGenericTypeObjectId()  : array<string|int, static>|void
Get commands by generic type and object ID
byId()  : void|static
Get a command by ID
byIds()  : void|array<string|int, static>
Get multiple commands by IDs
byLogicalId()  : array<string|int, static>
Get commands by logical ID
byObjectNameCmdName()  : static
Get command by object name and command name
byObjectNameEqLogicNameCmdName()  : static
Get command by object name, equipment name and command name
byString()  : static
Get command from string representation
byTypeEqLogicNameCmdName()  : static
Get command by equipment type, name and command name
byTypeSubType()  : array<string|int, static>
Get commands by type and subtype
byValue()  : array<string|int, static>
Get commands by value
checkAccessCode()  : bool
Check access code
checkAlertLevel()  : string
Check alert level for value
checkCmdAlert()  : void
Check command alerts
checkReturnState()  : void
Check command return state
cleanWidgetCode()  : string
Clean widget code from template and helper content
cmdAlert()  : void
Process command alerts
cmdToHumanReadable()  : object|array<string, mixed>|string
Replace command IDs with human readable format
cmdToValue()  : object|array<string, mixed>|string
Replace command IDs with their values
computeInfluxData()  : Point|""
Compute InfluxDB data point
convertColor()  : array<string|int, string>
Get all distinct command units
deadCmd()  : array<string|int, array<string, string>>
Find commands without valid references
dontRemoveCmd()  : bool
Check if command can be removed
dropInflux()  : void
Drop InfluxDB database
dropInfluxDatabase()  : void
Drop InfluxDB database
duringAlertLevel()  : void
Check alert level duration
emptyHistory()  : null
Empty command history
event()  : void
Process command event
execCmd()  : void|string
Execute command with options
execute()  : bool
Execute command
executeAlertCmdAction()  : void
Execute command alert actions
export()  : array<string, mixed>
Export command configuration
exportApi()  : array<string|int, mixed>|array<string|int, array<string|int, mixed>>
Export command data for API
formatValue()  : float|int|mixed|string
Format command value according to its configuration
generateAskResponseLink()  : string
Generate API URL for ask response
getAlert()  : array<string, mixed>|mixed
Get alert configuration
getCache()  : mixed
Get cache value
getChanged()  : bool
Get changed state
getCmdValue()  : static|array<string|int, static>|false
Get associated info command
getCollectDate()  : string
Get collect date
getConfiguration()  : array<string, mixed>|mixed
Get configuration value
getDirectUrlAccess()  : string
Get direct URL access
getDisplay()  : array<string, mixed>|mixed
Get display configuration
getEqLogic()  : eqLogic|null
Get parent equipment object
getEqLogic_id()  : int|null
Get parent equipment ID
getEqType()  : string|null
Get equipment type
getEqType_name()  : string|null
Get equipment type name
getEventOnly()  : int
Get event only status
getGeneric_type()  : string|null
Get command generic type
getGenericTypeSelectOptions()  : string
Get generic type select options
getHistory()  : array<string|int, history>
Get command history
getHumanName()  : string
Get human readable name
getId()  : int|""
Get command ID
getInflux()  : Database|string|void
Get InfluxDB connection
getIsHistorized()  : int
Get historization state
getIsVisible()  : int
Get visibility state
getLastHistory()  : array<string, mixed>
Get last history entry
getLastValue()  : mixed|array<string|int, mixed>
Get last stored value
getLinkData()  : array<string|int, array<string|int, mixed>>|mixed|void
Get command dependency graph data
getLogicalId()  : int|null
Get logical ID
getName()  : string|null
Get command name
getOldest()  : array<string|int, historyArch>
Get oldest history entries
getOrder()  : int
Get display order
getPluralityHistory()  : array<string|int, history>
Get history with multiple points
getSelectOptionsByTypeAndSubtype()  : int|string
Get widget selection options by type and subtype
getStatistique()  : array<string, mixed>
Get command statistics
getSubType()  : string|null
Get command subtype
getTableName()  : string
Get database table name
getTemplate()  : mixed|array<string, mixed>
Get template configuration
getTemporalAvg()  : array<string|int, mixed>|float|int
Get temporal average
getTendance()  : float
Get value trend
getType()  : string|null
Get command type
getUnite()  : string
Get command unit
getUse()  : array<string, array<int, object>>
Get elements used by this command
getUsedBy()  : array<string, array<int, object>>
Get elements using this command
getValue()  : mixed|null
Get command value
getValueDate()  : string
Get value date
getWidgetHelp()  : string
Get widget help text
getWidgetsSelectOptions()  : string
Get widget select options for version
getWidgetTemplateCode()  : array<string, mixed>
Get widget template code
hasRight()  : bool
Check command access rights
historyInflux()  : void
Send command history to InfluxDB
historyInfluxAll()  : void
Send all history to InfluxDB
humanReadableToCmd()  : array<string|int, mixed>|bool|int|mixed|string|array<string|int, string>|null
Replace human readable format with command IDs
isAlreadyInStateAllow()  : bool
Check if command is already in desired state
isHistorized()  : array<string|int, static>
Get historized commands
migrateCmd()  : static
Migrate command configuration to another command
postExecCmd()  : void
Execute post-command actions
preExecCmd()  : void
Execute pre-command actions
pushInflux()  : void
Push value to InfluxDB
pushUrl()  : void
Push command value to configured URL
refresh()  : void
Refresh command from database
remove()  : bool
Remove command
returnState()  : void
Return state after delay
save()  : bool
Save command to database
searchByString()  : array<string|int, static>
Search commands by string
searchConfiguration()  : array<string|int, static>
Search commands by configuration
searchConfigurationEqLogic()  : array<string|int, static>
Search commands by equipment configuration
searchDisplay()  : array<string|int, static>
Search commands by display configuration
searchTemplate()  : array<string|int, static>
Search commands by template
sendHistoryInflux()  : void
Send history to InfluxDB
setAlert()  : static
Set alert configuration
setCache()  : static
Set cache value
setChanged()  : static
Set changed state
setCollectDate()  : static
Set collect date
setConfiguration()  : static
Set configuration value
setDisplay()  : static
Set display configuration
setEqLogic()  : static
Set parent equipment object
setEqLogic_id()  : static
Set parent equipment ID
setEqType()  : static
Set equipment type
setGeneric_type()  : static
Set command generic type
setId()  : static
Set command ID
setIsHistorized()  : static
Set historization state
setIsVisible()  : static
Set visibility state
setLogicalId()  : static
Set logical ID
setName()  : static
Set command name
setOrder()  : static
Set display order
setSubType()  : static
Set command subtype
setTemplate()  : static
Set template configuration
setType()  : static
Set command type
setUnite()  : static
Set command unit
setValue()  : static
Set command value
setValueDate()  : static
Set value date
toHtml()  : string
Generate HTML representation
widgetPossibility()  : array<string, bool>|bool|mixed
Check widget customization possibilities
autoValueFormat()  : array<string|int, int|float>
Format value based on modulo
cast()  : static|array<string|int, static>
Cast an object or array of objects to specific command type
pre_postExecCmd()  : void
Execute pre/post command actions

Properties

$_changed

protected bool $_changed = \false

Change tracking flag

$_collectDate

protected string $_collectDate = ''

Collect date

$_needRefreshAlert

protected bool $_needRefreshAlert

Flag for alert refresh

$_needRefreshWidget

protected bool $_needRefreshWidget

Flag for widget refresh

$_templateArray

protected static array<string, string> $_templateArray = array()

Template array

$_unite_conversion

protected static array<string, int|string> $_unite_conversion = array('s' => array(60, 's', 'min', 'h'), 'W' => array(1000, 'W', 'kW', 'MW'), 'Wh' => array(1000, 'Wh', 'kWh', 'MWh'), 'io' => array(1024, 'io', 'Kio', 'Mio', 'Gio', 'Tio'), 'o' => array(1000, 'o', 'Ko', 'Mo', 'Go', 'To'), 'o/s' => array(1000, 'o/s', 'Ko/s', 'Mo/s', 'Go/s', 'To/s'), 'Bps' => array(1000, 'Bps', 'Kbps', 'Mbps', 'Gbps', 'Tbps'), 'Hz' => array(1000, 'Hz', 'kHz', 'MHz', 'GHz'), 'l' => array(1000, 'l', 'm<sup>3</sup>'))

Unit conversion mapping

$_valueDate

protected string $_valueDate = ''

Value date

$alert

protected array<string, mixed> $alert

Alert configuration

$configuration

protected string|null $configuration

Command configuration

$display

protected array<string, mixed> $display

Display configuration

$eqLogic_id

protected int|""|null $eqLogic_id

ID of parent equipment

$eqType

protected string|null $eqType

Equipment type

$generic_type

protected string|null $generic_type

Generic type of command

$isHistorized

protected int $isHistorized = 0

Historization flag

$isVisible

protected int $isVisible = 1

Visibility flag

$logicalId

protected int|null $logicalId

Logical identifier for the command

$name

protected string|null $name

Command name

$order

protected int|null $order

Display order

$subType

protected string|null $subType

Command subtype ('binary'|'numeric'|'message'|'color'|'slider'|'string')

$template

protected array<string, mixed> $template

Template configuration

$type

protected string|null $type

Command type ('action'|'info'|'string')

$unite

protected string $unite = ''

Unit for values

$value

protected mixed|null $value = \null

Current value

Methods

actionAlertLevel()

Execute alert level actions

public actionAlertLevel(string $_level, mixed $_value) : void
Parameters
$_level : string

Alert level

$_value : mixed

Trigger value

Tags
throws
Exception

addHistoryValue()

Add value to command history

public addHistoryValue(mixed $_value[, string $_datetime = '' ]) : void
Parameters
$_value : mixed

Value to historize

$_datetime : string = ''

Date of the value

all()

Get all commands

public static all() : array<string|int, static>
Return values
array<string|int, static>

Array of all commands

allHistoryCmd()

Get all history commands

public static allHistoryCmd() : array<string|int, static>
Tags
throws
Exception
Return values
array<string|int, static>

Array of historical commands

allSubType()

Get all distinct command subtypes

public static allSubType([string $_type = '' ]) : array<string|int, string>
Parameters
$_type : string = ''

Filter by command type

Tags
throws
Exception
Return values
array<string|int, string>

Array of command subtypes

allType()

Get all distinct command types

public static allType() : array<string|int, string>
Tags
throws
Exception
Return values
array<string|int, string>

Array of command types

allUnite()

Get all distinct command units

public static allUnite() : array<string|int, string>
Tags
throws
Exception
Return values
array<string|int, string>

Array of units

alreadyInState()

Check if command is in specific state

public alreadyInState(array<string, mixed> $_options) : bool
Parameters
$_options : array<string, mixed>

Command options

Tags
throws
Exception
Return values
bool

State verification result

askResponse()

Process ask response

public askResponse(mixed $_response) : bool
Parameters
$_response : mixed

Response value

Tags
throws
Exception
Return values
bool

Success status

autoValueArray()

Auto-format value and unit

public static autoValueArray(int|float $_value[, int $_decimal = 99 ][, string $_unit = '' ][, bool $_space = False ]) : array<string|int, float|int|string>
Parameters
$_value : int|float

Value to format

$_decimal : int = 99

Number of decimals

$_unit : string = ''

Unit string

$_space : bool = False

Add space between value and unit

Return values
array<string|int, float|int|string>

Array with formatted value and unit

availableWidget()

Get available widgets for version

public static availableWidget(string $_version) : array<string, array<string, array<string, array<string, int|string>>>>
Parameters
$_version : string

Version to check

Return values
array<string, array<string, array<string, array<string, int|string>>>>

Available widgets

byEqLogicId()

Get commands by equipment ID

public static byEqLogicId(int|array<string|int, int> $_eqLogic_id[, string|null $_type = null ][, bool $_visible = null ][, eqLogic $_eqLogic = null ][, bool $_has_generic_type = null ]) : array<string|int, static>
Parameters
$_eqLogic_id : int|array<string|int, int>

Equipment ID(s)

$_type : string|null = null

Command type ('action'|'info'|null)

$_visible : bool = null

Filter on visible commands

$_eqLogic : eqLogic = null

Parent equipment

$_has_generic_type : bool = null

Filter on commands with generic type

Return values
array<string|int, static>

Array of commands

byEqLogicIdAndGenericType()

Get command by equipment ID and generic type

public static byEqLogicIdAndGenericType(int $_eqLogic_id, string $_generic_type[, bool $_multiple = false ][, string|null $_type = null ][, eqLogic|null $_eqLogic = null ]) : static|array<string|int, static>
Parameters
$_eqLogic_id : int

Equipment ID

$_generic_type : string

Generic type

$_multiple : bool = false

Allow multiple results

$_type : string|null = null

Command type filter ('action'|'info'|null)

$_eqLogic : eqLogic|null = null

Parent equipment

Tags
throws
Exception
Return values
static|array<string|int, static>

Command(s) found

byEqLogicIdAndLogicalId()

Get command by equipment ID and logical ID

public static byEqLogicIdAndLogicalId(int $_eqLogic_id, int $_logicalId[, bool $_multiple = false ][, string|null $_type = null ][, eqLogic|null $_eqLogic = null ]) : static|array<string|int, static>
Parameters
$_eqLogic_id : int

Equipment ID

$_logicalId : int

Logical ID

$_multiple : bool = false

Allow multiple results

$_type : string|null = null

Command type filter ('action'|'info'|null)

$_eqLogic : eqLogic|null = null

Parent equipment

Tags
throws
Exception
Return values
static|array<string|int, static>

Command(s) found

byEqLogicIdCmdName()

Get command by equipment ID and command name

public static byEqLogicIdCmdName(int $_eqLogic_id, string $_cmd_name) : static
Parameters
$_eqLogic_id : int

Equipment ID

$_cmd_name : string

Command name

Tags
throws
Exception
Return values
static

Matching command

byGenericType()

Get commands by generic type

public static byGenericType(string|array<string|int, string> $_generic_type[, int|null $_eqLogic_id = null ][, bool $_one = false ]) : static|array<string|int, static>
Parameters
$_generic_type : string|array<string|int, string>

Generic type(s) to search

$_eqLogic_id : int|null = null

Equipment ID filter

$_one : bool = false

Return only first result

Return values
static|array<string|int, static>

First command if $_one is true otherwise array of commands

byGenericTypeObjectId()

Get commands by generic type and object ID

public static byGenericTypeObjectId(string $_generic_type[, int|null $_object_id = null ][, string|null $_type = null ]) : array<string|int, static>|void
Parameters
$_generic_type : string

Generic type

$_object_id : int|null = null

Object ID filter

$_type : string|null = null

Command type filter ('action'|'info'|null)

Tags
throws
Exception
Return values
array<string|int, static>|void

Array of commands or void if none found

byId()

Get a command by ID

public static byId(int|string $_id) : void|static
Parameters
$_id : int|string

Command ID

Return values
void|static

Null if ID not valid, command object otherwise

byIds()

Get multiple commands by IDs

public static byIds(array<string|int, string|int> $_ids) : void|array<string|int, static>
Parameters
$_ids : array<string|int, string|int>

Array of command IDs

Return values
void|array<string|int, static>

Null if IDs not valid, array of commands otherwise

byLogicalId()

Get commands by logical ID

public static byLogicalId(string $_logical_id[, string|null $_type = null ]) : array<string|int, static>
Parameters
$_logical_id : string

Logical ID to search

$_type : string|null = null

Command type ('action'|'info'|null)

Return values
array<string|int, static>

Array of commands

byObjectNameCmdName()

Get command by object name and command name

public static byObjectNameCmdName(string $_object_name, string $_cmd_name) : static
Parameters
$_object_name : string

Object name

$_cmd_name : string

Command name

Tags
throws
Exception
Return values
static

Matching command

byObjectNameEqLogicNameCmdName()

Get command by object name, equipment name and command name

public static byObjectNameEqLogicNameCmdName(string $_object_name, string $_eqLogic_name, string $_cmd_name) : static
Parameters
$_object_name : string

Object name

$_eqLogic_name : string

Equipment name

$_cmd_name : string

Command name

Tags
throws
Exception
Return values
static

Matching command

byString()

Get command from string representation

public static byString(string $_string) : static
Parameters
$_string : string

String to convert to command

Tags
throws
ReflectionException
throws
Exception
Return values
static

Command object

byTypeEqLogicNameCmdName()

Get command by equipment type, name and command name

public static byTypeEqLogicNameCmdName(string $_eqType_name, string $_eqLogic_name, string $_cmd_name) : static
Parameters
$_eqType_name : string

Equipment type

$_eqLogic_name : string

Equipment name

$_cmd_name : string

Command name

Tags
throws
Exception
Return values
static

Matching command

byTypeSubType()

Get commands by type and subtype

public static byTypeSubType(string $_type[, string $_subType = '' ]) : array<string|int, static>
Parameters
$_type : string

Command type ('action'|'info')

$_subType : string = ''

Command subtype

Tags
throws
Exception
Return values
array<string|int, static>

Array of matching commands

byValue()

Get commands by value

public static byValue(mixed $_value[, string|null $_type = null ][, bool $_onlyEnable = false ]) : array<string|int, static>
Parameters
$_value : mixed

Value to search

$_type : string|null = null

Command type filter ('action'|'info'|null)

$_onlyEnable : bool = false

Filter on enabled equipment only

Tags
throws
Exception
Return values
array<string|int, static>

Array of matching commands

checkAccessCode()

Check access code

public checkAccessCode(string $_code) : bool
Parameters
$_code : string

Code to verify

Return values
bool

Access granted

checkAlertLevel()

Check alert level for value

public checkAlertLevel(string $_value[, bool $_allowDuring = true ][, string $_checkLevel = 'none' ]) : string
Parameters
$_value : string

Value to check

$_allowDuring : bool = true

Allow duration check

$_checkLevel : string = 'none'

Level to check

Return values
string

Alert level

checkCmdAlert()

Check command alerts

public checkCmdAlert(mixed $_value) : void
Parameters
$_value : mixed

Value to check

checkReturnState()

Check command return state

public checkReturnState(mixed $_value) : void
Parameters
$_value : mixed

Value to check

cleanWidgetCode()

Clean widget code from template and helper content

public cleanWidgetCode(string $_template) : string
Parameters
$_template : string

Widget template code

Return values
string

Cleaned widget code

cmdAlert()

Process command alerts

public static cmdAlert(array<string, int> $_options) : void
Parameters
$_options : array<string, int>

Command options

cmdToHumanReadable()

Replace command IDs with human readable format

public static cmdToHumanReadable(object|array<string, mixed>|string $_input) : object|array<string, mixed>|string
Parameters
$_input : object|array<string, mixed>|string

Input to convert

Tags
throws
ReflectionException
Return values
object|array<string, mixed>|string

Converted input

cmdToValue()

Replace command IDs with their values

public static cmdToValue(object|array<string, mixed>|string $_input[, bool $_quote = false ]) : object|array<string, mixed>|string
Parameters
$_input : object|array<string, mixed>|string

Input to convert

$_quote : bool = false

Quote values

Tags
throws
ReflectionException
Return values
object|array<string, mixed>|string

Converted input

computeInfluxData()

Compute InfluxDB data point

public computeInfluxData(mixed $_value[, string $_timestamp = '' ]) : Point|""
Parameters
$_value : mixed

Value to store

$_timestamp : string = ''

Optional timestamp

Return values
Point|""

InfluxDB point or empty string

convertColor()

Get all distinct command units

public static convertColor(mixed $_color) : array<string|int, string>
Parameters
$_color : mixed
Tags
throws
Exception
Return values
array<string|int, string>

Array of units

deadCmd()

Find commands without valid references

public static deadCmd() : array<string|int, array<string, string>>
Return values
array<string|int, array<string, string>>

List of dead commands

dontRemoveCmd()

Check if command can be removed

public dontRemoveCmd() : bool
Return values
bool

False by default

dropInflux()

Drop InfluxDB database

public dropInflux() : void

dropInfluxDatabase()

Drop InfluxDB database

public dropInfluxDatabase() : void

duringAlertLevel()

Check alert level duration

public static duringAlertLevel(array<string, mixed> $_options) : void
Parameters
$_options : array<string, mixed>

Alert options

Tags
throws
Exception

emptyHistory()

Empty command history

public emptyHistory([string $_date = '' ]) : null
Parameters
$_date : string = ''

Date before which to empty history

Return values
null

Operation result

event()

Process command event

public event(mixed $_value[, string|null $_datetime = null ][, int $_loop = 1 ]) : void
Parameters
$_value : mixed

Event value

$_datetime : string|null = null

Event datetime

$_loop : int = 1

Current loop count

Tags
throws
Exception

execCmd()

Execute command with options

public execCmd([null|string|array<string, mixed> $_options = null ][, bool $_sendNodeJsEvent = false ][, bool $_quote = false ]) : void|string
Parameters
$_options : null|string|array<string, mixed> = null

Execution options

$_sendNodeJsEvent : bool = false

Send NodeJS event

$_quote : bool = false

Quote values

Tags
throws
Exception
Return values
void|string

Command execution result

execute()

Execute command

public execute([array<string, mixed> $_options = array() ]) : bool
Parameters
$_options : array<string, mixed> = array()

Execution options

Return values
bool

Execution status

executeAlertCmdAction()

Execute command alert actions

public executeAlertCmdAction() : void

export()

Export command configuration

public export() : array<string, mixed>
Return values
array<string, mixed>

Exported configuration

exportApi()

Export command data for API

public exportApi() : array<string|int, mixed>|array<string|int, array<string|int, mixed>>
Tags
throws
Exception
Return values
array<string|int, mixed>|array<string|int, array<string|int, mixed>>

Exported data

formatValue()

Format command value according to its configuration

public formatValue(array<string|int, mixed>|object|null|string $_value[, bool $_quote = false ]) : float|int|mixed|string
Parameters
$_value : array<string|int, mixed>|object|null|string

Value to format

$_quote : bool = false

Add quotes around value

Return values
float|int|mixed|string

Formatted value

Generate API URL for ask response

public generateAskResponseLink(string $_response[, string $_plugin = 'core' ][, string $_network = 'external' ]) : string
Parameters
$_response : string

Response value

$_plugin : string = 'core'

Plugin name

$_network : string = 'external'

Network type

Tags
throws
Exception
Return values
string

Generated URL

getAlert()

Get alert configuration

public getAlert([string $_key = '' ][, mixed $_default = '' ]) : array<string, mixed>|mixed
Parameters
$_key : string = ''

Key to get

$_default : mixed = ''

Default value

Return values
array<string, mixed>|mixed

getCache()

Get cache value

public getCache([string $_key = '' ][, mixed $_default = '' ]) : mixed
Parameters
$_key : string = ''

Key to get

$_default : mixed = ''

Default value

getChanged()

Get changed state

public getChanged() : bool
Return values
bool

getCmdValue()

Get associated info command

public getCmdValue() : static|array<string|int, static>|false
Return values
static|array<string|int, static>|false

Associated command(s) or false if none

getCollectDate()

Get collect date

public getCollectDate() : string
Tags
throws
Exception
Return values
string

getConfiguration()

Get configuration value

public getConfiguration([string $_key = '' ][, mixed $_default = '' ]) : array<string, mixed>|mixed
Parameters
$_key : string = ''

Key to get

$_default : mixed = ''

Default value

Return values
array<string, mixed>|mixed

getDirectUrlAccess()

Get direct URL access

public getDirectUrlAccess() : string
Return values
string

Access URL

getDisplay()

Get display configuration

public getDisplay([string $_key = '' ][, mixed $_default = '' ]) : array<string, mixed>|mixed
Parameters
$_key : string = ''

Key to get

$_default : mixed = ''

Default value

Return values
array<string, mixed>|mixed

getEqLogic_id()

Get parent equipment ID

public getEqLogic_id() : int|null
Return values
int|null

getEqType()

Get equipment type

public getEqType() : string|null
Return values
string|null

getEqType_name()

Get equipment type name

public getEqType_name() : string|null
Return values
string|null

getEventOnly()

Get event only status

public getEventOnly() : int
Return values
int

getGeneric_type()

Get command generic type

public getGeneric_type() : string|null
Return values
string|null

getGenericTypeSelectOptions()

Get generic type select options

public getGenericTypeSelectOptions() : string
Return values
string

HTML options string

getHistory()

Get command history

public getHistory([string|null $_dateStart = null ][, string|null $_dateEnd = null ][, string|null $_groupingType = null ][, bool $_addFirstPreviousValue = false ]) : array<string|int, history>
Parameters
$_dateStart : string|null = null

Start date

$_dateEnd : string|null = null

End date

$_groupingType : string|null = null

Grouping type

$_addFirstPreviousValue : bool = false

Include previous value

Return values
array<string|int, history>

History data

getHumanName()

Get human readable name

public getHumanName([bool $_tag = false ][, bool $_prettify = false ]) : string
Parameters
$_tag : bool = false

Include HTML tags

$_prettify : bool = false

Prettify output

Return values
string

Human readable name

getId()

Get command ID

public getId() : int|""
Return values
int|""

getInflux()

Get InfluxDB connection

public static getInflux([int|null $_cmdId = null ]) : Database|string|void
Parameters
$_cmdId : int|null = null

Command ID

Return values
Database|string|void

InfluxDB connection

getIsHistorized()

Get historization state

public getIsHistorized() : int
Return values
int

getIsVisible()

Get visibility state

public getIsVisible() : int
Return values
int

getLastHistory()

Get last history entry

public getLastHistory(string $_time[, bool $_previous = true ]) : array<string, mixed>
Parameters
$_time : string

Reference time

$_previous : bool = true

Include previous value

Return values
array<string, mixed>

History data with value and unit

getLastValue()

Get last stored value

public getLastValue() : mixed|array<string|int, mixed>
Return values
mixed|array<string|int, mixed>

Last value

getLinkData()

Get command dependency graph data

public getLinkData([array<string, array<string, array<string, mixed>>> &$_data = array('node' => array(), 'link' => array()) ][, int $_level = 0 ][, string|null $_drill = null ]) : array<string|int, array<string|int, mixed>>|mixed|void
Parameters
$_data : array<string, array<string, array<string, mixed>>> = array('node' => array(), 'link' => array())

Existing graph data

$_level : int = 0

Current graph level

$_drill : string|null = null

Maximum drill level

Return values
array<string|int, array<string|int, mixed>>|mixed|void

Graph data

getLogicalId()

Get logical ID

public getLogicalId() : int|null
Return values
int|null

getName()

Get command name

public getName() : string|null
Return values
string|null

getOldest()

Get oldest history entries

public getOldest() : array<string|int, historyArch>
Return values
array<string|int, historyArch>

Array of oldest history entries

getOrder()

Get display order

public getOrder() : int
Return values
int

getPluralityHistory()

Get history with multiple points

public getPluralityHistory([string|null $_dateStart = null ][, string|null $_dateEnd = null ][, string $_period = 'day' ][, int $_offset = 0 ]) : array<string|int, history>
Parameters
$_dateStart : string|null = null

Start date

$_dateEnd : string|null = null

End date

$_period : string = 'day'

Period type

$_offset : int = 0

Time offset

Tags
throws
Exception
Return values
array<string|int, history>

Array of history points

getSelectOptionsByTypeAndSubtype()

Get widget selection options by type and subtype

public static getSelectOptionsByTypeAndSubtype([string|false $_type = false ][, string|false $_subtype = false ][, string $_version = 'dashboard' ][, bool $_availWidgets = false ]) : int|string
Parameters
$_type : string|false = false

Command type ('action'|'info'|false)

$_subtype : string|false = false

Command subtype

$_version : string = 'dashboard'

Widget version

$_availWidgets : bool = false

Pre-loaded available widgets

Tags
throws
Exception
Return values
int|string

Options HTML string or error code

getStatistique()

Get command statistics

public getStatistique(string $_startTime, string $_endTime) : array<string, mixed>
Parameters
$_startTime : string

Start date

$_endTime : string

End date

Return values
array<string, mixed>

Statistics data

getSubType()

Get command subtype

public getSubType() : string|null
Return values
string|null

'binary'|'numeric'|'message'|'color'|'slider'|'string'

getTableName()

Get database table name

public getTableName() : string
Return values
string

Table name

getTemplate()

Get template configuration

public getTemplate([string $_key = '' ][, mixed $_default = '' ]) : mixed|array<string, mixed>
Parameters
$_key : string = ''

Key to get

$_default : mixed = ''

Default value

Return values
mixed|array<string, mixed>

getTemporalAvg()

Get temporal average

public getTemporalAvg(string $_startTime, string $_endTime) : array<string|int, mixed>|float|int
Parameters
$_startTime : string

Start date

$_endTime : string

End date

Return values
array<string|int, mixed>|float|int

Average value

getTendance()

Get value trend

public getTendance(string $_startTime, string $_endTime) : float
Parameters
$_startTime : string

Start date

$_endTime : string

End date

Return values
float

Trend value

getType()

Get command type

public getType() : string|null
Return values
string|null

'action'|'info'|'string'

getUnite()

Get command unit

public getUnite() : string
Return values
string

getUse()

Get elements used by this command

public getUse() : array<string, array<int, object>>
Return values
array<string, array<int, object>>

List of used elements

getUsedBy()

Get elements using this command

public getUsedBy([bool $_array = false ]) : array<string, array<int, object>>
Parameters
$_array : bool = false

Return as array instead of objects

Return values
array<string, array<int, object>>

List of using elements

getValue()

Get command value

public getValue() : mixed|null
Return values
mixed|null

getValueDate()

Get value date

public getValueDate() : string
Tags
throws
Exception
Return values
string

getWidgetHelp()

Get widget help text

public getWidgetHelp([string $_version = 'dashboard' ][, string $_widgetName = '' ]) : string
Parameters
$_version : string = 'dashboard'

Widget version

$_widgetName : string = ''

Widget name

Return values
string

Help text

getWidgetsSelectOptions()

Get widget select options for version

public getWidgetsSelectOptions([string $_version = 'dashboard' ][, bool $_availWidgets = false ]) : string
Parameters
$_version : string = 'dashboard'

Widget version

$_availWidgets : bool = false

Pre-loaded available widgets

Tags
throws
Exception
Return values
string

HTML options string

getWidgetTemplateCode()

Get widget template code

public getWidgetTemplateCode([string $_version = 'dashboard' ][, bool $_clean = true ][, string $_widgetName = '' ]) : array<string, mixed>
Parameters
$_version : string = 'dashboard'

Widget version

$_clean : bool = true

Clean template code

$_widgetName : string = ''

Widget name

Return values
array<string, mixed>

Widget template data

hasRight()

Check command access rights

public hasRight([user|null $_user = null ]) : bool
Parameters
$_user : user|null = null

User to check

Return values
bool

Access granted

historyInflux()

Send command history to InfluxDB

public historyInflux([string $_type = '' ]) : void
Parameters
$_type : string = ''

Type of history to send

historyInfluxAll()

Send all history to InfluxDB

public historyInfluxAll() : void

humanReadableToCmd()

Replace human readable format with command IDs

public static humanReadableToCmd(string|object|array<string, mixed>|int|bool|null $_input) : array<string|int, mixed>|bool|int|mixed|string|array<string|int, string>|null
Parameters
$_input : string|object|array<string, mixed>|int|bool|null

Input to convert

Tags
throws
ReflectionException
Return values
array<string|int, mixed>|bool|int|mixed|string|array<string|int, string>|null

Converted input

isAlreadyInStateAllow()

Check if command is already in desired state

public isAlreadyInStateAllow() : bool
Return values
bool

State check result

isHistorized()

Get historized commands

public static isHistorized([bool $_state = true ]) : array<string|int, static>
Parameters
$_state : bool = true

Historization state to filter

Tags
throws
Exception
Return values
array<string|int, static>

Array of commands

migrateCmd()

Migrate command configuration to another command

public static migrateCmd(int $_sourceId, int $_targetId) : static
Parameters
$_sourceId : int

Source command ID

$_targetId : int

Target command ID

Tags
throws
Exception
Return values
static

Migrated command

postExecCmd()

Execute post-command actions

public postExecCmd([array<string, string> $_values = array() ]) : void
Parameters
$_values : array<string, string> = array()

Action values

preExecCmd()

Execute pre-command actions

public preExecCmd([array<string, string> $_values = array() ]) : void
Parameters
$_values : array<string, string> = array()

Action values

pushInflux()

Push value to InfluxDB

public pushInflux([mixed $_value = null ]) : void
Parameters
$_value : mixed = null

Value to push

pushUrl()

Push command value to configured URL

public pushUrl(string $_value) : void
Parameters
$_value : string

Value to push

refresh()

Refresh command from database

public refresh() : void
Tags
throws
Exception

remove()

Remove command

public remove() : bool
Return values
bool

Success status

returnState()

Return state after delay

public static returnState(array<string, int> $_options) : void
Parameters
$_options : array<string, int>

Command options

save()

Save command to database

public save([bool $_direct = false ]) : bool
Parameters
$_direct : bool = false

Direct save without trigger

Tags
throws
Exception
Return values
bool

Success status

searchByString()

Search commands by string

public static searchByString(string $_search) : array<string|int, static>
Parameters
$_search : string

Search string

Return values
array<string|int, static>

Array of matching commands

searchConfiguration()

Search commands by configuration

public static searchConfiguration(string|array<string|int, string> $_configuration[, string $_eqType = null ]) : array<string|int, static>
Parameters
$_configuration : string|array<string|int, string>

Configuration to search

$_eqType : string = null

Equipment type filter

Return values
array<string|int, static>

Array of matching commands

searchConfigurationEqLogic()

Search commands by equipment configuration

public static searchConfigurationEqLogic(int $_eqLogic_id, string $_configuration[, string|null $_type = null ]) : array<string|int, static>
Parameters
$_eqLogic_id : int

Equipment ID

$_configuration : string

Configuration to search

$_type : string|null = null

Command type filter ('action'|'info'|null)

Tags
throws
Exception
Return values
array<string|int, static>

Array of matching commands

searchDisplay()

Search commands by display configuration

public static searchDisplay(array<string|int, string>|string $_display[, string|null $_eqType = null ]) : array<string|int, static>
Parameters
$_display : array<string|int, string>|string

Display configuration to search

$_eqType : string|null = null

Equipment type filter

Tags
throws
Exception
Return values
array<string|int, static>

Array of matching commands

searchTemplate()

Search commands by template

public static searchTemplate(string $_template[, string|null $_eqType = null ][, string|null $_type = null ][, string|null $_subtype = null ]) : array<string|int, static>
Parameters
$_template : string

Template to search

$_eqType : string|null = null

Equipment type filter

$_type : string|null = null

Command type filter ('action'|'info'|null)

$_subtype : string|null = null

Command subtype filter

Tags
throws
Exception
Return values
array<string|int, static>

Array of matching commands

sendHistoryInflux()

Send history to InfluxDB

public static sendHistoryInflux(array<string, string|int> $_params) : void
Parameters
$_params : array<string, string|int>

Parameters for history transfer

Tags
throws
Exception

setAlert()

Set alert configuration

public setAlert(string $_key, mixed $_value) : static
Parameters
$_key : string

Key to set

$_value : mixed

Value to set

Return values
static

setCache()

Set cache value

public setCache(string $_key[, mixed|null $_value = null ]) : static
Parameters
$_key : string

Key to set

$_value : mixed|null = null

Value to set

Return values
static

setChanged()

Set changed state

public setChanged(bool $_changed) : static
Parameters
$_changed : bool

State to set

Return values
static

setCollectDate()

Set collect date

public setCollectDate(string $_collectDate) : static
Parameters
$_collectDate : string

Date to set

Return values
static

setConfiguration()

Set configuration value

public setConfiguration(array<string, mixed>|string|int $_key, mixed $_value) : static
Parameters
$_key : array<string, mixed>|string|int
$_value : mixed

Value to set

Return values
static

setDisplay()

Set display configuration

public setDisplay(string $_key, mixed $_value) : static
Parameters
$_key : string

Key to set

$_value : mixed

Value to set

Return values
static

setEqLogic()

Set parent equipment object

public setEqLogic(eqLogic|null $_eqLogic) : static
Parameters
$_eqLogic : eqLogic|null

Parent equipment

Return values
static

setEqLogic_id()

Set parent equipment ID

public setEqLogic_id(int|"" $_eqLogic_id) : static
Parameters
$_eqLogic_id : int|""

Equipment ID to set

Return values
static

setEqType()

Set equipment type

public setEqType(string $_eqType) : static
Parameters
$_eqType : string

Type to set

Return values
static

setGeneric_type()

Set command generic type

public setGeneric_type(string $_generic_type) : static
Parameters
$_generic_type : string

Generic type to set

Return values
static

setId()

Set command ID

public setId([int|"" $_id = '' ]) : static
Parameters
$_id : int|"" = ''

ID to set

Return values
static

setIsHistorized()

Set historization state

public setIsHistorized(int $_isHistorized) : static
Parameters
$_isHistorized : int

State to set

Return values
static

setIsVisible()

Set visibility state

public setIsVisible(int $isVisible) : static
Parameters
$isVisible : int

State to set

Return values
static

setLogicalId()

Set logical ID

public setLogicalId(int $_logicalId) : static
Parameters
$_logicalId : int

ID to set

Return values
static

setName()

Set command name

public setName(string $_name) : static
Parameters
$_name : string

Name to set

Return values
static

setOrder()

Set display order

public setOrder(int $order) : static
Parameters
$order : int

Order to set

Return values
static

setSubType()

Set command subtype

public setSubType(string $_subType) : static
Parameters
$_subType : string

Subtype to set

Return values
static

setTemplate()

Set template configuration

public setTemplate(string $_key, mixed $_value) : static
Parameters
$_key : string

Key to set

$_value : mixed

Value to set

Return values
static

setType()

Set command type

public setType(string $_type) : static
Parameters
$_type : string

Type to set

Return values
static

setUnite()

Set command unit

public setUnite(string $_unite) : static
Parameters
$_unite : string

Unit to set

Return values
static

setValue()

Set command value

public setValue(mixed|null $_value) : static
Parameters
$_value : mixed|null

Value to set

Return values
static

setValueDate()

Set value date

public setValueDate(string $_valueDate) : static
Parameters
$_valueDate : string

Date to set

Return values
static

toHtml()

Generate HTML representation

public toHtml([string $_version = 'dashboard' ][, mixed $_options = '' ]) : string
Parameters
$_version : string = 'dashboard'

Template version

$_options : mixed = ''

Widget options

Tags
throws
Exception
Return values
string

HTML code

widgetPossibility()

Check widget customization possibilities

public widgetPossibility([string $_key = '' ][, bool $_default = true ]) : array<string, bool>|bool|mixed
Parameters
$_key : string = ''

Feature key to check

$_default : bool = true

Default value if not found

Tags
throws
ReflectionException
Return values
array<string, bool>|bool|mixed

Feature availability

autoValueFormat()

Format value based on modulo

private static autoValueFormat(int|float $_value[, int|float $_mod = 1000 ][, int|float $_maxdiv = 10 ]) : array<string|int, int|float>
Parameters
$_value : int|float

Value to format

$_mod : int|float = 1000

Modulo value

$_maxdiv : int|float = 10

Maximum division

Return values
array<string|int, int|float>

Formatted value array

cast()

Cast an object or array of objects to specific command type

private static cast(object|array<string|int, static> $_inputs[, eqLogic|null $_eqLogic = null ]) : static|array<string|int, static>
Parameters
$_inputs : object|array<string|int, static>

Objects to cast

$_eqLogic : eqLogic|null = null

Parent equipment

Return values
static|array<string|int, static>

Casted object(s)

pre_postExecCmd()

Execute pre/post command actions

private pre_postExecCmd([array<string, string> $_values = array() ][, string $_type = 'jeedomPreExecCmd' ]) : void
Parameters
$_values : array<string, string> = array()

Action values

$_type : string = 'jeedomPreExecCmd'

Action type ('jeedomPreExecCmd'|'jeedomPostExecCmd')


        
On this page

Search results