PRESENCE cover version - anderer Ansatz basierend auf aktuellem Code

Begonnen von martinp876, 23 Dezember 2020, 14:38:45

Vorheriges Thema - Nächstes Thema

flummy1978

Zitat von: Invers am 27 Februar 2024, 05:55:09Danke für die Änderung. Mit dieser Version (reinkopiert und reload gemacht) funktioniert anscheinend alles.


Ohne jetzt zu wissen, ob es daran liegen kann: Kann es sein, dass du dort sekundlich die Abfrage machst?

(Kurzform, weil mobiles Mäusekino)
VG
Andreas

JoWiemann

Zitat von: flummy1978 am 02 März 2024, 09:38:20Ohne jetzt zu wissen, ob es daran liegen kann: Kann es sein, dass du dort sekundlich die Abfrage machst?

(Kurzform, weil mobiles Mäusekino)
VG
Andreas

Vom originären Modul Ersteller ist die sekündliche Abfrage als Default vorgesehen. Ich habe das erst einmal nicht geändert. Man kann ja durch set <name> intervalNormal <Sekunden> das Intervall verlängern.

Grüße Jörg
Jörg Wiemann

Slave: RPi B+ mit 512 MB, COC (868 MHz), CUL V3 (433.92MHz SlowRF); FHEMduino, Aktuelles FHEM

Master: CubieTruck; Debian; Aktuelles FHEM

Invers

Gestern Abend wurde keines meiner Handys mehr erkannt. Der Status blieb auf abwesend.
Das Log ist voll mit Meldungen wie:
[pre]Timeout: process terminated
2024.03.02 09:10:49.848 2: PRESENCE (a51H) - check returned a valid result after 2 unsuccesful retries
2024.03.02 09:21:46.284 1: Timeout for PRESENCE_DoLocalBluetoothScan reached, terminated process 17723
2024.03.02 09:21:46.287 2: PRESENCE (a51H) - device could not be checked (retrying in 10 seconds): Timeout: process terminated
2024.03.02 09:22:53.551 2: PRESENCE (a51H) - check returned a valid result after 1 unsuccesful retry
2024.03.02 09:41:53.647 1: Timeout for PRESENCE_DoLocalBluetoothScan reached, terminated process 19212
2024.03.02 09:41:53.650 2: PRESENCE (a51K) - device could not be checked (retrying in 10 seconds): Timeout: process terminated
2024.03.02 09:43:03.674 1: Timeout for PRESENCE_DoLocalBluetoothScan reached, terminated process 19326
2024.03.02 09:43:03.677 2: PRESENCE (a51K) - device could not be checked after 1 retry (retrying in 10 seconds): Timeout: process terminated
2024.03.02 09:43:56.640 2: PRESENCE (a51K) - check returned a valid result after 2 unsuccesful retries
2024.03.02 09:44:35.398 1: Timeout for PRESENCE_DoLocalBluetoothScan reached, terminated process 19480
2024.03.02 09:44:35.401 2: PRESENCE (a51H) - device could not be checked (retrying in 10 seconds): Timeout: process terminated[/pre]


und dann :

[pre]Invalid device: Network is down
Invalid device: Network is down
Invalid device: Network is down
Device is not available.
Invalid device: Network is down
Invalid device: Network is down
Invalid device: Network is down
Invalid device: Network is down
Invalid device: Network is down
Invalid device: Network is down
Invalid device: Network is down
Invalid device: Network is down
Invalid device: Network is down
Invalid device: Network is down
Invalid device: Network is down
Invalid device: Network is down[/pre]

Ich musste das Update rückgängig machen und den Pi neu starten. Erst danach läuft wieder alles, allerdings nun wieder ohne presence2.
Pi3B+ mit SSD/ Bullseye | FB7590 AX | 12 x Dect200 | CUL433+868 | SDuino | HM-LAN | 3 x Heizung FHT + FKontakte | KeyMatic + 4 FB | HM Wandtaster 2-fach m. LED | 6 x Türkont. TFK-TI | HM-Bew.-Melder innen | 3 x Smoked. HM-SEC-SD-2

GunterB

Ich wollte das Modul nutzen, da ich mit dem 73_PRESENCE auch Freeze Probleme habe.
Jedoch bringt mir das 73_PRESENCE2 da fhem auf dem PI3 direkt zum stehen:

define PRES2_TV4 PRESENCE2 lan-ping 192.168.10.55
Can't call method "CDCOpenData_DebugLog" on unblessed reference at ./FHEM/73_PRESENCE2.pm line 77.

