diff --git a/CounterServer/form.json b/CounterServer/form.json index bcb1100..7f881fa 100644 --- a/CounterServer/form.json +++ b/CounterServer/form.json @@ -12,6 +12,17 @@ "caption": "JSON-Datenquelle", "validVariableTypes": [3] }, + { + "type": "Text", + "name": "Projectname", + "caption": "Projekt-Name" + }, + { + "type": "NumberSpinner", + "name": "ProjectIdPortal", + "caption": "Project-ID (Portal)", + "digits": 0 + }, { "type": "NumberSpinner", "name": "ProjectIdPortal", diff --git a/CounterServer/module.php b/CounterServer/module.php index cb6c452..3a68052 100644 --- a/CounterServer/module.php +++ b/CounterServer/module.php @@ -9,6 +9,7 @@ class CounterServer extends IPSModule $this->RegisterPropertyInteger('Connector', 0); $this->RegisterPropertyInteger('SourceJSON', 0); $this->RegisterPropertyInteger('UpdateTime', 60); + $this->RegisterPropertyString('Projectname', 60); $this->RegisterPropertyInteger('ProjectIdPortal', -1); $this->RegisterTimer('Update', 0, 'SECT_checkTable($_IPS[\'TARGET\']);'); } @@ -49,7 +50,7 @@ class CounterServer extends IPSModule $clientId = (string)$this->InstanceID; $clientName = IPS_GetName($this->InstanceID); - + $projectName = $this->ReadPropertyString('Projectname'); $timestamp = $payload['timestamp'] ?? date('Y-m-d H:i:s'); $counters = $payload['counters'] ?? []; $projectId = $this->ReadPropertyInteger('ProjectIdPortal'); @@ -75,7 +76,7 @@ class CounterServer extends IPSModule '" . $this->esc($counterId) . "', '" . hash('sha256', $projectId.$clientId . '_' . $counterId) . "', '" . $this->esc($clientId) . "', - '" . $this->esc($clientName) . "', + '" . $this->esc($projectName.'_'. $counterId) . "', '" . $this->esc($type) . "', '" . $this->esc($unit) . "', 1 diff --git a/library.json b/library.json index ce70867..0cee424 100644 --- a/library.json +++ b/library.json @@ -8,6 +8,6 @@ "date": 1491343200 }, "version": "1.1", - "build": 0, + "build": 2, "date": 0 } \ No newline at end of file