Unify Framework UCL MQTT Reference 1.7.0
All Files Pages
OnOff Cluster

The following commands and attributes are accepted as JSON payloads for the OnOff cluster.



OnOff Attributes

The following attribute topics are used to retrieve the OnOff cluster state.


OnOff/OnOff Attribute

MQTT Topic Pattern:

[PREFIX]/OnOff/Attributes/OnOff/Reported
[PREFIX]/OnOff/Attributes/OnOff/Desired

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster OnOff Attribute Properties",
"type": "object",
"properties": {
"value": {
"type": "boolean"
}
},
"required": [
"value"
]
}

Example Mosquitto CLI Tool Usage

To see desired/reported value for OnOff attribute under the by-unid topic space:

mosquitto_sub -t 'ucl/by-unid/+/+/OnOff/Attributes/OnOff/+'
# Example output
ucl/by-unid/<UNID>/ep0/OnOff/Attributes/OnOff/Desired { "value": <DESIRED_ON_OFF>}
ucl/by-unid/<UNID>/ep0/OnOff/Attributes/OnOff/Reported { "value": <REPORTED_ON_OFF>}



OnOff/GlobalSceneControl Attribute

MQTT Topic Pattern:

[PREFIX]/OnOff/Attributes/GlobalSceneControl/Reported
[PREFIX]/OnOff/Attributes/GlobalSceneControl/Desired

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster GlobalSceneControl Attribute Properties",
"type": "object",
"properties": {
"value": {
"type": "boolean"
}
},
"required": [
"value"
]
}

Example Mosquitto CLI Tool Usage

To see desired/reported value for GlobalSceneControl attribute under the by-unid topic space:

mosquitto_sub -t 'ucl/by-unid/+/+/OnOff/Attributes/GlobalSceneControl/+'
# Example output
ucl/by-unid/<UNID>/ep0/OnOff/Attributes/GlobalSceneControl/Desired { "value": <DESIRED_GLOBAL_SCENE_CONTROL>}
ucl/by-unid/<UNID>/ep0/OnOff/Attributes/GlobalSceneControl/Reported { "value": <REPORTED_GLOBAL_SCENE_CONTROL>}



OnOff/OnTime Attribute

MQTT Topic Pattern:

[PREFIX]/OnOff/Attributes/OnTime/Reported
[PREFIX]/OnOff/Attributes/OnTime/Desired

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster OnTime Attribute Properties",
"type": "object",
"properties": {
"value": {
"type": "integer"
}
},
"required": [
"value"
]
}

Example Mosquitto CLI Tool Usage

To see desired/reported value for OnTime attribute under the by-unid topic space:

mosquitto_sub -t 'ucl/by-unid/+/+/OnOff/Attributes/OnTime/+'
# Example output
ucl/by-unid/<UNID>/ep0/OnOff/Attributes/OnTime/Desired { "value": <DESIRED_ON_TIME>}
ucl/by-unid/<UNID>/ep0/OnOff/Attributes/OnTime/Reported { "value": <REPORTED_ON_TIME>}



OnOff/OffWaitTime Attribute

MQTT Topic Pattern:

[PREFIX]/OnOff/Attributes/OffWaitTime/Reported
[PREFIX]/OnOff/Attributes/OffWaitTime/Desired

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster OffWaitTime Attribute Properties",
"type": "object",
"properties": {
"value": {
"type": "integer"
}
},
"required": [
"value"
]
}

Example Mosquitto CLI Tool Usage

To see desired/reported value for OffWaitTime attribute under the by-unid topic space:

mosquitto_sub -t 'ucl/by-unid/+/+/OnOff/Attributes/OffWaitTime/+'
# Example output
ucl/by-unid/<UNID>/ep0/OnOff/Attributes/OffWaitTime/Desired { "value": <DESIRED_OFF_WAIT_TIME>}
ucl/by-unid/<UNID>/ep0/OnOff/Attributes/OffWaitTime/Reported { "value": <REPORTED_OFF_WAIT_TIME>}



OnOff/StartUpOnOff Attribute

MQTT Topic Pattern:

[PREFIX]/OnOff/Attributes/StartUpOnOff/Reported
[PREFIX]/OnOff/Attributes/StartUpOnOff/Desired

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster StartUpOnOff Attribute Properties",
"type": "object",
"properties": {
"value": {
"type": "OnOffStartUpOnOff"
}
},
"required": [
"value"
]
}

Example Mosquitto CLI Tool Usage

