OWSWITCH: output schalten per Name funktioniert nicht

Begonnen von Tobias, 12 März 2013, 06:50:31

Vorheriges Thema - Nächstes Thema

Tobias

gemacht...
2013.03.18 13:26:57.185 1: OWSWITCH: Testing Zirkulationspumpe against A and A
2013.03.18 13:26:57.185 1: OWSWITCH: Testing Zirkulationspumpe against B and B
2013.03.18 13:26:57.241 1: FormatValues channel spec for A = >>>A<<< leading to 1 items and new name A
2013.03.18 13:26:57.242 1: FormatValues channel spec for B = >>>B<<< leading to 1 items and new name B


Nach einem Neustart sieht es etwas anders aus:
2013.03.18 14:02:02.094 1: FormatValues channel spec for A = >>>Zirkulationspumpe|status<<< leading to 2 items and new name Zirkulationspumpe
2013.03.18 14:02:02.095 1: FormatValues channel spec for B = >>>Umwälzpumpe|status<<< leading to 2 items and new name Umwälzpumpe

Trotzdem kommt nach Absetzen des "output" Kommandos wieder folgendes:2013.03.18 14:04:36.557 1: OWSWITCH: Testing Zirkulationspumpe against A and A
2013.03.18 14:04:36.557 1: OWSWITCH: Testing Zirkulationspumpe against B and B
Maintainer: Text2Speech, TrashCal, MediaList

Meine Projekte: https://github.com/tobiasfaust
* PumpControl v2: allround Bewässerungssteuerung mit ESP und FHEM
* Ein Modbus RS485 zu MQTT Gateway für SolarWechselrichter

Prof. Dr. Peter Henning

Das ist wirklich vertrackt - denn das bedeutet, dass irgendetwas die Attributwerte zerstört. FormatValues findet diese gar nicht mehr, und setzt darum den Defaultwert "A" ein ...

Aber warum ? Irgendeine Fehlermeldung betreffend die Attribute ?

LG

pah

Prof. Dr. Peter Henning

Kann es sein, dass an anderer Stelle in den Konfigurationsdateien die Attributwerte ein zweites mal gesetzt werden ?

LG

pah

Tobias

Es gibt keine Fehlermeldung.
Konnte man letzte Nach relativ gut sehen. Nachdem FHEM neu gestartet war (gegen 0Uhr) fand um 6 und um 6:02 der Schaltvorgang statt:
[...]
2013.03.18 00:00:30.421 1: Channel spec for A = >>>Zirkulationspumpe|Status<<< leading to 2 items
2013.03.18 00:00:30.422 1: Channel name for A = Zirkulationspumpe
2013.03.18 00:00:30.422 1: Channel spec for B = >>>Umwälzpumpe|state<<< leading to 2 items
2013.03.18 00:00:30.423 1: Channel name for B = Umwälzpumpe
2013.03.18 00:00:30.423 1: Channel spec for A = >>>A|onoff<<< leading to 2 items
2013.03.18 00:00:30.424 1: Channel name for A = A
2013.03.18 00:00:30.424 1: Channel spec for B = >>>B|onoff<<< leading to 2 items
2013.03.18 00:00:30.425 1: Channel name for B = B
2013.03.18 00:00:39.598 1: Channel spec for A = >>>A|onoff<<< leading to 2 items
2013.03.18 00:00:39.599 1: Channel name for A = A
2013.03.18 00:00:39.599 1: Channel spec for B = >>>B|onoff<<< leading to 2 items
2013.03.18 00:00:39.600 1: Channel name for B = B
2013.03.18 00:00:39.600 1: Channel spec for C = >>>C|onoff<<< leading to 2 items
2013.03.18 00:00:39.601 1: Channel name for C = C
2013.03.18 00:00:39.601 1: Channel spec for D = >>>D|onoff<<< leading to 2 items
2013.03.18 00:00:39.602 1: Channel name for D = D
2013.03.18 00:00:39.602 1: Channel spec for E = >>>E|onoff<<< leading to 2 items
2013.03.18 00:00:39.603 1: Channel name for E = E
2013.03.18 00:00:39.603 1: Channel spec for F = >>>F|onoff<<< leading to 2 items
2013.03.18 00:00:39.604 1: Channel name for F = F
2013.03.18 00:00:39.604 1: Channel spec for G = >>>G|onoff<<< leading to 2 items
2013.03.18 00:00:39.604 1: Channel name for G = G
2013.03.18 00:00:39.605 1: Channel spec for H = >>>H|onoff<<< leading to 2 items
2013.03.18 00:00:39.605 1: Channel name for H = H
2013.03.18 00:00:39.606 1: Channel spec for A = >>>A|onoff<<< leading to 2 items
2013.03.18 00:00:39.606 1: Channel name for A = A
2013.03.18 00:00:39.607 1: Channel spec for B = >>>B|onoff<<< leading to 2 items
2013.03.18 00:00:39.607 1: Channel name for B = B
2013.03.18 00:00:39.608 1: Channel spec for C = >>>C|onoff<<< leading to 2 items
2013.03.18 00:00:39.608 1: Channel name for C = C
2013.03.18 00:00:39.609 1: Channel spec for D = >>>D|onoff<<< leading to 2 items
2013.03.18 00:00:39.609 1: Channel name for D = D
2013.03.18 00:00:39.610 1: Channel spec for E = >>>E|onoff<<< leading to 2 items
2013.03.18 00:00:39.610 1: Channel name for E = E
2013.03.18 00:00:39.611 1: Channel spec for F = >>>F|onoff<<< leading to 2 items
2013.03.18 00:00:39.611 1: Channel name for F = F
2013.03.18 00:00:39.612 1: Channel spec for G = >>>G|onoff<<< leading to 2 items
2013.03.18 00:00:39.612 1: Channel name for G = G
2013.03.18 00:00:39.613 1: Channel spec for H = >>>H|onoff<<< leading to 2 items
2013.03.18 00:00:39.613 1: Channel name for H = H
2013.03.18 06:00:00.279 1: OWSWITCH: Testing A against A and A
2013.03.18 06:02:00.314 1: OWSWITCH: Testing A against A and A


