|  Developer
Updated on March 28, 2023

gateway

  • Defines main information about supported protocol/gateway.
  • If plugin has type then this field should be defined. Plugin can have only one gateway and all created devices by this plugin will have connection with described gateway.
  • The firmware adds defined gateway automatically after installing of plugin and removes it after uninstalling of plugin.

Required : only if type of plugin is

Type :


gateway/name

  • Short name of gateway or plugin.

Required : yes

Type : string


gateway/label

  • Full name of gateway or plugin.

Required : yes

Type : string


gateway/setItemValueResponsePolicy

  • Linux firmware only
  • Defines main logic of sending answer on the hub.item.value.set request for the plugin.

Required : no

Possible values:

  • — that response on hub.item.value.set request will be send by firmware immediately after request was received.
  • — plugin is responsible for sending response on the hub.item.value.set request. When gateway/setItemValueCommand script is executed for item with custom policy additional (3rd) parameter is added: (string). Plugin is responsible to call core.send_response() method with this in order to send response on value set request. If plugin was unable to send response withing 2 minutes then firmware will send timeout error as answer on this call.
Default value :

gateway/forceRemoveDeviceCommand

  • hub.device.force_remove request for devices of the plugin will be redirected to the defined script.
  • Remove a device from the controller.

Required : no

signature :

Field Type Required Description
device_id string + Device object id

gateway/checkDeviceCommand

  • hub.device.check request for devices of the plugin will be redirected to the defined script.
  • Force request of latest values or status of device.

Required : no

signature :

Field Type Required Description
device_id string + Device object id
check string Sync values with physical device or check status of device (reachable or not). Possible values: , . If this field is not defined than value and status should be checked.
items array of strings Ids of items which values need to check. If this field is not defined than all values should be checked.

gateway/setItemValueCommand

  • hub.item.value.set request for items of the plugin will be redirected to the defined script.
  • One of parameters “item_id” or “item_ids” should be specified.

Required: yes

signature:

Field Type Required Description
item_id string Item object id
item_ids array of strings List of items to send multicast request
value depends on item type + New item value.

gateway/addItemDictionaryValueCommand

  • hub.item.dictionary.value.add request for items of the plugin will be redirected to the defined script.
  • Adds new value to dictionary type of items.

Required: no

signature:

Field Type Required Description
item_id string + Item object id
value_type strings + Type of value in dictionary
value depends on item type + Value to add

gateway/setItemDictionaryValueCommand

Required: no

signature:

Field Type Required Description
item_id string + Item object id
value_type strings + Type of value in dictionary
value depends on item type + Value to add

gateway/removeItemDictionaryValueCommand

Required: no

signature:

Field Type Required Description
item_id string + Item object id
key string + Dictionary record id

gateway/clearItemDictionaryCommand

  • hub.item.dictionary.clear request for items of the plugin will be redirected to the defined script.
  • Delete all records of dictionary

Required: no

signature:

Field Type Required Description
item_id string + Item object id

gateway/resetSettingCommand

  • hub.device.setting.reset request for device settings of the plugin will be redirected to the defined script.
  • Reset setting to default.
  • One of and parameters should be specified, takes precedence.

Required: no

signature:

Field Type Required Description
setting_id string Setting object id
device_id string Device object id

gateway/setSettingValueCommand

Required: no

signature:

Field Type Required Description
setting_id string + Setting object id
value depends on setting type Value to set. Not required for action settings.

gateway/setSettingDictionaryValueCommand

Required: no

signature:

Field Type Required Description
setting_id string + Setting object id
key string + Record id
value depends on setting type Value to set. If not specified, dictionary record should be deleted.

gateway/updateDeviceFirmwareCommand

  • hub.devices.firmware.update request for device of the plugin will be redirected to the defined script.
  • Start updating of smart device firmware.

Required: no

signature:

Field Type Required Description
setting_id string + Setting object id
key string + Record id
value depends on setting type Value to set. If not specified, dictionary record should be deleted.

gateway/createAbstractSubscriptionCommand

Required: no

signature:

Field Type Required Description
request object + Forwarded original request

gateway/updateAbstractSubscriptionCommand

Required: no

signature:

Field Type Required Description
request object + Forwarded original request
subscriptionRecord object + Database record of the abstract subscription
mappingOperations object + Dictionary of update operations for abstract subscription mappings
mappingOperations.add object List of capability,variable pairs to add
mappingOperations.update object List of capability,variable pairs to update
mappingOperations.remove object List of capability,variable pairs to remove
mappingOperations.keep object List of capability,variable pairs to keep

gateway/deleteAbstractSubscriptionCommand

Required: no

signature:

Field Type Required Description
request object + Forwarded original request
subscriptionRecord object + Database record of the abstract subscription

gateway/dispatchAbstractSubscriptionCommand

  • Request to dispatch abstract subscription data from Abstract Subscriptions mechanism to a corresponding gateway forwarded by hub.cloud.subscription.dispatch.
  • Updates value of an abstract subscription. Can be used to hande data that doesn’t correspond to the Item Value Types system.

Required: no

signature:

Field Type Required Description
gatewayName string + A gateway name to redirect request to.
_id string + An item identifier to which the payload belongs to. Should belong to the gateway pointed by the parameter.
value any + A payload from Abstract Subscriptions mechanism to update the item.