JoWiemann

Zitat von: GunterB am 04 März 2024, 09:38:30Ich wollte das Modul nutzen, da ich mit dem 73_PRESENCE auch Freeze Probleme habe.
Jedoch bringt mir das 73_PRESENCE2 da fhem auf dem PI3 direkt zum stehen:

define PRES2_TV4 PRESENCE2 lan-ping 192.168.10.55
Can't call method "CDCOpenData_DebugLog" on unblessed reference at ./FHEM/73_PRESENCE2.pm line 77.

Ups, da ist mir etwas durchgegangen. Kommt morgen mit dem Update oder jetzt schon im Anhang.

Grüße Jörg
Jörg Wiemann

Slave: RPi B+ mit 512 MB, COC (868 MHz), CUL V3 (433.92MHz SlowRF); FHEMduino, Aktuelles FHEM

Master: CubieTruck; Debian; Aktuelles FHEM

juemuc

Hallo Jörg,

bei mir läuft es problemlos.

Viele Grüße
Jürgen
3x Sonos Play 1, 1x Sonos Arc + Sub, 1 Sonos-One, 1x Sonos Playbar
FB6690 + FB7490 mit 4x Dect 200 und 3 Dect-ULE-Thermostate,  raspberry3B+, HM Funkmodul HM-MOD-RPI-PCB, HM Klingelsensor HM-Sen-DB-PCB, HM (IP) Fensterkontakte und  Amazon Echo Dot,  piVCCU, pi OS (bookworm).

GunterB

Update eingespielt.

