Die Meldung sagt ja, dass obj schon belegt ist. So läuft es bei mir:
on({id: "harmony.0.xy.hubConnected", change: "ne"}, function (obj) {
var value = obj.state.val;
var oldValue = obj.oldState.val;
if (getState("harmony.0.xy.hubConnected").val === false) {
var Xobj = getObject("system.adapter.harmony.0");
setObject("system.adapter.harmony.0", Xobj);
log("restart of harmony.0 initiated");
} else
{
log("nothing to do");
}
});
Allerdings löst das Script das Problem bei mir leider nicht, dass der Adapter alle paar Tage mal auf harmony.0.xy.hubConnected springt. Ein Adapter-Restart löst das Problem bei mir also leider nicht.