Hallo,
vielleicht kann mir jemand bei offenbar sinnlosen Logeinträgen helfen:
016.11.29 13:53:53 1: Error: switch_dect has no TYPE
2016.11.29 13:53:53 1: Error: switch_hm has no TYPE
2016.11.29 13:54:09 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 13:54:51 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 13:55:10 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 13:55:51 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 13:56:02 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 13:56:10 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 13:56:51 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 13:56:52 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
und
2016.11.29 13:59:47 1: Error: has no TYPE
2016.11.29 13:59:47 1: Error: switch_dect has no TYPE
2016.11.29 13:59:47 1: Error: switch_hm has no TYPE
2016.11.29 13:59:48 1: Error: has no TYPE
2016.11.29 13:59:48 1: Error: switch_dect has no TYPE
2016.11.29 13:59:48 1: Error: switch_hm has no TYPE
2016.11.29 13:59:48 1: Error: has no TYPE
2016.11.29 13:59:48 1: Error: switch_dect has no TYPE
2016.11.29 13:59:48 1: Error: switch_hm has no TYPE
2016.11.29 13:59:48 1: Error: has no TYPE
2016.11.29 13:59:48 1: Error: switch_dect has no TYPE
2016.11.29 13:59:48 1: Error: switch_hm has no TYPE
2016.11.29 13:59:50 1: Error: has no TYPE
2016.11.29 13:59:50 1: Error: switch_dect has no TYPE
2016.11.29 13:59:50 1: Error: switch_hm has no TYPE
2016.11.29 13:59:51 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 14:00:10 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
Diese Begriffe switch_dect und switch_hm habe ich ausschließlich in SVG-Dateien verwendet und in fhem.cfg definiert:
define SVG_fhemDbLog_switch_hm SVG fhemDbLog:SVG_DbLog_switch_hm:CURRENT
attr SVG_fhemDbLog_switch_hm captionLeft 1
attr SVG_fhemDbLog_switch_hm room DBplots.Elektro
define SVG_fhemDbLog_switch_dect SVG fhemDbLog:SVG_DbLog_switch_dect:CURRENT
attr SVG_fhemDbLog_switch_dect captionLeft 1
attr SVG_fhemDbLog_switch_dect room DBplots.Elektro
und dort in "SVG_DbLog_switch_hm.gplot"
# Created by FHEM/98_SVG.pm, 2016-11-28 16:16:15
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title 'HM-Switch'
set ytics
set y2tics ("1off" 1.0, "1on" 2.0, "2off" 4.0, "2on" 5.0)
set grid ytics y2tics
set ylabel "Energie HM-1"
set y2label ""
set y2range [0:6]
#lp DbLog:fhemDbLog,predict,extend=60*60*24:sw_hm_1_Pwr:power
#lp DbLog:fhemDbLog,predict,extend=60*60*24:sw_hm_2_Pwr:power
#lp DbLog:fhemDbLog,predict,extend=60*60*24:sw_hm_1_Sw:state:::$val=($val=~"on"?2.0:1.0)
#lp DbLog:fhemDbLog,predict,extend=60*60*24:sw_hm_2_Sw:state:::$val=($val=~"on"?5.0:4.0)
plot "<IN>" using 1:2 axes x1y1 title 'HM-1' ls l1 lw 2 with steps,\
"<IN>" using 1:2 axes x1y1 title 'HM-2' ls l0 lw 1 with steps,\
"<IN>" using 1:2 axes x1y2 notitle ls l5 lw 2 with steps,\
"<IN>" using 1:2 axes x1y2 notitle ls l5 lw 2 with steps
und in "SVG_DbLog_switch_dect.gplot"
# Created by FHEM/98_SVG.pm, 2016-11-03 19:26:26
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title 'DECT2000'
set ytics
set y2tics
set grid ytics y2tics
set ylabel "Energie [W]"
set y2label "Temperature [C]"
set yrange [0:500]
set y2range [-5:25]
#lp DbLog:fhemDbLog,predict,extend=60*60*24:sw_dect_1:IntPower
#lp DbLog:fhemDbLog,predict,extend=60*60*24:sw_dect_1:IntTemp
plot "<IN>" using 1:2 axes x1y1 title 'Energie' ls l0fill lw 2 with steps,\
"<IN>" using 1:2 axes x1y2 title 'Temperatur' ls l5 lw 2 with lines
Die Plots werden einwandfrei ausgegeben, aber das Logfile wird zugemüllt und offenbar scheint hier irgendetwas nicht so ganz richtig zu sein, aber was? Vielleicht kann das jemand sofort sehen.
IntPower wurde beispielsweise wie folgt definiert:
attr sw_hm_1_Pwr userReadings IntPower {round(ReadingsVal("sw_hm_1_Pwr","power",0),1);;}
Schon mal vielen Dank für das Lesen, auch wenn es kein Ergebnis bringen sollte.
Ich kann nicht so ganz glauben, dass "switch_dect" etc. nur in "SVG-Dateien" verwendet wurde.
Erstens wird man in der Regel bei FHEM SVG-Dateien nur als ziemlich fortgeschrittener Experte verwenden - siehe hier: https://wiki.selfhtml.org/wiki/SVG/Einbindung
Zweitens sagen die Log-Einträge etwas Anderes. Irgendwo wurde das als Name in der FHEM-Konfiguration verwendet.
Bitte nochmal überprüfen.
LG
pah
Hi,
mach mal ein list TYPE=
da bin ich mir nicht ganz sicher ob es funktioniert
Den hab ich aus dem Wiki http://www.fhemwiki.de/wiki/Cmdalias#shownotypedevices
{ join("\n", grep { !defined($defs{$_}{TYPE}) } keys %defs) }
Und bei der Suche im Forum helfen die hier " -> "has no type"
8)
Gruß Otto
Vielen Dank für die Hilfe.
Also ich habe alle verwendeten Dateien *.cfg und 99_myUlils.pm nach den Begriffen "switch_hm" und "switch_dect" abgesucht. Sie treten ausschließlich als Namensende bei
define SVG_fhemDbLog_switch_hm SVG fhemDbLog:SVG_DbLog_switch_hm:CURRENT
und
define SVG_fhemDbLog_switch_dect SVG fhemDbLog:SVG_DbLog_switch_dect:CURRENT
Diese Begriffe werden nirgends gefunden (außer s.o.).
Die Schaltsteckdosen sind wie folgt definiert:
#################################################################
# AVM Fritzbox DECT-200-Schaltsteckdose
#################################################################
define sw_dect_1 FBDECT Fbox_AHA:16 switch
attr sw_dect_1 IODev Fbox_AHA
attr sw_dect_1 event-min-interval power:120
attr sw_dect_1 event-on-change-reading (state|IntPower|IntTemp).*
attr sw_dect_1 group Switches
attr sw_dect_1 room Switches
attr sw_dect_1 userReadings IntPower {sprintf("%.1f",substr(ReadingsVal("sw_dect_1","power",0),0,length((ReadingsVal("sw_dect_1","power",0)))-2));;}, IntTemp {substr(ReadingsVal("sw_dect_1","temperature",0),0,4);;}
#################################################################
## Schaltsteckdose 1
#################################################################
define sw_hm_1 CUL_HM 342084
attr sw_hm_1 IODev hmusb
attr sw_hm_1 actCycle 000:10
attr sw_hm_1 actStatus alive
attr sw_hm_1 autoReadReg 4_reqStatus
attr sw_hm_1 expert 2_raw
attr sw_hm_1 firmware 1.6
attr sw_hm_1 group Switches
attr sw_hm_1 model HM-ES-PMSw1-Pl
attr sw_hm_1 room Switches
attr sw_hm_1 serialNr LEQ1272888
attr sw_hm_1 subType powerMeter
attr sw_hm_1 webCmd getConfig:clear msgEvents
## Schaltkanal, über den die am PMSw1 eingesteckten Verbraucher ein- und ausgeschaltet werden
define sw_hm_1_Sw CUL_HM 34208401
attr sw_hm_1_Sw event-on-change-reading state.*
attr sw_hm_1_Sw model HM-ES-PMSw1-Pl
attr sw_hm_1_Sw peerIDs 00000000,
## Messkanal: energy: [Ws], power: [W], current: [A], voltage: [V], 50: [Hz]
define sw_hm_1_Pwr CUL_HM 34208402
attr sw_hm_1_Pwr alias OnePlusMess
attr sw_hm_1_Pwr event-on-change-reading (IntPower.*|power.*)
attr sw_hm_1_Pwr model HM-ES-PMSw1-Pl
attr sw_hm_1_Pwr userReadings IntPower {round(ReadingsVal("sw_hm_1_Pwr","power",0),1);;}
define sw_hm_1_SenPwr CUL_HM 34208403
attr sw_hm_1_SenPwr model HM-ES-PMSw1-Pl
attr sw_hm_1_SenPwr peerIDs 00000000,
define sw_hm_1_SenI CUL_HM 34208404
attr sw_hm_1_SenI model HM-ES-PMSw1-Pl
attr sw_hm_1_SenI peerIDs 00000000,
define sw_hm_1_SenU CUL_HM 34208405
attr sw_hm_1_SenU model HM-ES-PMSw1-Pl
attr sw_hm_1_SenU peerIDs 00000000,
define sw_hm_1_SenF CUL_HM 34208406
attr sw_hm_1_SenF model HM-ES-PMSw1-Pl
attr sw_hm_1_SenF peerIDs 00000000,
# Fahrrad-Batterieladegerät ausschalten bei Verbrauch kleiner gleich 5 Watt
define not_sw_hm_1_Aus notify sw_hm_1_Pwr:power.* { if (Value("SwHm1PowerOff") eq "on") { \
if (Value("sw_hm_1_Sw") eq "on") { \
if (ReadingsVal("sw_hm_1_Pwr","power","") <= 5 && Value("sw_hm_1_Sw") eq "on") { \
fhem ("set sw_hm_1_Sw off");; \
fhem ("set pushmsg msg 'FHEM' 'Fahrrad-Batterie ist geladen' '' 0 ''");;}}}}
define SwHm1PowerOff dummy
attr SwHm1PowerOff room Switches
#################################################################
## Schaltsteckdose 2
#################################################################
define sw_hm_2 CUL_HM 33C26F
attr sw_hm_2 IODev hmusb
attr sw_hm_2 actCycle 000:10
attr sw_hm_2 actStatus alive
attr sw_hm_2 autoReadReg 4_reqStatus
attr sw_hm_2 expert 2_raw
attr sw_hm_2 firmware 1.6
attr sw_hm_2 group Switches
attr sw_hm_2 model HM-ES-PMSw1-Pl
attr sw_hm_2 room Switches
attr sw_hm_2 serialNr LEQ1315508
attr sw_hm_2 subType powerMeter
attr sw_hm_2 webCmd getConfig:clear msgEvents
# Schaltkanal, über den die am PMSw1 eingesteckten Verbraucher ein- und ausgeschaltet werden
define sw_hm_2_Sw CUL_HM 33C26F01
attr sw_hm_2_Sw event-on-change-reading state.*
attr sw_hm_2_Sw model HM-ES-PMSw1-Pl
attr sw_hm_2_Sw peerIDs 00000000,
# Messkanal: energy: [Ws], power: [W], current: [A], voltage: [V], 50: [Hz]
define sw_hm_2_Pwr CUL_HM 33C26F02
attr sw_hm_2_Pwr event-on-change-reading (IntPower.*|power.*)
attr sw_hm_2_Pwr model HM-ES-PMSw1-Pl
attr sw_hm_2_Pwr userReadings IntPower {round(ReadingsVal("sw_hm_2_Pwr","power",0),1);;}
define sw_hm_2_SenPwr CUL_HM 33C26F03
attr sw_hm_2_SenPwr model HM-ES-PMSw1-Pl
attr sw_hm_2_SenPwr peerIDs 00000000,
define sw_hm_2_SenI CUL_HM 33C26F04
attr sw_hm_2_SenI model HM-ES-PMSw1-Pl
attr sw_hm_2_SenI peerIDs 00000000,
define sw_hm_2_SenU CUL_HM 33C26F05
attr sw_hm_2_SenU model HM-ES-PMSw1-Pl
attr sw_hm_2_SenU peerIDs 00000000,
define sw_hm_2_SenF CUL_HM 33C26F06
attr sw_hm_2_SenF model HM-ES-PMSw1-Pl
attr sw_hm_2_SenF peerIDs 00000000,
# Ryobi--Batterieladegerät ausschalten bei Verbrauch kleiner gleich 5 Watt
define not_sw_hm_2_Aus notify sw_hm_2_Pwr:power.* { if (Value("SwHm2PowerOff") eq "on") { \
if (Value("sw_hm_2_Sw") eq "on") { \
if (ReadingsVal("sw_hm_2_Pwr","power","") <= 5 && Value("sw_hm_2_Sw") eq "on") { \
fhem ("set sw_hm_2_Sw off");; \
fhem ("set pushmsg msg 'FHEM' 'Ryobi One+ ist geladen' '' 0 ''");;}}}}
define SwHm2PowerOff dummy
attr SwHm2PowerOff room Switches
Das muß nicht elegant programmiert sein, funktioniert aber zuverlässig, denn ich kann eigentlich nur C gut und programmiere Perl auch so. Angefangen hatte ich mal mit ALGOL68 und Perl werde ich nicht mehr lernen.
Die Anmerkungen von pah zu den SVG-Files verstehe ich nicht, denn die werden im wesentlichen durch fhem selbst geschrieben und die Einbindung in das Tablet UI ist sehr einfach. Obwohl ich mich als Anfänger empfinde (wg. fehlender Perl-Kenntnisse), habe ich doch in meinem Haus viele Sachen in FHEM eingebunden, die auch zuverlässig funktionieren, und auch schöne Plots gemacht, wie anhängend dargestellt.
Auch die Hilfestellung von Otto hat so nicht funktioniert, also ich bin immer noch ratlos und kann mit den Einträgen im Log-File immer noch nichts anfangen
Nachtrag:
Die Hilfestellung von Otto hatte ich nur flüchtig gelesen, nun habe ich das mal ordentlich gemacht und richtig, beide Namen wurden ausgeworfen:
define c_shownotypedevices cmdalias shownotypedevices AS { join("\n", grep { !defined($defs{$_}{TYPE}) } keys %defs) }
Ich habe sie gelöscht, aber es ist unklar wann und wo sie definiert wurden, in den Konfigurationsdateien sind sie nirgends definiert.
2016.11.29 21:47:51 0: Strange call for typeless switch_hm: UndefFn
2016.11.29 21:47:51 0: Strange call for typeless switch_hm: DeleteFn
2016.11.29 21:48:01 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 21:48:03 0: Strange call for typeless switch_dect: UndefFn
2016.11.29 21:48:03 0: Strange call for typeless switch_dect: DeleteFn
Wie kann man den mal die gesamte Konfiguration überprüfen?
Nachdem die Konfiguration gespeichert wurde, tauchen diese Fehlermeldungen immer noch auf:
...
016.11.29 21:55:09 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 21:55:23 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 21:55:53 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 21:56:01 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 21:56:02 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 21:56:23 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.11.29 21:56:37 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
...
Was hier in Zeile 4634 passiert, das kann ich nicht nachvollziehen, aber dort wird der Fehler erkannt:
sub
fhemFork()
{
my $pid = fork;
if(!defined($pid)) {
Log 1, "Cannot fork: $!";
stacktrace() if($attr{global}{stacktrace});
return undef;
}
return $pid if($pid);
# Child here
# Close FDs as we cannot restart FHEM if child keeps TCP Serverports open
foreach my $d (sort keys %defs) {
my $h = $defs{$d};
$h->{DBH}->{InactiveDestroy} = 1 ## <-- Zeile 4634
if($h->{TYPE} eq 'DbLog' && $h->{DBH}); #Forum #43271
TcpServer_Close($h) if($h->{SERVERSOCKET});
if($h->{DeviceName}) {
require "$attr{global}{modpath}/FHEM/DevIo.pm";
DevIo_CloseDev($h,1);
}
}
$SIG{CHLD} = 'DEFAULT'; # Forum #50898
return 0;
}
Hast Du neu gestartet?
Ansonsten suche mal bitte nach "value in string eq at fhem.pl line" mit den " !!! Auch das war nicht flüchtig gemeint ;)
Da gibt es einiges aber ich kann das nicht alles für Dich durchlesen...
Gruß Otto
Vielen Dank Otto, nach dem Neustart sind die sinnlosen Log-Einträge offenbar verschwunden. Vielen Dank für Deine Hilfe.
Deinen letzten Hinweis habe ich nicht verstanden, aber muß auch nicht sein, es ist ja jetzt alles okay. Aber wie diese beiden faschen Einträge da hinein gekommen sind, das ist mir weiterhin unklar, aber nicht so wichtig.
Vielen Dank.
Nachtrag:
Obwohl ich die beiden unklaren Einträge gelöscht habe, sind jetzt wieder ominöse Einträge aufgetaucht, die nun gar keinen Hinweis auf die Ursache geben:
2016.12.04 23:55:04 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.12.04 23:55:13 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.12.04 23:55:20 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.12.04 23:55:49 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.12.04 23:55:52 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.12.04 23:56:04 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.12.04 23:56:18 1: PERL WARNING: Use of uninitialized value in hash element at ./FHEM/01_FHEMWEB.pm line 1611.
2016.12.04 23:56:18 1: Error: has no TYPE
2016.12.04 23:56:18 1: PERL WARNING: Use of uninitialized value in string ne at ./FHEM/33_readingsGroup.pm line 1224.
2016.12.04 23:56:19 1: Error: has no TYPE
2016.12.04 23:56:20 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
2016.12.04 23:56:25 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4634.
Das ist nur einen kleine Auswahl. Alle mir bekannten Untersuchungsmethoden habe ich versucht (shownotypedevices, showignoreddevices), aber kein Ergebnis. Es muß doch eine Möglichkeit geben die Konsistenz der Konfiguration zu überprüfen. Wo kann ich denn noch nachsehen?
Ansonsten kann ich nur zyklisch das Logfile löschen, was aber keine befriedigende Lösung wäre.