Habe hier noch was:
2024.03.05 08:15:59 1: ERROR: empty name in readingsBeginUpdate
2024.03.05 08:15:59 1: stacktrace:
2024.03.05 08:15:59 1:     main::readingsBeginUpdate           called by ./FHEM/73_PRESENCE2.pm (1031)
2024.03.05 08:15:59 1:     main::PRESENCE2_daemonScanReply     called by (eval 27781) (1)
2024.03.05 08:15:59 1:     (eval)                              called by fhem.pl (1177)
2024.03.05 08:15:59 1:     main::AnalyzePerlCommand            called by fhem.pl (1206)
2024.03.05 08:15:59 1:     main::AnalyzeCommand                called by fhem.pl (1133)
2024.03.05 08:15:59 1:     main::AnalyzeCommandChain           called by ./FHEM/98_telnet.pm (263)
2024.03.05 08:15:59 1:     main::telnet_Read                   called by fhem.pl (3985)
2024.03.05 08:15:59 1:     main::CallFn                        called by fhem.pl (786)
2024.03.05 08:15:59 1: PERL WARNING: Use of uninitialized value $d in hash element at fhem.pl line 4706.
2024.03.05 08:15:59 1: PERL WARNING: Use of uninitialized value in string ne at ./FHEM/73_PRESENCE2.pm line 934.
2024.03.05 08:15:59 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/73_PRESENCE2.pm line 935.
2024.03.05 08:15:59 1: PERL WARNING: Use of uninitialized value in concatenation (.) or string at ./FHEM/73_PRESENCE2.pm line 935.
2024.03.05 08:15:59 1: PERL WARNING: Use of uninitialized value $hash in hash element at ./FHEM/73_PRESENCE2.pm line 58.
2024.03.05 08:15:59 1: PERL WARNING: Use of uninitialized value $instName in concatenation (.) or string at ./FHEM/73_PRESENCE2.pm line 74.
2024.03.05 08:15:59 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at fhem.pl line 5043.
2024.03.05 08:15:59 1: readingsUpdate(,lastDisappear,2024-03-05 08:15:59) missed to call readingsBeginUpdate first.
2024.03.05 08:15:59 1: stacktrace:
2024.03.05 08:15:59 1:     main::readingsBulkUpdate            called by ./FHEM/73_PRESENCE2.pm (937)
2024.03.05 08:15:59 1:     main::PRESENCE2_ProcessState        called by ./FHEM/73_PRESENCE2.pm (1032)
2024.03.05 08:15:59 1:     main::PRESENCE2_daemonScanReply     called by (eval 27781) (1)
2024.03.05 08:15:59 1:     (eval)                              called by fhem.pl (1177)
2024.03.05 08:15:59 1:     main::AnalyzePerlCommand            called by fhem.pl (1206)
2024.03.05 08:15:59 1:     main::AnalyzeCommand                called by fhem.pl (1133)
2024.03.05 08:15:59 1:     main::AnalyzeCommandChain           called by ./FHEM/98_telnet.pm (263)
2024.03.05 08:15:59 1:     main::telnet_Read                   called by fhem.pl (3985)
2024.03.05 08:15:59 1:     main::CallFn                        called by fhem.pl (786)
2024.03.05 08:15:59 1: PERL WARNING: Use of uninitialized value in string eq at ./FHEM/73_PRESENCE2.pm line 901.
2024.03.05 08:15:59 1: readingsUpdate(,state,absent) missed to call readingsBeginUpdate first.
2024.03.05 08:15:59 1: stacktrace:
2024.03.05 08:15:59 1:     main::readingsBulkUpdate            called by ./FHEM/73_PRESENCE2.pm (942)
2024.03.05 08:15:59 1:     main::PRESENCE2_ProcessState        called by ./FHEM/73_PRESENCE2.pm (1032)
2024.03.05 08:15:59 1:     main::PRESENCE2_daemonScanReply     called by (eval 27781) (1)
2024.03.05 08:15:59 1:     (eval)                              called by fhem.pl (1177)
2024.03.05 08:15:59 1:     main::AnalyzePerlCommand            called by fhem.pl (1206)
2024.03.05 08:15:59 1:     main::AnalyzeCommand                called by fhem.pl (1133)
2024.03.05 08:15:59 1:     main::AnalyzeCommandChain           called by ./FHEM/98_telnet.pm (263)
2024.03.05 08:15:59 1:     main::telnet_Read                   called by fhem.pl (3985)
2024.03.05 08:15:59 1:     main::CallFn                        called by fhem.pl (786)
2024.03.05 08:15:59 1: readingsUpdate(,presence,absent) missed to call readingsBeginUpdate first.
2024.03.05 08:15:59 1: stacktrace:
2024.03.05 08:15:59 1:     main::readingsBulkUpdate            called by ./FHEM/73_PRESENCE2.pm (956)
2024.03.05 08:15:59 1:     main::PRESENCE2_ProcessState        called by ./FHEM/73_PRESENCE2.pm (1032)
2024.03.05 08:15:59 1:     main::PRESENCE2_daemonScanReply     called by (eval 27781) (1)
2024.03.05 08:15:59 1:     (eval)                              called by fhem.pl (1177)
2024.03.05 08:15:59 1:     main::AnalyzePerlCommand            called by fhem.pl (1206)
2024.03.05 08:15:59 1:     main::AnalyzeCommand                called by fhem.pl (1133)
2024.03.05 08:15:59 1:     main::AnalyzeCommandChain           called by ./FHEM/98_telnet.pm (263)
2024.03.05 08:15:59 1:     main::telnet_Read                   called by fhem.pl (3985)
2024.03.05 08:15:59 1:     main::CallFn                        called by fhem.pl (786)
2024.03.05 08:15:59 1: PERL WARNING: Use of uninitialized value $d in hash element at fhem.pl line 4776.
2024.03.05 08:15:59 1: PERL WARNING: Use of uninitialized value $dev in hash element at fhem.pl line 3848.

juemuc

Hallo Jörg,

ich habe nach dem Umstieg nun doch Probleme. Habe zuerst alle pressence-Devices inkl Daemon gelöscht und dann neu mit Presence2 über defmod angelegt. Jetzt erhalte ich bei jedem Neustart

2024.03.05 12:06:49 1: Messages collected while initializing FHEM:configfile: Drucker_check: unknown attribute intervalPresent. Type 'attr Drucker_check ?' for a detailed list.
PsnceDaemon already defined, delete it first
DS415_check: unknown attribute intervalPresent. Type 'attr DS415_check ?' for a detailed list.
DS920_check: unknown attribute intervalPresent. Type 'attr DS920_check ?' for a detailed list.
DELL_PC_check: unknown attribute intervalPresent. Type 'attr DELL_PC_check ?' for a detailed list.
ThinkPad_check: unknown attribute intervalPresent. Type 'attr ThinkPad_check ?' for a detailed list.
pi_check: unknown attribute intervalPresent. Type 'attr pi_check ?' for a detailed list.
raspberrypi3b_check: unknown attribute intervalPresent. Type 'attr raspberrypi3b_check ?' for a detailed list.
FB_Internet_check: unknown attribute intervalPresent. Type 'attr FB_Internet_check ?' for a detailed list.

Autosave deactivated

