From 0723a2d33fdf8a5529cbd84c2dde2cf183980630 Mon Sep 17 00:00:00 2001 From: jhartworks Date: Thu, 16 Apr 2026 13:40:00 +0200 Subject: [PATCH] feat: add ClientIdPortal property to CounterServer module and form.json --- CounterServer/form.json | 6 ++++++ CounterServer/module.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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 = "