To see desired/reported value for StartUpOnOff attribute under the by-unid topic space:

mosquitto_sub -t 'ucl/by-unid/+/+/OnOff/Attributes/StartUpOnOff/+'
# Example output
ucl/by-unid/<UNID>/ep0/OnOff/Attributes/StartUpOnOff/Desired { "value": <DESIRED_START_UP_ON_OFF>}
ucl/by-unid/<UNID>/ep0/OnOff/Attributes/StartUpOnOff/Reported { "value": <REPORTED_START_UP_ON_OFF>}



OnOff/ClusterRevision Attribute

MQTT Topic Pattern:

[PREFIX]/OnOff/Attributes/ClusterRevision/Reported
[PREFIX]/OnOff/Attributes/ClusterRevision/Desired

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster ClusterRevision Attribute Properties",
"type": "object",
"properties": {
"value": {
"type": "integer"
}
},
"required": [
"value"
]
}

Example Mosquitto CLI Tool Usage

To see desired/reported value for ClusterRevision attribute under the by-unid topic space:

mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/Attributes/ClusterRevision/+'
# Example output
ucl/by-unid/<UNID>/<EP>/OnOff/Attributes/ClusterRevision/Desired { "value": <DESIRED_CLUSTER_REVISION> }
ucl/by-unid/<UNID>/<EP>/OnOff/Attributes/ClusterRevision/Reported { "value": <REPORTED_CLUSTER_REVISION> }



OnOff Command Support

MQTT Topic Pattern:

[PREFIX]/OnOff/SupportedCommands
[PREFIX]/OnOff/SupportedGeneratedCommands

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Command Support Properties",
"type": "object",
"properties": {
"value": {
"type": "array",
"items" : {
"type": "string",
"enum": [
"Off",
"On",
"Toggle",
"OffWithEffect",
"OnWithRecallGlobalScene",
"OnWithTimedOff",
"WriteAttributes",
"ForceReadAttributes"
]
}
}
}
},
"required": [
"value"
]
}

Example Mosquitto CLI Tool Usage

To see supported commands for OnOff cluster under the by-unid topic space:

mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/SupportedCommands'
# Example output
ucl/by-unid/<UNID>/<EP>/OnOff/SupportedCommands { "value": ["Off","On","Toggle","OffWithEffect","OnWithRecallGlobalScene","OnWithTimedOff","WriteAttributes", "ForceReadAttributes"] }

To see supported generated commands for OnOff cluster under the by-unid topic space:

mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/SupportedGeneratedCommands'
# Example output
ucl/by-unid/<UNID>/<EP>/OnOff/SupportedGeneratedCommands { "value": [] }



OnOff Commands



OnOff/Off Command

MQTT Topic Pattern:

[PREFIX]/OnOff/Commands/Off
[PREFIX]/OnOff/GeneratedCommands/Off

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster Off Command Properties",
"type": "object",
"properties": {
},
"required": [
]
}

Example Mosquitto CLI Tool Usage

To send a OnOff/Off command under the by-unid topic space:

mosquitto_pub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/Commands/Off' -m '{ }'

To receive a OnOff/Off generated command from a UNID/endpoint:

mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/GeneratedCommands/Off'



OnOff/On Command

MQTT Topic Pattern:

[PREFIX]/OnOff/Commands/On
[PREFIX]/OnOff/GeneratedCommands/On

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster On Command Properties",
"type": "object",
"properties": {
},
"required": [
]
}

Example Mosquitto CLI Tool Usage

To send a OnOff/On command under the by-unid topic space:

mosquitto_pub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/Commands/On' -m '{ }'

To receive a OnOff/On generated command from a UNID/endpoint:

mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/GeneratedCommands/On'



OnOff/Toggle Command

MQTT Topic Pattern:

[PREFIX]/OnOff/Commands/Toggle
[PREFIX]/OnOff/GeneratedCommands/Toggle

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster Toggle Command Properties",
"type": "object",
"properties": {
},
"required": [
]
}

Example Mosquitto CLI Tool Usage

To send a OnOff/Toggle command under the by-unid topic space:

mosquitto_pub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/Commands/Toggle' -m '{ }'

To receive a OnOff/Toggle generated command from a UNID/endpoint:

mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/GeneratedCommands/Toggle'



OnOff/OffWithEffect Command

MQTT Topic Pattern:

