Weekdaytimer mit perl code

Begonnen von willib, 10 Januar 2017, 21:39:14

Vorheriges Thema - Nächstes Thema

willib

Hallo Zusammen,

ich habe mir mt Weekdaytimer und einen Hue Lightstrip ein primitives wakeuplight gebaut. DEF
HUEDevice6 12345|06:20|{fhem("set HUEDevice6 pct 1"); fhem("set HUEDevice6 pct 40 : transitiontime 18000")} 12345|07:30|{fhem("set HUEDevice6 off")}
Das Einschalten und Hochdimmen funktioniert. Aber es steht dann folgendes im Log
2017.01.10 06:20:00 1: [Wakeuplight] problem calculating dynamic param: ........... {fhem("set HUEDevice6 pct 1"); fhem("set HUEDevice6 pct 40 : transitiontime 18000")}
2017.01.10 06:20:00 1: [Wakeuplight]
2017.01.10 06:20:00 1: PERL WARNING: Use of uninitialized value $newParam in string ne at ./FHEM/98_WeekdayTimer.pm line 983.

Das Ausschalten funktioniert nicht. Im Log steht:
2017.01.10 07:30:00 1: [Wakeuplight] problem calculating dynamic param: ........... {fhem("set HUEDevice6 off")}
2017.01.10 07:30:00 1: [Wakeuplight]


Kann mir bitte jemand einen Tipp geben?
Dankeschön.
FHEM in Debian 10 LXC unter Proxmox auf NUC, Homematic, Hue, Intertechno, Jeelink, RFXTRX, Harmony Hub, VU+ Uno 4K, Sonos, AMAD

Dietmar63

Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

Dietmar63

beschreib mal was du erreichen willst.
Welche Kommandos sollen wann abgesetzt werden?
Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

willib

Hallo Dietmar,

zuerst mal vielen Dank für deine Hilfe. Ich finde es super wie aktiv du hier die Anfänger unterstützt.
Momentan funktioniert alles genau wie es soll. Die Meldungen beim Einschalten um 6:20 kommen zwar immer noch. Aber die Meldung beim Ausschalten um 7:30 ist weg und es wird auch ausgeschaltet.
Es soll unter der Woche um 6:20 der HUE Lightstrip eingeschaltet werden mit pct1 und dann binnen einer halben Stunde auf pct 40 hochgedimmt werden.
FHEM in Debian 10 LXC unter Proxmox auf NUC, Homematic, Hue, Intertechno, Jeelink, RFXTRX, Harmony Hub, VU+ Uno 4K, Sonos, AMAD

willib

Heute morgen ist das Licht angegangen. Das sollte nicht so sein. Da bekomme ich Ärger mit meiner Frau. Hier Mal die internals
COMMAND
CONDITION
DEF
HUEDevice6 12345|06:15|{fhem("set HUEDevice6 pct 1"); fhem("set HUEDevice6 pct 40 : transitiontime 18000")} 12345|08:00|{fhem("set HUEDevice6 off")}
DEVICE
HUEDevice6
GlobalDaylistSpec
LANGUAGE
de
NAME
Wakeuplight
NR
222
Profil 1: Montag
06:15:00 {fhem("set HUEDevice6 pct 1"); fhem("set HUEDevice6 pct 40 : transitiontime 18000")}, 08:00:00 {fhem("set HUEDevice6 off")}
Profil 2: Dienstag
06:15:00 {fhem("set HUEDevice6 pct 1"); fhem("set HUEDevice6 pct 40 : transitiontime 18000")}, 08:00:00 {fhem("set HUEDevice6 off")}
Profil 3: Mittwoch
06:15:00 {fhem("set HUEDevice6 pct 1"); fhem("set HUEDevice6 pct 40 : transitiontime 18000")}, 08:00:00 {fhem("set HUEDevice6 off")}
Profil 4: Donnerstag
06:15:00 {fhem("set HUEDevice6 pct 1"); fhem("set HUEDevice6 pct 40 : transitiontime 18000")}, 08:00:00 {fhem("set HUEDevice6 off")}
Profil 5: Freitag
06:15:00 {fhem("set HUEDevice6 pct 1"); fhem("set HUEDevice6 pct 40 : transitiontime 18000")}, 08:00:00 {fhem("set HUEDevice6 off")}
STATE
active
STILLDONETIME
0
TYPE
WeekdayTimer
FHEM in Debian 10 LXC unter Proxmox auf NUC, Homematic, Hue, Intertechno, Jeelink, RFXTRX, Harmony Hub, VU+ Uno 4K, Sonos, AMAD

Dietmar63

Ich antworte nachher.
Die Antwort wird länger
Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

Dietmar63

versuch mal morgen nach einem update:

define wdt WeekdayTimer HUEDevice6 12345|06:20|pct:1; 12345|06:20:05|pct:40:\::transitiontime:18000 12345|07:30|off


Der Doppelpunkt ist ein Sonderzeichen, der in ein " " verwandelt wird.
Der backslash in :\:: ist eine Maskierung und verhindert die Verwandlung des : in ein " ".

Wenn du das Device geändert hast, bitte mal mit verbose 5 laufen lassen und ggf. posten.


Wenn du Code in timeSpecifieern angibst, dann wird der code immer bedingunslos zum angegeben Zeitpunkt ausgeführt um den param zu ermitteln, der gesendet werden soll.
Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

willib

#7
Hallo Dietmar,

