diff --git a/CounterServer/form.json b/CounterServer/form.json index b31e39f..30dace5 100644 --- a/CounterServer/form.json +++ b/CounterServer/form.json @@ -13,6 +13,12 @@ "validVariableTypes": [3] }, { + "type": "NumberSpinner", + "name": "ClientIdPortal", + "caption": "Client-ID (Portal)", + "digits": 0 + }, + { "type": "NumberSpinner", "name": "UpdateTime", "caption": "Aktualisierungszeit (Sekunden)", diff --git a/CounterServer/module.php b/CounterServer/module.php index a27a0d0..0e3bb57 100644 --- a/CounterServer/module.php +++ b/CounterServer/module.php @@ -9,7 +9,7 @@ class CounterServer extends IPSModule $this->RegisterPropertyInteger('Connector', 0); $this->RegisterPropertyInteger('SourceJSON', 0); $this->RegisterPropertyInteger('UpdateTime', 60); - + $this->RegisterPropertyInteger('ClientIdPortal', 0); $this->RegisterTimer('Update', 0, 'SECT_checkTable($_IPS[\'TARGET\']);'); } @@ -61,7 +61,7 @@ class CounterServer extends IPSModule $counterName = $c['name'] ?? $counterId; $type = $c['type'] ?? 'other'; $unit = $c['unit'] ?? 'kWh'; - $projectId = isset($c['project_id']) ? (int)$c['project_id'] : 'NULL'; + $projectId = $this->ReadPropertyInteger('ClientIdPortal'); // ---------- UPSERT ---------- $sql = "