[gelöst] DOIF nach shutdown restart bzw. Neustart des RaspberyPi

Begonnen von Horst_T, 27 November 2017, 14:01:43

Vorheriges Thema - Nächstes Thema

Horst_T

Hallo,

vielleicht kann mir jemand weiterhelfen. Habe folgendes Problem:
Ich möchte über Keymatic dir Tür öffnen sobald bei G-Tag per Blootooth erkannt wird. Das ganze ist folgendermaßen gelöst und funktioniert auch.

define GtagWsHorst PRESENCE lan-bluetooth 7C:2F:80:CE:F2:31 127.0.0.1:5222 10 10

define presentHorst DOIF ([GtagWsHorst] eq "present")  (set presentHorstStatus present) DOELSE (set presentHorstStatus absent)

define Key_Horst DOIF ([presentHorstStatus:"present"] and [HomeStatus] ne "Nacht" and [HomeStatus] ne "Urlaub") (set Tuerschloss open)

Jetzt zum Problem:
Wenn ich zu Hause bin ein shutdown restart durchführe oder den Raspi neu starte, wird die Tür geöffnet.
Alle Versuche mit event-on-change-reading und event-on-update-reading haben nichts gebracht.

Gruß Horst
FHEM-Server: RaspberryPi 3 Stretch fhem:Ver. 5.8
HomeMatic: HM-LC-Sw1PBU-FM, HM-LC-DIM1PBU-FM, HM-Sec-SD, HM-Sec-RHS, HM-RC-19-B
RaspberryMatic: HmIP-FAL230-C6, HmIP-WTH2
FritzBox 7490 FritzOS 06.92

kumue

such mal nach
global:INITIALIZED

Das Event kommt bei Neustart und dann kannst Du ja mit notify/DOIF festlegen, was bei diesem Event gemacht werden soll.. zB. Tür schließen

MadMax-FHEM

Wie aktuell ist fhem?

Ähnliche Probleme (zumindest so wie ich es verstanden habe) waren schon einige Male hier im Forum:

https://forum.fhem.de/index.php/topic,69423.msg609211.html#msg609211

https://forum.fhem.de/index.php/topic,71744.msg632768.html#msg632768

oder eben wie genannt zusätzlich selbst (falls nicht [wie ich beim Überfliegen der verlinkten Threads gelesen zu haben glaube] gefixt) abfragen von global:INITIALIZED

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

Horst_T

Vielen Dank für die schnellen Antworten.

Das System ist auf dem aktuellsten Stand, daran kann es nicht liegen. Werde heute Nachmittag mit Abfrage von global:INITIALIZED mal Testen.

Werde berichten ob ich Erfolg hatte.

Vielen Dank Horst
FHEM-Server: RaspberryPi 3 Stretch fhem:Ver. 5.8
HomeMatic: HM-LC-Sw1PBU-FM, HM-LC-DIM1PBU-FM, HM-Sec-SD, HM-Sec-RHS, HM-RC-19-B
RaspberryMatic: HmIP-FAL230-C6, HmIP-WTH2
FritzBox 7490 FritzOS 06.92

Horst_T

Nochmal vielen Dank

Habe die Abfrage global:INITIALIZED eingebaut und das Problem, an dem ich lange rumgemacht habe, ist gelöst.

Gruß Horst
FHEM-Server: RaspberryPi 3 Stretch fhem:Ver. 5.8
HomeMatic: HM-LC-Sw1PBU-FM, HM-LC-DIM1PBU-FM, HM-Sec-SD, HM-Sec-RHS, HM-RC-19-B
RaspberryMatic: HmIP-FAL230-C6, HmIP-WTH2
FritzBox 7490 FritzOS 06.92

Frank_Huber

Für die Nachwelt:
Wo hast es eingebaut? poste doch noch den funktionierenden define.

Horst_T

Habe folgendes geändert:

define GtagWsHorst PRESENCE lan-bluetooth 7C:2F:80:CE:F2:31 127.0.0.1:5222 10 10

define presentHorst DOIF ([GtagWsHorst] eq "present")  (set presentHorstStatus present) DOELSE (set presentHorstStatus absent)

define di_init DOIF ([global:?INITIALIZED]) (set init on, sleep 10, set init off) DOELSE (set init off)

define Key_Horst DOIF ([presentHorstStatus:"present"] and [HomeStatus] ne "Nacht" and [HomeStatus] ne "Urlaub"  and [init] eq "off") (set Tuerschloss open)

Gruß Horst
FHEM-Server: RaspberryPi 3 Stretch fhem:Ver. 5.8
HomeMatic: HM-LC-Sw1PBU-FM, HM-LC-DIM1PBU-FM, HM-Sec-SD, HM-Sec-RHS, HM-RC-19-B
RaspberryMatic: HmIP-FAL230-C6, HmIP-WTH2
FritzBox 7490 FritzOS 06.92

Damian

Zitat von: Horst_T am 27 November 2017, 17:24:01
Habe folgendes geändert:

define GtagWsHorst PRESENCE lan-bluetooth 7C:2F:80:CE:F2:31 127.0.0.1:5222 10 10

define presentHorst DOIF ([GtagWsHorst] eq "present")  (set presentHorstStatus present) DOELSE (set presentHorstStatus absent)

define di_init DOIF ([global:?INITIALIZED]) (set init on, sleep 10, set init off) DOELSE (set init off)

define Key_Horst DOIF ([presentHorstStatus:"present"] and [HomeStatus] ne "Nacht" and [HomeStatus] ne "Urlaub"  and [init] eq "off") (set Tuerschloss open)

Gruß Horst

Bitte neue Syntax verwenden:

([global:"INITIALIZED"])

sonst funktioniert die Abfrage nach einem DOIF-Update irgendwann nicht mehr.
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

Horst_T

FHEM-Server: RaspberryPi 3 Stretch fhem:Ver. 5.8
HomeMatic: HM-LC-Sw1PBU-FM, HM-LC-DIM1PBU-FM, HM-Sec-SD, HM-Sec-RHS, HM-RC-19-B
RaspberryMatic: HmIP-FAL230-C6, HmIP-WTH2
FritzBox 7490 FritzOS 06.92