Fehlermeldung in 99_MyUtils.pm

Begonnen von Wasserwerk33, 04 Januar 2018, 00:01:22

Vorheriges Thema - Nächstes Thema

Wasserwerk33

Hallo
Leute habe eine fehlermeldung. könnt ihr mir sagen was ich falsch gemacht habe??

ERROR:Missing right curly or square bracket at ./FHEM/99_MyUtils.pm line 74, at end of line syntax error at ./FHEM/99_MyUtils.pm line 74, at EOF

Bin nach diesem Beitrag vorgegangen.
https://forum.fhem.de/index.php/topic,31160.45.html

den bei mir wird leider auch keine symbole mehr angezeigt.

Danke schon mal

KernSani

Nun, da fehlen right curly or square brackets... poste doch bitte mal die betreffende Zeile 74 (in code tags)


Edit: besser auch die vorhergehenden Zeilen bzw. die ganze sub.



RasPi: RFXTRX, HM, zigbee2mqtt, mySensors, JeeLink, miLight, squeezbox, Alexa, Siri, ...

Wasserwerk33

Hier ist meine ganze MyUtils.pm

##############################################
# $Id: myUtilsTemplate.pm 7570 2015-01-14 18:31:44Z rudolfkoenig $
#
# Save this file as 99_myUtils.pm, and create your own functions in the new
# file. They are then available in every Perl expression.

package main;

use strict;
use warnings;
use POSIX;

sub
myUtils_Initialize($$)
{
  my ($hash) = @_;
}

# Enter you functions below _this_ line.

sub CountDown($$)
{
my ($dev,$devState) = @_;
my ($dummy,$ctTime) = split(/ /,$devState);
$ctTime = sprintf("%.0f",$ctTime/60);

if ($ctTime >= 1) {
fhem ("define -temporary ".$dev."_CountDown at +*00:01:00 { \\
my \$count = ReadingsVal(\"$dev\",\"usrCountDown\",\"0\");; \\
my \$status = ReadingsVal(\"$dev\",\"state\",\"off\");; \\
if ( \$status eq \"off\" ) \{ \\
fhem (\"setreading ".$dev." usrCountDown 00:00\");; \\
fhem (\"delete ".$dev."_CountDown\") \\
\} \\
elsif ( \$count > 0 ) \{ \\
\$count -= 1;; \\
fhem (\"setreading ".$dev." usrCountDown \$count\") \\
\} \\
else \{ \\
fhem (\"setreading ".$dev." usrCountDown 00:00\");; \\
fhem (\"delete ".$dev."_CountDown\") \} \\
}");
return sprintf("%02d:%02d",$ctTime,"00");
}
else {
return "Error: value has to be greater than 60s!";
}
}


#####Icon Download#####
sub
icondl
{
my $dllink = shift;
my $reticon = "";
my $subicon = "";
$reticon .= qx(wget -T 5 -N --directory-prefix=/opt/fhem/www/images/weather/ --user-agent='Mozilla/5.0 Firefox/4.0.1' '$dllink');
$subicon = substr $dllink,51,-4;
return $subicon;
}

# alle Proplanta Icons laden
sub ppicondl {
my $b="http://www.proplanta.de/wetterdaten/images/symbole/";
foreach my $i (1..14) {
icondl($b."t".$i.".gif");
}
foreach my $i (1..14) {
icondl($b."n".$i.".gif");
}
foreach my $i (0..10) {
icondl($b."w".$i.".gif");
}

Wernieman

Wenn ich mir Deine letzte sub ansehe, hast Du eine unterschiedliche Anzahl von öffnenden/schließenden { drin. Prüfe dieses bitte mal
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Wasserwerk33

Danke
ja es fehlte einer. Was ein "blödes" zeichen so ausmacht.

Danke nochmals