diff --git a/fhem/FHEM/72_FRITZBOX.pm b/fhem/FHEM/72_FRITZBOX.pm index 93815675d..9ab5d0e96 100644 --- a/fhem/FHEM/72_FRITZBOX.pm +++ b/fhem/FHEM/72_FRITZBOX.pm @@ -858,11 +858,12 @@ sub FRITZBOX_Readout_Process($$) readingsBulkUpdate( $hash, "state", $newState); FRITZBOX_Log $hash, 5, "SET state = '$newState'"; } + + my $msg = keys( %values )." values captured in ".$values{readoutTime}." s"; + readingsBulkUpdate( $hash, "lastReadout", $msg ); + FRITZBOX_Log $hash, 4, $msg; } - my $msg = keys( %values )." values captured in ".$values{readoutTime}." s"; - readingsBulkUpdate( $hash, "lastReadout", $msg ); - FRITZBOX_Log $hash, 4, $msg; readingsEndUpdate( $hash, 1 ); } @@ -977,8 +978,14 @@ sub FRITZBOX_Readout_Format($$$) $readout =~ s/1/on/; } elsif ($format eq "radio") { - $readout = $hash->{fhem}{radio}{$readout} - if defined $hash->{fhem}{radio}{$readout}; + if (defined $hash->{fhem}{radio}{$readout}) + { + $readout = $hash->{fhem}{radio}{$readout}; + } + else + { + $readout .= " (unknown)"; + } } elsif ($format eq "ringtone") { $readout = $ringTone{$readout}; @@ -1794,9 +1801,16 @@ sub FRITZBOX_Open_Connection($) $telnet = undef; return $msg; } + FRITZBOX_Log $hash, 5, "Change command prompt"; $telnet->prompt('/ $/'); - $telnet->cmd("PS1=' '"); - $telnet->buffer_empty; + unless ($telnet->cmd("PS1=' '")) + { + $msg = "Telnet error: Could not change command prompt - ".$telnet->errmsg; + FRITZBOX_Log $hash, 2, $msg; + $telnet->close; + $telnet = undef; + return $msg; + } return undef; } # end FRITZBOX_Open_Connection @@ -2056,13 +2070,21 @@ FRITZBOX_StartRadio($@) # Get current ringtone my $userNo = $intNo-609; - my $curRingTone = FRITZBOX_Exec( $hash, "ctlmgr_ctl r telcfg settings/Foncontrol/User".$userNo."/IntRingTone" ); + push @cmdArray, "ctlmgr_ctl r telcfg settings/Foncontrol/User".$userNo."/IntRingTone"; + push @cmdArray, "ctlmgr_ctl r telcfg settings/Foncontrol/User".$userNo."/RadioRingID"; + $result = FRITZBOX_Exec( $hash, \@cmdArray ); + + my $curRingTone = $result->[0]; + my $curRadioStation = $result->[1]; # Start Internet Radio and reset ring tone push @cmdArray, "ctlmgr_ctl w telcfg settings/Foncontrol/User".$userNo."/IntRingTone 33"; - push @cmdArray, "ctlmgr_ctl w telcfg settings/Foncontrol/User".$userNo."/RadioRingID $radioStation"; + push @cmdArray, "ctlmgr_ctl w telcfg settings/Foncontrol/User".$userNo."/RadioRingID $radioStation" + if defined $radioStation; push @cmdArray, "ctlmgr_ctl w telcfg command/Dial **".$intNo; push @cmdArray, "ctlmgr_ctl w telcfg settings/Foncontrol/User".$userNo."/IntRingTone $curRingTone"; + push @cmdArray, "ctlmgr_ctl w telcfg settings/Foncontrol/User".$userNo."/RadioRingID $curRadioStation" + if defined $radioStation; # Execute command array FRITZBOX_Exec( $hash, \@cmdArray ); @@ -2266,7 +2288,8 @@ sub FRITZBOX_fritztris($)
  • set <name> startRadio <internalNumber> [name or number]
    - Plays the internet radio on the given Fritz!Fon. Default is the current station of the phone. + Plays the internet radio on the given Fritz!Fon. Default is the current ring tone radio station of the phone. + So, not the station that is selected at the handset. An available internet radio can be selected by its name or (reading) number.

  • @@ -2379,7 +2402,7 @@ sub FRITZBOX_fritztris($)
  • dect1_intRingTone - Internal ring tone of the DECT device 1
  • dect1_manufacturer - Manufacturer of the DECT device 1
  • dect1_model - Model of the DECT device 1
  • -
  • dect1_radio - Current internet radio station of the DECT device 1
  • +
  • dect1_radio - Current internet radio station ring tone of the DECT device 1
  • fon1 - Internal name of the analog FON connection 1
  • fon1_intern - Internal number of the analog FON connection 1
  • @@ -2523,7 +2546,7 @@ sub FRITZBOX_fritztris($)
  • set <name> startRadio <internalNumber> [Name oder Nummer]
    - Startet das Internetradio auf dem angegebenen Fritz!Fon. Ein verfügbare Radiostation kann über den Namen oder die (Gerätewert)Nummer ausgewählt werden. Ansonsten wird die aktuell eingestellte genommen. + Startet das Internetradio auf dem angegebenen Fritz!Fon. Eine verfügbare Radiostation kann über den Namen oder die (Gerätewert)Nummer ausgewählt werden. Ansonsten wird die in der Box als Internetradio-Klingelton eingestellte Station abgespielt. (Also nicht die am Telefon ausgewählte.)

  • @@ -2632,7 +2655,7 @@ sub FRITZBOX_fritztris($)
  • dect1_intRingTone - Interner Klingelton des DECT Telefons 1
  • dect1_manufacturer - Hersteller des DECT Telefons 1
  • dect1_model - Modell des DECT Telefons 1
  • -
  • dect1_radio - aktuelle Internet Radio Station des DECT Telefons 1
  • +
  • dect1_radio - aktueller Internet-Radio-Klingelton des DECT Telefons 1
  • fon1 - Name des analogen Telefonanschlusses 1 an der Fritz!Box
  • fon1_intern - Interne Nummer des analogen Telefonanschlusses 1