vielen Dank. Habe noch ein Semikolon eingefügt.
define wdt WeekdayTimer HUEDevice6 12345|06:20|pct:1;; 12345|06:20:05|pct:40:\::transitiontime:18000 12345|07:30|off
Jetzt sieht es gut aus.
CFGFN
COMMAND
CONDITION
DEF   
HUEDevice6 12345|06:20|pct:1; 12345|06:20:05|pct:40:\::transitiontime:18000 12345|07:30|off
DEVICE
HUEDevice6
GlobalDaylistSpec
LANGUAGE
de
NAME
wdt
NR
383
Profil 1: Montag
06:20:00 pct:1;, 06:20:05 pct:40:\::transitiontime:18000, 07:30:00 off
Profil 2: Dienstag
06:20:00 pct:1;, 06:20:05 pct:40:\::transitiontime:18000, 07:30:00 off
Profil 3: Mittwoch
06:20:00 pct:1;, 06:20:05 pct:40:\::transitiontime:18000, 07:30:00 off
Profil 4: Donnerstag
06:20:00 pct:1;, 06:20:05 pct:40:\::transitiontime:18000, 07:30:00 off
Profil 5: Freitag
06:20:00 pct:1;, 06:20:05 pct:40:\::transitiontime:18000, 07:30:00 off
STATE
active
STILLDONETIME
0
TYPE
WeekdayTimer
Verbose 5 Log kommt morgen.
FHEM in Debian 10 LXC unter Proxmox auf NUC, Homematic, Hue, Intertechno, Jeelink, RFXTRX, Harmony Hub, VU+ Uno 4K, Sonos, AMAD

willib

So, hier das Log fürs Einschalten mit einer Warnung:
2017.01.17 06:20:00 4: [wdt] time=06:20/1484630400 delay=0, nextDelay=60, nextRetry=1484630460
2017.01.17 06:20:00 4: [wdt] delayedExecutionCond:0
2017.01.17 06:20:00 4: [wdt] result of delayedExecutionCond:0
2017.01.17 06:20:00 4: [wdt] list of window sensors found: 'wdt'
2017.01.17 06:20:00 4: [wdt] condition: - Tage:1,2,3,4,5
2017.01.17 06:20:00 5: [wdt] condition: {my $days={};;map{$days->{$_}=1}(1,2,3,4,5);;;;( 1 && (defined $days->{$wday}))}
2017.01.17 06:20:00 5: [wdt] result of condition:1
2017.01.17 06:20:00 4: [wdt] Update   - timer seems to be active today: 12345|06:20|pct:1;
2017.01.17 06:20:00 4: [wdt] aktParam: newParam:pct:1; - is  not disabled
2017.01.17 06:20:00 4: [wdt] command: 'set $NAME  $EVENT' executed with %NAME=>HUEDevice6,%EVENT=>pct 1;
2017.01.17 06:20:00 1: PERL WARNING: Argument "1;" isn't numeric in numeric eq (==) at ./FHEM/31_HUEDevice.pm line 383.
2017.01.17 06:20:05 4: [wdt] time=06:20:05/1484630405 delay=0, nextDelay=60, nextRetry=1484630465
2017.01.17 06:20:05 4: [wdt] delayedExecutionCond:0
2017.01.17 06:20:05 4: [wdt] result of delayedExecutionCond:0
2017.01.17 06:20:05 4: [wdt] list of window sensors found: 'wdt'
2017.01.17 06:20:05 4: [wdt] condition: - Tage:1,2,3,4,5
2017.01.17 06:20:05 5: [wdt] condition: {my $days={};;map{$days->{$_}=1}(1,2,3,4,5);;;;( 1 && (defined $days->{$wday}))}
2017.01.17 06:20:05 5: [wdt] result of condition:1
2017.01.17 06:20:05 4: [wdt] Update   - timer seems to be active today: 12345|06:20:05|pct:40:\::transitiontime:18000
2017.01.17 06:20:05 4: [wdt] aktParam: newParam:pct:40:\::transitiontime:18000 - is  not disabled
2017.01.17 06:20:05 4: [wdt] command: 'set $NAME  $EVENT' executed with %EVENT=>pct 40 : transitiontime 18000,%NAME=>HUEDevice6


Auschalten:
2017.01.17 07:30:00 4: [wdt] time=07:30/1484634600 delay=0, nextDelay=60, nextRetry=1484634660
2017.01.17 07:30:00 4: [wdt] delayedExecutionCond:0
2017.01.17 07:30:00 4: [wdt] result of delayedExecutionCond:0
2017.01.17 07:30:00 4: [wdt] list of window sensors found: 'wdt'
2017.01.17 07:30:00 4: [wdt] condition: - Tage:1,2,3,4,5
2017.01.17 07:30:00 5: [wdt] condition: {my $days={};;map{$days->{$_}=1}(1,2,3,4,5);;;;( 1 && (defined $days->{$wday}))}
2017.01.17 07:30:00 5: [wdt] result of condition:1
2017.01.17 07:30:00 4: [wdt] Update   - timer seems to be active today: 12345|07:30|off
2017.01.17 07:30:00 4: [wdt] aktParam: newParam:off - is  not disabled
2017.01.17 07:30:00 4: [wdt] command: 'set $NAME  $EVENT' executed with %NAME=>HUEDevice6,%EVENT=>off
FHEM in Debian 10 LXC unter Proxmox auf NUC, Homematic, Hue, Intertechno, Jeelink, RFXTRX, Harmony Hub, VU+ Uno 4K, Sonos, AMAD

Dietmar63

Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

willib

Hallo Dietmar,

Nochmal Danke.
Wenn ich das zweite Semikolon weg lasse kommt:
Unknown command 12345|06:20:05|pct:40:\::transitiontime:18000, try help
FHEM in Debian 10 LXC unter Proxmox auf NUC, Homematic, Hue, Intertechno, Jeelink, RFXTRX, Harmony Hub, VU+ Uno 4K, Sonos, AMAD