so ists definiert:define Heizung_Steuerung OWSWITCH DS2413 2F5503000000
attr Heizung_Steuerung AName Zirkulationspumpe|status
attr Heizung_Steuerung BName Umwälzpumpe|status
attr Heizung_Steuerung IODev 1wireBus
attr Heizung_Steuerung model DS2413
attr Heizung_Steuerung room Heizung
Maintainer: Text2Speech, TrashCal, MediaList

Meine Projekte: https://github.com/tobiasfaust
* PumpControl v2: allround Bewässerungssteuerung mit ESP und FHEM
* Ein Modbus RS485 zu MQTT Gateway für SolarWechselrichter

Prof. Dr. Peter Henning

Hm.

Ich bin ratlos, weil es eigentlich keine Möglichkeit gibt, dass ein Attributwert $attr{"Zirkulationspumpe"}{"AName"} aus Versehen" gelöscht wird.

Vielleicht mal Folgendes (macht wieder viel Müll, aber eine andere Möglichkeit sehe ich derzeit nicht ...):

An den Anfang der FormatValues-subroutine schreiben:

Log 1,"Attributwert Zirkulationspumpe AName ist ".$attr{"Zirkulationspumpe"}{"AName"};

LG

pah


Tobias

Hi pah,
ich such mich gerade dusselig, aber in OWSWITCH_InitializeDevice sehe ich nix wo $attr{"Zirkulationspumpe"}{"AName"} festgelegt wurde. Kannst du mal (keine Zeilennummer) den betreffenden Code posten?

Habe nochmal weiter geschaut. Im OWSWITCH_Set greifst du direkt auf $owg_channel[$i] zu, aber in der Funktion sehe ich nicht wo du diese befüllst..?
Kann das ein Problem sein wenn man mehrere identische Devices hat das diese sich gegenseitig überschreiben?

ich hätte in der Funktion eher soetwas erwartet:
   $cname = defined($attr{$name}{$owg_fixed[$i]."Name"})  ? $attr{$name}{$owg_fixed[$i]."Name"} : $owg_fixed[$i];
    @cnama = split(/\|/,$cname);
    $owg_channel[$i]=$cnama[0];
Maintainer: Text2Speech, TrashCal, MediaList

Meine Projekte: https://github.com/tobiasfaust
* PumpControl v2: allround Bewässerungssteuerung mit ESP und FHEM
* Ein Modbus RS485 zu MQTT Gateway für SolarWechselrichter

Prof. Dr. Peter Henning

Ah sieh an, dann haben wir es.

Erstens: In meinem vorigen Post hätte es natürlich heißen sollen

"Heizung_Steuerung" (der Devicename) statt "Zirkulationspumpe" (der Kanalname).

Zweitens: Das ist natürlich vollkommen korrekt - die "globale" Variable $owg_channel wird beim Vorhandensein eines zweiten Device überschrieben. In einer der Vorversionen des Moduls hatte ich FormatValues ausgeführt, bevor der Kanal tatsächlich gesetzt wurde - inzwischen wird das aber danach ausgeführt. Un dmir ist es nicht aufgefalleb, weil ich das immer schön brav nur mit einem 1-Wire Switch getestet habe.

Gratuliere, das ist ein echter Bug.

Den ich umgehend behebe, die neue Version checke ich in den nächsten Minuten ein.

LG

pah

Prof. Dr. Peter Henning

OK, ich hänge die neue Version mal an. Ich bin derzeit unterwegs und habe keinen OWSWITCH dabei, also bitte mal Testen, sollte jetzt funktionieren wie gewünscht.

LG

pah

Tobias

Jawoll! Jetzt funktioniert es :) Du kannst es einchecken.
Gruss
Maintainer: Text2Speech, TrashCal, MediaList

Meine Projekte: https://github.com/tobiasfaust
* PumpControl v2: allround Bewässerungssteuerung mit ESP und FHEM
* Ein Modbus RS485 zu MQTT Gateway für SolarWechselrichter