nymea/tests/auto/api.json

764 lines
24 KiB
JSON

26
{
"methods": {
"Actions.ExecuteAction": {
"description": "Execute a single action.",
"params": {
"actionTypeId": "Uuid",
"deviceId": "Uuid",
"o:params": [
"$ref:Param"
]
},
"returns": {
"deviceError": "$ref:DeviceError"
}
},
"Actions.GetActionType": {
"description": "Get the ActionType for the given ActionTypeId",
"params": {
"actionTypeId": "Uuid"
},
"returns": {
"deviceError": "$ref:DeviceError",
"o:actionType": {
"id": "Uuid",
"name": "Uuid",
"paramTypes": [
"$ref:ParamType"
]
}
}
},
"Devices.AddConfiguredDevice": {
"description": "Add a configured device with a setupMethod of SetupMethodJustAdd. For devices with a setupMethod different than SetupMethodJustAdd, use PairDevice. Use deviceDescriptorId or deviceParams, depending on the createMethod of the device class. CreateMethodJustAdd takes the parameters you want to have with that device. CreateMethodDiscovery requires the use of a deviceDescriptorId.",
"params": {
"deviceClassId": "Uuid",
"o:deviceDescriptorId": "Uuid",
"o:deviceParams": [
"$ref:Param"
]
},
"returns": {
"deviceError": "$ref:DeviceError",
"o:deviceId": "Uuid"
}
},
"Devices.ConfirmPairing": {
"description": "Confirm an ongoing pairing. In case of SetupMethodEnterPin also provide the pin in the params.",
"params": {
"o:secret": "String",
"pairingTransactionId": "Uuid"
},
"returns": {
"deviceError": "$ref:DeviceError",
"o:deviceId": "Uuid"
}
},
"Devices.EditDevice": {
"description": "Edit the parameters of a device. The device params will be set to the passed parameters and the setup device will be called. If the device is discoverable, you can perform a GetDiscoveredDevices before calling this method and pass the new DeviceDescriptor (rediscover). If a parameter is not writable, you will find a 'readOnly': true in the ParamType. By default, every Param is writable.",
"params": {
"deviceId": "Uuid",
"o:deviceDescriptorId": "Uuid",
"o:deviceParams": [
"$ref:Param"
]
},
"returns": {
"deviceError": "$ref:DeviceError"
}
},
"Devices.GetActionTypes": {
"description": "Get action types for a specified deviceClassId.",
"params": {
"deviceClassId": "Uuid"
},
"returns": {
"actionTypes": [
"$ref:ActionType"
]
}
},
"Devices.GetConfiguredDevices": {
"description": "Returns a list of configured devices.",
"params": {
},
"returns": {
"devices": [
"$ref:Device"
]
}
},
"Devices.GetDiscoveredDevices": {
"description": "Performs a device discovery and returns the results. This function may take a while to return.",
"params": {
"deviceClassId": "Uuid",
"o:discoveryParams": [
"$ref:Param"
]
},
"returns": {
"deviceError": "$ref:DeviceError",
"o:deviceDescriptors": [
"$ref:DeviceDescriptor"
]
}
},
"Devices.GetEventTypes": {
"description": "Get event types for a specified deviceClassId.",
"params": {
"deviceClassId": "Uuid"
},
"returns": {
"eventTypes": [
"$ref:EventType"
]
}
},
"Devices.GetPluginConfiguration": {
"description": "Get a plugin's params.",
"params": {
"pluginId": "Uuid"
},
"returns": {
"deviceError": "$ref:DeviceError",
"o:configuration": [
"$ref:Param"
]
}
},
"Devices.GetPlugins": {
"description": "Returns a list of loaded plugins.",
"params": {
},
"returns": {
"plugins": [
"$ref:Plugin"
]
}
},
"Devices.GetStateTypes": {
"description": "Get state types for a specified deviceClassId.",
"params": {
"deviceClassId": "Uuid"
},
"returns": {
"stateTypes": [
"$ref:StateType"
]
}
},
"Devices.GetStateValue": {
"description": "Get the value of the given device and the given stateType",
"params": {
"deviceId": "Uuid",
"stateTypeId": "Uuid"
},
"returns": {
"deviceError": "$ref:DeviceError",
"o:value": "Variant"
}
},
"Devices.GetStateValues": {
"description": "Get all the state values of the given device.",
"params": {
"deviceId": "Uuid"
},
"returns": {
"deviceError": "$ref:DeviceError",
"o:values": [
{
"stateTypeId": "Uuid",
"value": "Variant"
}
]
}
},
"Devices.GetSupportedDevices": {
"description": "Returns a list of supported Device classes, optionally filtered by vendorId.",
"params": {
"o:vendorId": "Uuid"
},
"returns": {
"deviceClasses": [
"$ref:DeviceClass"
]
}
},
"Devices.GetSupportedVendors": {
"description": "Returns a list of supported Vendors.",
"params": {
},
"returns": {
"vendors": [
"$ref:Vendor"
]
}
},
"Devices.PairDevice": {
"description": "Pair a device. Use this for DeviceClasses with a setupMethod different than SetupMethodJustAdd.Use deviceDescriptorId or deviceParams, depending on the createMethod of the device class. CreateMethodJustAdd takes the parameters you want to have with that device. CreateMethodDiscovery requires the use of a deviceDescriptorId. If success is true, the return values will contain a pairingTransactionId, a displayMessage and the setupMethod. Depending on the setupMethod you should either proceed with AddConfiguredDevice or PairDevice.",
"params": {
"deviceClassId": "Uuid",
"o:deviceDescriptorId": "Uuid",
"o:deviceParams": [
"$ref:Param"
]
},
"returns": {
"deviceError": "$ref:DeviceError",
"o:displayMessage": "String",
"o:pairingTransactionId": "Uuid",
"o:setupMethod": "$ref:SetupMethod"
}
},
"Devices.RemoveConfiguredDevice": {
"description": "Remove a device from the system.",
"params": {
"deviceId": "Uuid",
"o:removePolicyList": [
{
"policy": "$ref:RemovePolicy",
"ruleId": "Uuid"
}
]
},
"returns": {
"deviceError": "$ref:DeviceError"
}
},
"Devices.SetPluginConfiguration": {
"description": "Set a plugin's params.",
"params": {
"configuration": [
"$ref:Param"
],
"pluginId": "Uuid"
},
"returns": {
"deviceError": "$ref:DeviceError"
}
},
"Events.GetEventType": {
"description": "Get the EventType for the given eventTypeId.",
"params": {
"eventTypeId": "Uuid"
},
"returns": {
"deviceError": "$ref:DeviceError",
"o:eventType": "$ref:EventType"
}
},
"JSONRPC.Introspect": {
"description": "Introspect this API.",
"params": {
},
"returns": {
"methods": "Object",
"types": "Object"
}
},
"JSONRPC.SetNotificationStatus": {
"description": "Enable/Disable notifications for this connections.",
"params": {
"enabled": "Bool"
},
"returns": {
"enabled": "Bool"
}
},
"JSONRPC.Version": {
"description": "Version of this Guh/JSONRPC interface.",
"params": {
},
"returns": {
"protocol version": "String",
"version": "String"
}
},
"Logging.GetLogEntries": {
"description": "Get the LogEntries matching the given filter.",
"params": {
},
"returns": {
"loggingError": "$ref:LoggingError",
"o:logEntries": [
"$ref:LogEntry"
]
}
},
"Rules.AddRule": {
"description": "Add a rule. You can describe rules by one or many EventDesciptors and a StateEvaluator. Note that only one of either eventDescriptor or eventDescriptorList may be passed at a time. A rule can be created but left disabled, meaning it won't actually be executed until set to enabled. If not given, enabled defaults to true.",
"params": {
"actions": [
"$ref:RuleAction"
],
"name": "String",
"o:enabled": "Bool",
"o:eventDescriptor": "$ref:EventDescriptor",
"o:eventDescriptorList": [
"$ref:EventDescriptor"
],
"o:exitActions": [
"$ref:RuleAction"
],
"o:stateEvaluator": "$ref:StateEvaluator"
},
"returns": {
"o:ruleId": "Uuid",
"ruleError": "$ref:RuleError"
}
},
"Rules.DisableRule": {
"description": "Disable a rule. The rule won't be triggered by it's events or state changes while it is disabled.",
"params": {
"ruleId": "Uuid"
},
"returns": {
"ruleError": "$ref:RuleError"
}
},
"Rules.EnableRule": {
"description": "Enabled a rule that has previously been disabled.",
"params": {
"ruleId": "Uuid"
},
"returns": {
"ruleError": "$ref:RuleError"
}
},
"Rules.FindRules": {
"description": "Find a list of rules containing any of the given parameters.",
"params": {
"deviceId": "Uuid"
},
"returns": {
"ruleIds": [
"Uuid"
]
}
},
"Rules.GetRuleDetails": {
"description": "Get details for the rule identified by ruleId",
"params": {
"ruleId": "Uuid"
},
"returns": {
"o:rule": "$ref:Rule",
"ruleError": "$ref:RuleError"
}
},
"Rules.GetRules": {
"description": "Get the descriptions of all configured rules. If you need more information about a specific rule use the method Rules.GetRuleDetails.",
"params": {
},
"returns": {
"ruleDescriptions": [
"$ref:RuleDescription"
]
}
},
"Rules.RemoveRule": {
"description": "Remove a rule",
"params": {
"ruleId": "Uuid"
},
"returns": {
"ruleError": "$ref:RuleError"
}
},
"States.GetStateType": {
"description": "Get the StateType for the given stateTypeId.",
"params": {
"stateTypeId": "Uuid"
},
"returns": {
"deviceError": "$ref:DeviceError",
"o:stateType": "$ref:StateType"
}
}
},
"notifications": {
"Devices.DeviceAdded": {
"description": "Emitted whenever a Device was added.",
"params": {
"device": "$ref:Device"
}
},
"Devices.DeviceParamsChanged": {
"description": "Emitted whenever the params of a Device changed (by editing or rediscovering).",
"params": {
"device": "$ref:Device"
}
},
"Devices.DeviceRemoved": {
"description": "Emitted whenever a Device was removed.",
"params": {
"deviceId": "Uuid"
}
},
"Devices.StateChanged": {
"description": "Emitted whenever a State of a device changes.",
"params": {
"deviceId": "Uuid",
"stateTypeId": "Uuid",
"value": "Variant"
}
},
"Events.EventTriggered": {
"description": "Emitted whenever an Event is triggered.",
"params": {
"event": "$ref:Event"
}
},
"Logging.LogEntryAdded": {
"description": "Emitted whenever an entry is appended to the logging system.",
"params": {
"logEntry": "$ref:LogEntry"
}
},
"Rules.RuleActiveChanged": {
"description": "Emitted whenever the active state of a Rule changed.",
"params": {
"active": "Bool",
"ruleId": "Uuid"
}
},
"Rules.RuleAdded": {
"description": "Emitted whenever a Rule was added.",
"params": {
"rule": "$ref:Rule"
}
},
"Rules.RuleRemoved": {
"description": "Emitted whenever a Rule was removed.",
"params": {
"ruleId": "Uuid"
}
}
},
"types": {
"Action": {
"actionTypeId": "Uuid",
"deviceId": "Uuid",
"o:params": [
"$ref:Param"
]
},
"ActionType": {
"id": "Uuid",
"name": "Uuid",
"paramTypes": [
"$ref:ParamType"
]
},
"BasicType": [
"Uuid",
"String",
"Int",
"Uint",
"Double",
"Bool",
"Variant",
"Color",
"Object"
],
"CreateMethod": [
"CreateMethodUser",
"CreateMethodAuto",
"CreateMethodDiscovery"
],
"Device": {
"deviceClassId": "Uuid",
"id": "Uuid",
"name": "String",
"params": [
"$ref:Param"
],
"setupComplete": "Bool"
},
"DeviceClass": {
"actionTypes": [
"$ref:ActionType"
],
"createMethods": [
"$ref:CreateMethod"
],
"discoveryParamTypes": [
"$ref:ParamType"
],
"eventTypes": [
"$ref:EventType"
],
"id": "Uuid",
"name": "String",
"paramTypes": [
"$ref:ParamType"
],
"setupMethod": "$ref:SetupMethod",
"stateTypes": [
"$ref:StateType"
],
"vendorId": "Uuid"
},
"DeviceDescriptor": {
"description": "String",
"id": "Uuid",
"title": "String"
},
"DeviceError": [
"DeviceErrorNoError",
"DeviceErrorPluginNotFound",
"DeviceErrorDeviceNotFound",
"DeviceErrorDeviceClassNotFound",
"DeviceErrorActionTypeNotFound",
"DeviceErrorStateTypeNotFound",
"DeviceErrorEventTypeNotFound",
"DeviceErrorDeviceDescriptorNotFound",
"DeviceErrorMissingParameter",
"DeviceErrorInvalidParameter",
"DeviceErrorSetupFailed",
"DeviceErrorDuplicateUuid",
"DeviceErrorCreationMethodNotSupported",
"DeviceErrorSetupMethodNotSupported",
"DeviceErrorHardwareNotAvailable",
"DeviceErrorHardwareFailure",
"DeviceErrorAuthentificationFailure",
"DeviceErrorAsync",
"DeviceErrorDeviceInUse",
"DeviceErrorPairingTransactionIdNotFound",
"DeviceErrorParameterNotWritable"
],
"Event": {
"deviceId": "Uuid",
"eventTypeId": "Uuid",
"o:params": [
"$ref:Param"
]
},
"EventDescriptor": {
"deviceId": "Uuid",
"eventTypeId": "Uuid",
"o:paramDescriptors": [
"$ref:ParamDescriptor"
]
},
"EventType": {
"id": "Uuid",
"name": "String",
"paramTypes": [
"$ref:ParamType"
]
},
"InputType": [
"InputTypeNone",
"InputTypeTextLine",
"InputTypeTextArea",
"InputTypePassword",
"InputTypeSearch",
"InputTypeMail",
"InputTypeIPv4Address",
"InputTypeIPv6Address",
"InputTypeUrl",
"InputTypeMacAddress"
],
"LogEntry": {
"loggingLevel": "$ref:LoggingLevel",
"o:active": "Bool",
"o:deviceId": "Uuid",
"o:errorCode": "String",
"o:eventType": "$ref:LoggingEventType",
"o:typeId": "Uuid",
"o:value": "String",
"source": "$ref:LoggingSource",
"timestamp": "Int"
},
"LoggingError": [
"LoggingErrorNoError",
"LoggingErrorLogEntryNotFound"
],
"LoggingEventType": [
"LoggingEventTypeTrigger",
"LoggingEventTypeActiveChange"
],
"LoggingLevel": [
"LoggingLevelInfo",
"LoggingLevelAlert"
],
"LoggingSource": [
"LoggingSourceSystem",
"LoggingSourceEvents",
"LoggingSourceActions",
"LoggingSourceStates",
"LoggingSourceRules"
],
"Param": {
"name": "String",
"value": "$ref:BasicType"
},
"ParamDescriptor": {
"name": "String",
"operator": "$ref:ValueOperator",
"value": "$ref:BasicType"
},
"ParamType": {
"name": "String",
"o:allowedValues": [
"Variant"
],
"o:defaultValue": "Variant",
"o:inputType": "$ref:InputType",
"o:maxValue": "Variant",
"o:minValue": "Variant",
"o:readOnly": "Bool",
"o:unit": "$ref:Unit",
"type": "$ref:BasicType"
},
"Plugin": {
"id": "Uuid",
"name": "String",
"params": [
"$ref:Param"
]
},
"RemovePolicy": [
"RemovePolicyCascade",
"RemovePolicyUpdate"
],
"Rule": {
"actions": [
"$ref:RuleAction"
],
"active": "Bool",
"enabled": "Bool",
"eventDescriptors": [
"$ref:EventDescriptor"
],
"exitActions": [
"$ref:RuleAction"
],
"id": "Uuid",
"name": "String",
"stateEvaluator": "$ref:StateEvaluator"
},
"RuleAction": {
"actionTypeId": "Uuid",
"deviceId": "Uuid",
"o:ruleActionParams": [
"$ref:RuleActionParam"
]
},
"RuleActionParam": {
"name": "String",
"o:eventParamName": "String",
"o:eventTypeId": "Uuid",
"o:value": "$ref:BasicType"
},
"RuleDescription": {
"active": "Bool",
"enabled": "Bool",
"id": "Uuid",
"name": "String"
},
"RuleError": [
"RuleErrorNoError",
"RuleErrorInvalidRuleId",
"RuleErrorRuleNotFound",
"RuleErrorDeviceNotFound",
"RuleErrorEventTypeNotFound",
"RuleErrorActionTypeNotFound",
"RuleErrorInvalidParameter",
"RuleErrorInvalidRuleFormat",
"RuleErrorMissingParameter",
"RuleErrorInvalidRuleActionParameter",
"RuleErrorTypesNotMatching"
],
"SetupMethod": [
"SetupMethodJustAdd",
"SetupMethodDisplayPin",
"SetupMethodEnterPin",
"SetupMethodPushButton"
],
"State": {
"deviceId": "Uuid",
"stateTypeId": "Uuid",
"value": "Variant"
},
"StateDescriptor": {
"deviceId": "Uuid",
"operator": "$ref:ValueOperator",
"stateTypeId": "Uuid",
"value": "Variant"
},
"StateEvaluator": {
"o:childEvaluators": [
"$ref:StateEvaluator"
],
"o:operator": "$ref:StateOperator",
"o:stateDescriptor": "$ref:StateDescriptor"
},
"StateOperator": [
"StateOperatorAnd",
"StateOperatorOr"
],
"StateType": {
"defaultValue": "Variant",
"id": "Uuid",
"name": "String",
"o:unit": "$ref:Unit",
"type": "$ref:BasicType"
},
"Unit": [
"UnitNone",
"UnitSeconds",
"UnitMinutes",
"UnitHours",
"UnitUnixTime",
"UnitMeterPerSecond",
"UnitKiloMeterPerHour",
"UnitDegree",
"UnitRadiant",
"UnitDegreeCelsius",
"UnitDegreeKelvin",
"UnitMired",
"UnitMilliBar",
"UnitBar",
"UnitPascal",
"UnitHectoPascal",
"UnitAtmosphere",
"UnitLumen",
"UnitLux",
"UnitCandela",
"UnitMilliMeter",
"UnitCentiMeter",
"UnitMeter",
"UnitKiloMeter",
"UnitGram",
"UnitKiloGram",
"UnitDezibel",
"UnitKiloByte",
"UnitMegaByte",
"UnitGigaByte",
"UnitTeraByte",
"UnitMilliWatt",
"UnitWatt",
"UnitKiloWatt",
"UnitKiloWattHour",
"UnitPercentage",
"UnitEuro",
"UnitDollar"
],
"ValueOperator": [
"ValueOperatorEquals",
"ValueOperatorNotEquals",
"ValueOperatorLess",
"ValueOperatorGreater",
"ValueOperatorLessOrEqual",
"ValueOperatorGreaterOrEqual"
],
"Vendor": {
"id": "Uuid",
"name": "String"
}
}
}