Das Attribut "intervalPresent" wird aber automatisch bei jedem Device hinzugefügt. Löschen hilft hier leider nicht.

Viele Grüße
Jürgen
3x Sonos Play 1, 1x Sonos Arc + Sub, 1 Sonos-One, 1x Sonos Playbar
FB6690 + FB7490 mit 4x Dect 200 und 3 Dect-ULE-Thermostate,  raspberry3B+, HM Funkmodul HM-MOD-RPI-PCB, HM Klingelsensor HM-Sen-DB-PCB, HM (IP) Fensterkontakte und  Amazon Echo Dot,  piVCCU, pi OS (bookworm).

JoWiemann

Zitat von: juemuc am 05 März 2024, 12:20:56Hallo Jörg,

ich habe nach dem Umstieg nun doch Probleme. Habe zuerst alle pressence-Devices inkl Daemon gelöscht und dann neu mit Presence2 über defmod angelegt. Jetzt erhalte ich bei jedem Neustart

2024.03.05 12:06:49 1: Messages collected while initializing FHEM:configfile: Drucker_check: unknown attribute intervalPresent. Type 'attr Drucker_check ?' for a detailed list.
PsnceDaemon already defined, delete it first
DS415_check: unknown attribute intervalPresent. Type 'attr DS415_check ?' for a detailed list.
DS920_check: unknown attribute intervalPresent. Type 'attr DS920_check ?' for a detailed list.
DELL_PC_check: unknown attribute intervalPresent. Type 'attr DELL_PC_check ?' for a detailed list.
ThinkPad_check: unknown attribute intervalPresent. Type 'attr ThinkPad_check ?' for a detailed list.
pi_check: unknown attribute intervalPresent. Type 'attr pi_check ?' for a detailed list.
raspberrypi3b_check: unknown attribute intervalPresent. Type 'attr raspberrypi3b_check ?' for a detailed list.
FB_Internet_check: unknown attribute intervalPresent. Type 'attr FB_Internet_check ?' for a detailed list.

Autosave deactivated

Das Attribut "intervalPresent" wird aber automatisch bei jedem Device hinzugefügt. Löschen hilft hier leider nicht.

Viele Grüße
Jürgen

Hallo Jürgen,

ich habe das einmal beim Testen gehabt und konnte es danach nie wieder reproduzieren. Ich habe alles, was mit Presence2 zu tun hat gelöscht, Fhem runter gefahren und dann den RPi neu gestartet, um das Verhalten mit verbose 5 im global Device nochmal nachzustellen. Tja, RPi fährt hoch, Fhem steht zur Verfügung, defieren des ersten Presence2 Device und alles läuft. Danach habe ich es noch ein paar mal versucht den Fehler nachzustellen. Erfolglos.

Grüße Jörg
Jörg Wiemann

Slave: RPi B+ mit 512 MB, COC (868 MHz), CUL V3 (433.92MHz SlowRF); FHEMduino, Aktuelles FHEM

Master: CubieTruck; Debian; Aktuelles FHEM

juemuc

Hallo Jörg,

ich habe das gleiche Problem auch auf meinem Testsystem (Ubuntu als VM). Haben bei Dir die Devices bzw. der Daemon auch das Attribut "intervalPresent". Ich teste noch einmal. Wie kann ich prüfen, ob die Daemon-Task nicht mehr existiert?

Viele Grüße
Jürgen
3x Sonos Play 1, 1x Sonos Arc + Sub, 1 Sonos-One, 1x Sonos Playbar
FB6690 + FB7490 mit 4x Dect 200 und 3 Dect-ULE-Thermostate,  raspberry3B+, HM Funkmodul HM-MOD-RPI-PCB, HM Klingelsensor HM-Sen-DB-PCB, HM (IP) Fensterkontakte und  Amazon Echo Dot,  piVCCU, pi OS (bookworm).

JoWiemann

Zitat von: juemuc am 05 März 2024, 12:31:10Hallo Jörg,

ich habe das gleiche Problem auch auf meinem Testsystem (Ubuntu als VM). Haben bei Dir die Devices bzw. der Daemon auch das Attribut "intervalPresent". Ich teste noch einmal. Wie kann ich prüfen, ob die Daemon-Task nicht mehr existiert?

Viele Grüße
Jürgen

Hallo Jürgen,