[PREFIX]/OnOff/Commands/OffWithEffect
[PREFIX]/OnOff/GeneratedCommands/OffWithEffect

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster OffWithEffect Command Properties",
"type": "object",
"properties": {
"EffectIdentifier": {
"type": "OffWithEffectEffectIdentifier"
},
"EffectVariant": {
"type": "integer"
}
},
"required": [
"EffectIdentifier",
"EffectVariant"
]
}

Example Mosquitto CLI Tool Usage

To send a OnOff/OffWithEffect command under the by-unid topic space:

mosquitto_pub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/Commands/OffWithEffect' -m '{ "EffectIdentifier": <EFFECT_IDENTIFIER_VALUE>,"EffectVariant": <EFFECT_VARIANT_VALUE> }'

To receive a OnOff/OffWithEffect generated command from a UNID/endpoint:

mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/GeneratedCommands/OffWithEffect'



OnOff/OnWithRecallGlobalScene Command

MQTT Topic Pattern:

[PREFIX]/OnOff/Commands/OnWithRecallGlobalScene
[PREFIX]/OnOff/GeneratedCommands/OnWithRecallGlobalScene

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster OnWithRecallGlobalScene Command Properties",
"type": "object",
"properties": {
},
"required": [
]
}

Example Mosquitto CLI Tool Usage

To send a OnOff/OnWithRecallGlobalScene command under the by-unid topic space:

mosquitto_pub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/Commands/OnWithRecallGlobalScene' -m '{ }'

To receive a OnOff/OnWithRecallGlobalScene generated command from a UNID/endpoint:

mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/GeneratedCommands/OnWithRecallGlobalScene'



OnOff/OnWithTimedOff Command

MQTT Topic Pattern:

[PREFIX]/OnOff/Commands/OnWithTimedOff
[PREFIX]/OnOff/GeneratedCommands/OnWithTimedOff

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster OnWithTimedOff Command Properties",
"type": "object",
"properties": {
"OnOffControl": {
"type": "OnWithTimedOffOnOffControl"
},
"OnTime": {
"type": "integer"
},
"OffWaitTime": {
"type": "integer"
}
},
"required": [
"OnOffControl",
"OnTime",
"OffWaitTime"
]
}

Example Mosquitto CLI Tool Usage

To send a OnOff/OnWithTimedOff command under the by-unid topic space:

mosquitto_pub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/Commands/OnWithTimedOff' -m '{ "OnOffControl": <ON_OFF_CONTROL_VALUE>,"OnTime": <ON_TIME_VALUE>,"OffWaitTime": <OFF_WAIT_TIME_VALUE> }'

To receive a OnOff/OnWithTimedOff generated command from a UNID/endpoint:

mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/GeneratedCommands/OnWithTimedOff'



OnOff/WriteAttributes Command

MQTT Topic Pattern:

[PREFIX]/OnOff/Commands/WriteAttributes

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster WriteAttributes Command Properties",
"type": "object",
"properties": {
"OnTime": {
"type": "integer"
},
"OffWaitTime": {
"type": "integer"
},
"StartUpOnOff": {
"type": "OnOffStartUpOnOff"
}
},
"required": [
"value"
]
}

Example Mosquitto CLI Tool Usage

To update all OnOff attributes under the by-unid topic space:

mosquitto_pub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/Commands/WriteAttributes' -m '{ "OnTime": <ON_TIME_VALUE> ,"OffWaitTime": <OFF_WAIT_TIME_VALUE> ,"StartUpOnOff": <START_UP_ON_OFF_VALUE> }'

‍NOTE: Specify only the list of attributes to write in this command. Unspecified attributes will not be updated.



OnOff/ForceReadAttributes Command

MQTT Topic Pattern:

[PREFIX]/OnOff/Commands/ForceReadAttributes

MQTT Payload JSON Schema:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "OnOff Cluster ForceReadAttributes Command Properties",
"type": "object",
"properties": {
"value": {
"type": "array"
"items": {
"type": "string",
"enum": [
"OnOff",
"GlobalSceneControl",
"OnTime",
"OffWaitTime",
"StartUpOnOff"
]
}
}
},
"required": [
"value"
]
}

Example Mosquitto CLI Tool Usage

To force read all OnOff attributes under the by-unid topic space (by sending an empty array):

mosquitto_pub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/Commands/ForceReadAttributes' -m '{ "value": [] }'

To force read one of the OnOff attributes under the by-unid topic space:

mosquitto_pub -t 'ucl/by-unid/<UNID>/<EP>/OnOff/Commands/ForceReadAttributes' -m '{ "value": ["OnOff"] }'