Probleme mit at"

Begonnen von pfefferkeks, 05 März 2018, 21:43:26

Vorheriges Thema - Nächstes Thema

pfefferkeks

Hallo zusammen,

ich habe Probleme mit "at" in meiner myUtils.pm. Ich versuche "set" Befehle zeitverzögert auszuführen.


#TV
fhem("set living.phy.BroadlinkRmPro commandSend IR_TV_PowerOn");
fhem("define tmpTime2 at +00:00:25 set living.phy.BroadlinkRmPro commandSend IR_TV_Smart");
fhem("define tmpTime3 at +00:00:25 set living.phy.BroadlinkRmPro commandSend IR_TV_Up");
fhem("define tmpTime4 at +00:00:10 set living.phy.BroadlinkRmPro commandSend IR_TV_Right");
fhem("define tmpTime5 at +00:00:10 set living.phy.BroadlinkRmPro commandSend IR_TV_Right");
fhem("define tmpTime6 at +00:00:10 set living.phy.BroadlinkRmPro commandSend IR_TV_Right");
fhem("define tmpTime7 at +00:00:10 set living.phy.BroadlinkRmPro commandSend IR_TV_Right");
fhem("define tmpTime8 at +00:00:10 set living.phy.BroadlinkRmPro commandSend IR_TV_OK");


Leider funktioniert nur die erste Verzögerung von 25 Sekunden (CommandSend: IR_TV_Smart). Alle weiteren Befehle werden direkt gesendet ohne jegliche Verzögerung.

Was mach ich falsch?

Danke und BG
Pfeffer

Otto123

Hi Pfeffer,

Du ratterst einfach 7 Befehle in millisekunden ab und erzeugst in genau diesem Abstand fast parallel loslaufende set Befehle.
:o

ich würde einfach sleep Befehle dazwischen setzen. Es reicht auch eine FHEM "Klammer" für alle aufeinanderfolgenden Befehle.

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Jamo

#2
Du sendest nach 10 Sekunden gleichzeitig 4 x "set living.phy.BroadlinkRmPro commandSend IR_TV_Right" und dazu noch ein "set living.phy.BroadlinkRmPro commandSend IR_TV_OK"
Nach 25 Sekunden gleichzeitig "set living.phy.BroadlinkRmPro commandSend IR_TV_Smart" und "set living.phy.BroadlinkRmPro commandSend IR_TV_Up".

Du möchtest aber wahrscheinlich das der erste Befehl nach 25 sekunden, der 2-te nach 50 sek, der dritte nach 60 sek, der 4-te nach 70 sek usw gesendet wird.

Das geht mit sleep so wie Otto beschrieben hat, also:
fhem("set living.phy.BroadlinkRmPro commandSend IR_TV_PowerOn;sleep 25;set living.phy.BroadlinkRmPro commandSend IR_TV_Smart;sleep 25;set living.phy.BroadlinkRmPro commandSend IR_TV_Up;sleep10; set living.phy.BroadlinkRmPro commandSend IR_TV_Right;sleep 10; set ..... ")
oder so:
#TV
fhem("set living.phy.BroadlinkRmPro commandSend IR_TV_PowerOn");
fhem("define tmpTime2 at +00:00:25 set living.phy.BroadlinkRmPro commandSend IR_TV_Smart");
fhem("define tmpTime3 at +00:00:50 set living.phy.BroadlinkRmPro commandSend IR_TV_Up");
fhem("define tmpTime4 at +00:01:00 set living.phy.BroadlinkRmPro commandSend IR_TV_Right");
fhem("define tmpTime5 at +00:01:10 set living.phy.BroadlinkRmPro commandSend IR_TV_Right");
fhem("define tmpTime6 at +00:01:20 set living.phy.BroadlinkRmPro commandSend IR_TV_Right");
fhem("define tmpTime7 at +00:01:30 set living.phy.BroadlinkRmPro commandSend IR_TV_Right");
fhem("define tmpTime8 at +00:01:40 set living.phy.BroadlinkRmPro commandSend IR_TV_OK");

oder dann:
#TV
fhem("set living.phy.BroadlinkRmPro commandSend IR_TV_PowerOn;
      define tmpTime2 at +00:00:25 set living.phy.BroadlinkRmPro commandSend IR_TV_Smart;
      define tmpTime3 at +00:00:50 set living.phy.BroadlinkRmPro commandSend IR_TV_Up;
      define tmpTime4 at +00:01:00 set living.phy.BroadlinkRmPro commandSend IR_TV_Right;
      define tmpTime5 at +00:01:10 set living.phy.BroadlinkRmPro commandSend IR_TV_Right;
      define tmpTime6 at +00:01:20 set living.phy.BroadlinkRmPro commandSend IR_TV_Right;
      define tmpTime7 at +00:01:30 set living.phy.BroadlinkRmPro commandSend IR_TV_Right;
      define tmpTime8 at +00:01:40 set living.phy.BroadlinkRmPro commandSend IR_TV_OK");
Bullseye auf iNUC, Homematic + HMIP(UART/HMUSB), Debmatic, HUEBridge, Zigbee/Conbee III, FB7690, Alexa (fhem-lazy), Livetracking, LaCrosse JeeLink, LoRaWan / TTN / Chirpstack, Sonos, ESPresence

pfefferkeks

Hallo Otto123, hallo inom,

danke für das Feedback, ich werden das morgen gleich mal ausprobieren. Da hatte ich scheinbar bei den "at" defines etwas missverstanden, ich dachte es ist jedes ,,set" in einer eigenen fhem An-weisung zu verpacken, das würde ich einmal als grundlegendes learning verstehen ;-)

Danke euch noch mal!

BG
pfeffer