Communication Event Sozlesmeleri
Bu servis, komut tanimini event payload'inda tasimaz. Payload komut referansini (device_command_id veya command_code), hedef cihaz ve runtime baglamini tasir.
Girdi Eventleri
action.execute.requested.v1
Rule katmaninin tetikledigi Action Executor tarafindan uretilen komut talebidir.
{
"event": "action.execute.requested.v1",
"meta": {
"schema_version": 1,
"trace_id": "cmd-4c1a6c1a",
"producer_service": "action-service",
"produced_at": "2026-03-12T21:20:00.100Z"
},
"context": {
"project_id": 12,
"device_id": "400000011D081B70"
},
"data": {
"command_code": "set_register",
"runtime_params": {
"register": 4001,
"value": 15
},
"source_type": "action",
"source_ref_id": 8123
},
"error": null
}
automation.command.requested.v1
Zamanlanmis veya toplu operasyon akislari icin Automation tarafindan uretilen komut talebidir.
{
"event": "automation.command.requested.v1",
"meta": {
"schema_version": 1,
"trace_id": "cmd-89f2e781",
"producer_service": "automation-service",
"produced_at": "2026-03-12T21:20:00.100Z"
},
"context": {
"project_id": 12,
"device_id": "400000011D081B70"
},
"data": {
"automation_id": 88,
"run_id": 9122,
"device_command_id": 4,
"trigger_type": "date",
"scheduled_at": "2026-03-12T21:20:00Z",
"source_type": "automation",
"source_ref_id": 992
},
"error": null
}
api.command.requested.v1
Mobil uygulama veya panel kaynakli manuel komut isteklerinin API tarafinda eventlestirilmis halidir.
{
"event": "api.command.requested.v1",
"meta": {
"schema_version": 1,
"trace_id": "cmd-api-7821",
"producer_service": "api-service",
"produced_at": "2026-03-12T21:20:00.100Z"
},
"context": {
"project_id": 12,
"device_id": "400000011D081B70",
"user_id": 441
},
"data": {
"command_code": "restart",
"runtime_params": {},
"source_type": "api",
"source_ref_id": 55501
},
"error": null
}
Cikti Eventleri
device.command.sent.v1
{
"event": "device.command.sent.v1",
"meta": {
"schema_version": 1,
"trace_id": "cmd-4c1a6c1a",
"producer_service": "communication-service",
"produced_at": "2026-03-12T21:20:00.240Z",
"process_ms": 12
},
"context": {
"project_id": 12,
"device_id": "400000011D081B70"
},
"data": {
"command_code": "set_register",
"endpoint": "mqtt/downlink",
"timeout_ms": 5000,
"source_type": "action",
"source_ref_id": 8123
},
"error": null
}
device.command.acked.v1
{
"event": "device.command.acked.v1",
"meta": {
"schema_version": 1,
"trace_id": "cmd-4c1a6c1a",
"producer_service": "communication-service",
"produced_at": "2026-03-12T21:20:01.030Z",
"process_ms": 930
},
"context": {
"project_id": 12,
"device_id": "400000011D081B70"
},
"data": {
"command_code": "set_register",
"ack_code": "OK",
"response_payload": {
"register": 4001,
"value": 15
},
"source_type": "action",
"source_ref_id": 8123
},
"error": null
}
device.command.failed.v1
{
"event": "device.command.failed.v1",
"meta": {
"schema_version": 1,
"trace_id": "cmd-4c1a6c1a",
"producer_service": "communication-service",
"produced_at": "2026-03-12T21:20:05.300Z",
"process_ms": 5000
},
"context": {
"project_id": 12,
"device_id": "400000011D081B70"
},
"data": {
"command_code": "set_register",
"source_type": "action",
"source_ref_id": 8123,
"retry_count": 3
},
"error": {
"failed_stage": "command_lookup",
"error_code": "COMMAND_DEFINITION_NOT_FOUND",
"error_message": "command definition could not be resolved",
"retryable": false,
"failed_at": "2026-03-12T21:20:05Z"
}
}
Notlar
command_code,device_commandstablosundaki sozluk kaydi ile birebir eslesmelidir.- API kaynakli komutlarda
device_commands.is_system_only=trueolan kayitlar reddedilmelidir (COMMAND_FORBIDDEN_FOR_USER). runtime_params,templateicindeki placeholder'lari doldurmak icin kullanilir.- Automation kaynagindan gelen eventlerde komut referansi
device_command_idile tasinir; cozumleme Communication tarafinda yapilir. - Giris event producer'i
action-executor-service,automation-serviceveyaapi-serviceolabilir. - Basarili ve basarisiz sonuc eventleri diger servislerin orchestration icin ana cikisidir.