Mqtt überarbeitet

This commit is contained in:
2025-11-24 11:06:44 +01:00
parent 1cf436ce75
commit 5aef0385f5

View File

@@ -223,18 +223,31 @@ class Shelly_Parser_MQTT extends IPSModule
foreach (IPS_GetChildrenIDs($folder) as $cid) {
if (IPS_GetObject($cid)['ObjectIdent'] === $ident) {
// ---- Action wieder setzen, falls sie fehlt ----
if (str_contains($ident, '_output_')) {
IPS_SetVariableCustomAction($cid, $this->InstanceID);
}
return $cid;
}
}
// Variable neu anlegen
$vid = IPS_CreateVariable(0);
IPS_SetName($vid, $name);
IPS_SetIdent($vid, $ident);
IPS_SetParent($vid, $folder);
// ---- HIER: Action für Output-Variablen setzen ----
if (str_contains($ident, '_output_')) {
IPS_SetVariableCustomAction($vid, $this->InstanceID);
}
return $vid;
}
private function EnsureFloatVariable(string $deviceID, string $ident, string $name): int
{
$folder = $this->GetDeviceFolder($deviceID);