ich habe in meiner 99_myUtils folgende Sub hinterlegt:
###############################################################################
sub listInternalTimer(;$) {
    my ($p) = @_;
$p ||= "";
    my %cop;

    foreach my $e (@intAtA)
    {
        my $name = "";
        if (ref($e->{ARG}) eq "HASH")
        {
            if (exists($e->{ARG}{NAME}))
            {
                $name = $e->{ARG}{NAME};
            }
            elsif (exists($e->{ARG}{arg}))
            {
                $name = $e->{ARG}{arg};
            }           
        }
        elsif ((ref($e->{ARG}) eq "REF") && exists(${$e->{ARG}}->{hash}))
        {
            $name = ${$e->{ARG}}->{hash}{NAME};
        }
        elsif (ref($e->{ARG}) ne "REF")
        {
            $name = $e->{ARG};
        }
        my $time = strftime('%d.%m.%Y %H:%M:%S', localtime($e->{TRIGGERTIME}));
        my $function = sprintf("%-25s %-25s", $name, $e->{FN});
        my $line = "<td>".$e->{atNr}."</td><td>".$time."</td><td>".$function."</td>";

        if ('f' eq $p)
        {
            $cop{$function} = $line;
}
        elsif ('t' eq $p)
        {
            $cop{$time} = $line;
}
        else
        {
            $cop{$name." ".$e->{atNr}} = $line;
}
    }

    my $ret = '<html><table width=50%>';
    $ret .= "<td><b>InternalTimer List</b></td>";
    $ret .= '</tr></tr>';
    $ret .= "<td><b>Number</b></td>";
    $ret .= "<td><b>Date/Time</b></td>";
    $ret .= "<td><b>Function</b></td>";
    $ret .= '</tr>';
   
    foreach my $k (sort keys %cop) {
        $ret .= "$cop{$k}";
        $ret .= '</tr>';
    }

    $ret .= '</table></html>';
    return $ret;
}

und folgenden WebLink definiert:
defmod TimerList weblink cmdList ge_blk_watch:Timer-Anzeigen:InternalTimer
attr TimerList room System

Für mich ist das dann oft hilfreich.

Grüße Jörg
Jörg Wiemann

Slave: RPi B+ mit 512 MB, COC (868 MHz), CUL V3 (433.92MHz SlowRF); FHEMduino, Aktuelles FHEM

Master: CubieTruck; Debian; Aktuelles FHEM

juemuc

3x Sonos Play 1, 1x Sonos Arc + Sub, 1 Sonos-One, 1x Sonos Playbar
FB6690 + FB7490 mit 4x Dect 200 und 3 Dect-ULE-Thermostate,  raspberry3B+, HM Funkmodul HM-MOD-RPI-PCB, HM Klingelsensor HM-Sen-DB-PCB, HM (IP) Fensterkontakte und  Amazon Echo Dot,  piVCCU, pi OS (bookworm).

frank

wenn ihr das modul HMinfo nutzt, kann man dort auch alle timer mit dem cmd "get showTimer" sehen.
FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html

juemuc

Hallo Frank,

danke für den Tipp. Aktuell habe ich das Modul noch nicht im Einsatz. Ich kann es aber im Testsystem einfach mal nutzen.

Viele Grüße
Jürgen
3x Sonos Play 1, 1x Sonos Arc + Sub, 1 Sonos-One, 1x Sonos Playbar
FB6690 + FB7490 mit 4x Dect 200 und 3 Dect-ULE-Thermostate,  raspberry3B+, HM Funkmodul HM-MOD-RPI-PCB, HM Klingelsensor HM-Sen-DB-PCB, HM (IP) Fensterkontakte und  Amazon Echo Dot,  piVCCU, pi OS (bookworm).

juemuc

Hallo Jörg,

bei Deinem Hilfsmodul scheint noch etwas zu fehlen. Ich erhalte diese Meldung beim Aufruf des Weblinks:
Unknown command InternalTimer, try help. Die Definition lautet aber
sub listInternalTimer(;$) Muss ich das nur umbenennen?

Viele Grüße
Jürgen

Das HMInfo funktioniert wohl nur mit einem CUL, den ich nicht habe.
3x Sonos Play 1, 1x Sonos Arc + Sub, 1 Sonos-One, 1x Sonos Playbar
FB6690 + FB7490 mit 4x Dect 200 und 3 Dect-ULE-Thermostate,  raspberry3B+, HM Funkmodul HM-MOD-RPI-PCB, HM Klingelsensor HM-Sen-DB-PCB, HM (IP) Fensterkontakte und  Amazon Echo Dot,  piVCCU, pi OS (bookworm).