Aktuelles TV-Programm in FHEM

Begonnen von Kuzl, 20 Oktober 2014, 20:41:43

Vorheriges Thema - Nächstes Thema

Tommy82

#270
Da bin ich mal gespannt :-)
Hatte jetzt auch mal mein System im Verdacht, die FB7390 hat eine mittlere Auslastung die letzten 24 Stunden von 81% die CPU!?!

Wenn ich deinen Code jetzt eingebe und speichern will kommt
Global symbol "$lcchannel" requires explicit package name at ./FHEM/99_myUtils.pm line 121.

In 121 steht
ZitatLog(3, "switchChannel: Lowercase channel: ".$lcchannel);
Fhem Cubitruck  Armbian Buster with Linux 5.3.9-sunxi
HM-CC_RT-DN, HM-Sec-RHS,HM-Sec-SD, HM-Sec-SCo,IT1500,1xIT GRR-3500 Fritz!Dect200,Powerline546E,Enigma2 Modul mit 3 Vu+,Wol Modul für WinServer2016 und WinServer 2019,FB6590
Allnetl Wandtablett mit FTUI

RoBra81

Hatte nur einen Teil verschoben und einen anderen übersehen:

############################################
sub
switchChannel($)
{
  my %channellist = (
    pro7 => 'ProSieben_HD',
    rtl => 'RTL',
ard => 'Das_Erste_HD',
    kabel_1 => 'kabel_eins_HD',
sat1 => 'SAT.1_HD',
    rtl2 => 'RTL_II',
sport1 => '',
    vox => 'VOX',
zdf => 'ZDF_HD',
  );
 
  my $TVDevice = 'VU_Ultimo';

  my ($channel) = @_;
  Log(3, "switchChannel: Parameter channel: ".$channel);
  $channel =~ s/_time//g; 
  my $next = 0;
  if ($channel =~ /_next/)
  {
    my @array = split('_next', $channel);
    $channel = $array[0];
    Log(3, "switchChannel: Next found, new channel: ".$channel);
    $next = 1;
  }
  my $lcchannel = lc $channel;
  Log(3, "switchChannel: Lowercase channel: ".$lcchannel);
  my $command = '';
 
  $command = 'set '.$TVDevice.' channel '.$channellist{$lcchannel};
  Log(3, "switchChannel: Switching command: ".$command);
 

  if ($command ne '')
  {
    if ($next == 1)
    {
      $command =~ s/;/;;/g;
      fhem('delete '.$TVDevice.'.Senderwechsel.at');
      fhem('define '.$TVDevice.'.Senderwechsel.at at '.ReadingsVal('TV_Programm.dann', $channel.'_next_time', '00:00').' '.$command);
      fhem('attr '.$TVDevice.'.Senderwechsel.at room Wohnzimmer');
    }
    else
    {
      fhem($command);
    }
  }
  else
  {
    Log(1, 'Channelnumber not found for channel: '.$channel);
  }
}

Tommy82

#272
Also das Umschalten von JETZT klappt problemlos
2014.11.19 20:37:48.900 2: ENIGMA2 set VU_Ultimo channel RTL
2014.11.19 20:37:59.665 3: switchChannel: Parameter channel: KABEL_1
2014.11.19 20:37:59.667 3: switchChannel: Lowercase channel: kabel_1
2014.11.19 20:37:59.668 3: switchChannel: Switching command: set VU_Ultimo channel kabel_eins_HD
2014.11.19 20:37:59.672 2: ENIGMA2 set VU_Ultimo channel kabel_eins_HD
2014.11.19 20:38:06.015 3: switchChannel: Parameter channel: RTL
2014.11.19 20:38:06.016 3: switchChannel: Lowercase channel: rtl
2014.11.19 20:38:06.017 3: switchChannel: Switching command: set VU_Ultimo channel RTL
2014.11.19 20:38:06.021 2: ENIGMA2 set VU_Ultimo channel RTL


Das Next muss ich jetzt kurz abwarten

Die nächste Sendung zum Umschalten kommt erst um 21:15, hab die mal angeklickt
2014.11.19 20:45:28.250 3: switchChannel: Parameter channel: VOX_next
2014.11.19 20:45:28.252 3: switchChannel: Next found, new channel: VOX
2014.11.19 20:45:28.253 3: switchChannel: Lowercase channel: vox
2014.11.19 20:45:28.254 3: switchChannel: Switching command: set VU_Ultimo channel VOX


Mal gucken obs klappt

Bis gleich
Fhem Cubitruck  Armbian Buster with Linux 5.3.9-sunxi
HM-CC_RT-DN, HM-Sec-RHS,HM-Sec-SD, HM-Sec-SCo,IT1500,1xIT GRR-3500 Fritz!Dect200,Powerline546E,Enigma2 Modul mit 3 Vu+,Wol Modul für WinServer2016 und WinServer 2019,FB6590
Allnetl Wandtablett mit FTUI

Tommy82

Also um 21:15 wurde nicht umgeschaltet, hab jetzt nochmal 21:20 angeklickt

2014.11.19 21:15:55.912 3: switchChannel: Parameter channel: rtl2_next
2014.11.19 21:15:55.914 3: switchChannel: Next found, new channel: rtl2
2014.11.19 21:15:55.915 3: switchChannel: Lowercase channel: rtl2
2014.11.19 21:15:55.916 3: switchChannel: Switching command: set VU_Ultimo channel RTL_II

EventMonitor
2014-11-19 21:18:14.740 ENIGMA2 VU_Ultimo snrdb: 56
2014-11-19 21:18:14.740 ENIGMA2 VU_Ultimo snr: 56
2014-11-19 21:18:14.740 ENIGMA2 VU_Ultimo ber: 1096449641
2014-11-19 21:18:14.740 ENIGMA2 VU_Ultimo acg: 65
2014-11-19 21:18:16.783 ENIGMA2 VU_Ultimo eventremaining: 3406
2014-11-19 21:18:16.783 ENIGMA2 VU_Ultimo eventcurrenttime: 1416428294.58
2014-11-19 21:18:16.783 ENIGMA2 VU_Ultimo eventcurrenttime_next: 1416428294.65
2014-11-19 21:18:16.783 ENIGMA2 VU_Ultimo eventcurrenttime_hr: 21:18:14
2014-11-19 21:18:16.783 ENIGMA2 VU_Ultimo eventcurrenttime_next_hr: 21:18:14
2014-11-19 21:18:14.740 ENIGMA2 VU_Ultimo snrdb: 56
2014-11-19 21:18:14.740 ENIGMA2 VU_Ultimo snr: 56
2014-11-19 21:18:14.740 ENIGMA2 VU_Ultimo ber: 1096449641
2014-11-19 21:18:14.740 ENIGMA2 VU_Ultimo acg: 65
2014-11-19 21:18:16.783 ENIGMA2 VU_Ultimo eventremaining: 3406
2014-11-19 21:18:16.783 ENIGMA2 VU_Ultimo eventcurrenttime: 1416428294.58
2014-11-19 21:18:16.783 ENIGMA2 VU_Ultimo eventcurrenttime_next: 1416428294.65
2014-11-19 21:18:16.783 ENIGMA2 VU_Ultimo eventcurrenttime_hr: 21:18:14
2014-11-19 21:18:16.783 ENIGMA2 VU_Ultimo eventcurrenttime_next_hr: 21:18:14
2014-11-19 21:19:44.742 ENIGMA2 VU_Ultimo snrdb: 56
2014-11-19 21:19:44.742 ENIGMA2 VU_Ultimo snr: 56
2014-11-19 21:19:44.742 ENIGMA2 VU_Ultimo ber: 1096449641
2014-11-19 21:19:44.742 ENIGMA2 VU_Ultimo acg: 65


Schaltet leider nicht um:
Einziger Eintrag im Log
2014.11.19 21:17:50.182 3: HTTPMOD got error in callback: connect to http://www.tvmovie.de:80 timed out
2014.11.19 21:17:50.199 3: HTTPMOD got error in callback: connect to http://www.tvmovie.de:80 timed out
2014.11.19 21:18:50.210 3: HTTPMOD got error in callback: connect to http://www.tvmovie.de:80 timed out
2014.11.19 21:18:50.234 3: HTTPMOD got error in callback: connect to http://www.tvmovie.de:80 timed out
2014.11.19 21:19:50.223 3: HTTPMOD got error in callback: connect to http://www.tvmovie.de:80 timed out
2014.11.19 21:19:50.246 3: HTTPMOD got error in callback: connect to http://www.tvmovie.de:80 timed out


Soll ich mal verbose 4 oder 5 setzen?
Fhem Cubitruck  Armbian Buster with Linux 5.3.9-sunxi
HM-CC_RT-DN, HM-Sec-RHS,HM-Sec-SD, HM-Sec-SCo,IT1500,1xIT GRR-3500 Fritz!Dect200,Powerline546E,Enigma2 Modul mit 3 Vu+,Wol Modul für WinServer2016 und WinServer 2019,FB6590
Allnetl Wandtablett mit FTUI

RoBra81

Also die events und Logeinträge von ENIGMA2 und HTTPMOD haben eigentlich nix damit zu tun. Kannst du nochmal ein next-Programm anklicken und gucken, ob das at angelegt wurde und wie's aussieht?

Tommy82

Zitat von: RoBra81 am 19 November 2014, 21:23:31
Also die events und Logeinträge von ENIGMA2 und HTTPMOD haben eigentlich nix damit zu tun. Kannst du nochmal ein next-Programm anklicken und gucken, ob das at angelegt wurde und wie's aussieht?

Welches at?

Das VU_Ultimo.Senderwechsel.at at ist immer da
Fhem Cubitruck  Armbian Buster with Linux 5.3.9-sunxi
HM-CC_RT-DN, HM-Sec-RHS,HM-Sec-SD, HM-Sec-SCo,IT1500,1xIT GRR-3500 Fritz!Dect200,Powerline546E,Enigma2 Modul mit 3 Vu+,Wol Modul für WinServer2016 und WinServer 2019,FB6590
Allnetl Wandtablett mit FTUI

RoBra81

Das dürfte aber nur solange da sein, bis es ausgeführt wird. Wenn du wieder auf ein folgendes Programm klickst, wird es auch gelöscht und mit der neuen Zeit und dem neuen Programm neu angelegt...

Tommy82

#277
Wie gesagt ist immer da, ich habs jetzt mal von hand gelöscht und auf Next gedrückt
21:45 ARD
Dann kommt im LOg
2014.11.19 21:31:08.382 3: switchChannel: Parameter channel: ARD_next
2014.11.19 21:31:08.384 3: switchChannel: Next found, new channel: ARD
2014.11.19 21:31:08.385 3: switchChannel: Lowercase channel: ard
2014.11.19 21:31:08.386 3: switchChannel: Switching command: set VU_Ultimo channel Das_Erste_HD
2014.11.19 21:31:08.405 3: delete VU_Ultimo.Senderwechsel.at : Please define VU_Ultimo.Senderwechsel.at first


Aber das at ist angelegt:
Internals:
   CFGFN
   COMMAND    set VU_Ultimo channel Das_Erste_HD
   DEF        00:00 set VU_Ultimo channel Das_Erste_HD
   NAME       VU_Ultimo.Senderwechsel.at
   NR         876
   PERIODIC   no
   RELATIVE   no
   STATE      Next: 00:00:00
   TIMESPEC   00:00
   TRIGGERTIME 1416438000
   TRIGGERTIME_FMT 2014-11-20 00:00:00
   TYPE       at
   VOLATILE   1
Attributes:
   room       Wohnzimmer


Mal gucken was um 21:45 passiert
Fhem Cubitruck  Armbian Buster with Linux 5.3.9-sunxi
HM-CC_RT-DN, HM-Sec-RHS,HM-Sec-SD, HM-Sec-SCo,IT1500,1xIT GRR-3500 Fritz!Dect200,Powerline546E,Enigma2 Modul mit 3 Vu+,Wol Modul für WinServer2016 und WinServer 2019,FB6590
Allnetl Wandtablett mit FTUI

RoBra81

Und dann müsste es das at wieder geben?

RoBra81

Jetzt aber:

############################################
sub
switchChannel($)
{
  my %channellist = (
    pro7 => 'ProSieben_HD',
    rtl => 'RTL',
ard => 'Das_Erste_HD',
    kabel_1 => 'kabel_eins_HD',
sat1 => 'SAT.1_HD',
    rtl2 => 'RTL_II',
sport1 => '',
    vox => 'VOX',
zdf => 'ZDF_HD',
  );
 
  my $TVDevice = 'VU_Ultimo';

  my ($channel) = @_;
  Log(3, "switchChannel: Parameter channel: ".$channel);
  $channel =~ s/_time//g; 
  my $next = 0;
  if ($channel =~ /_next/)
  {
    my @array = split('_next', $channel);
    $channel = $array[0];
    Log(3, "switchChannel: Next found, new channel: ".$channel);
    $next = 1;
  }
  my $lcchannel = lc $channel;
  Log(3, "switchChannel: Lowercase channel: ".$lcchannel);
  my $command = '';
 
  $command = 'set '.$TVDevice.' channel '.$channellist{$lcchannel};
  Log(3, "switchChannel: Switching command: ".$command);
 

  if ($command ne '')
  {
    if ($next == 1)
    {
      $command =~ s/;/;;/g;
      fhem('delete '.$TVDevice.'.Senderwechsel.at');
      fhem('define '.$TVDevice.'.Senderwechsel.at at '.ReadingsVal('TV_Programme_next', $channel.'_next_time', '00:00').' '.$command);
      fhem('attr '.$TVDevice.'.Senderwechsel.at room Wohnzimmer');
    }
    else
    {
      fhem($command);
    }
  }
  else
  {
    Log(1, 'Channelnumber not found for channel: '.$channel);
  }
}

Tommy82

Ich hoffe.-9

das normale umschalten klappt, hab jetzt mal 22:15 RTL geklickt
2014.11.19 21:49:20.307 3: switchChannel: Parameter channel: RTL_next
2014.11.19 21:49:20.308 3: switchChannel: Next found, new channel: RTL
2014.11.19 21:49:20.309 3: switchChannel: Lowercase channel: rtl
2014.11.19 21:49:20.310 3: switchChannel: Switching command: set VU_Ultimo channel RTL


Mal seh  was um 22:15 passiert
Fhem Cubitruck  Armbian Buster with Linux 5.3.9-sunxi
HM-CC_RT-DN, HM-Sec-RHS,HM-Sec-SD, HM-Sec-SCo,IT1500,1xIT GRR-3500 Fritz!Dect200,Powerline546E,Enigma2 Modul mit 3 Vu+,Wol Modul für WinServer2016 und WinServer 2019,FB6590
Allnetl Wandtablett mit FTUI

RoBra81

Wie sieht denn das at jetzt aus?

Tommy82

Zitat von: RoBra81 am 19 November 2014, 21:50:46
Wie sieht denn das at jetzt aus?
Würde behaupten gut :-)
Internals:
   CFGFN
   COMMAND    set VU_Ultimo channel RTL
   DEF        22:15 set VU_Ultimo channel RTL
   NAME       VU_Ultimo.Senderwechsel.at
   NR         1721
   PERIODIC   no
   RELATIVE   no
   STATE      Next: 22:15:00
   TIMESPEC   22:15
   TRIGGERTIME 1416431700
   TRIGGERTIME_FMT 2014-11-19 22:15:00
   TYPE       at
   VOLATILE   1
Attributes:
   room       Wohnzimmer


Um 22:15 wissen wir mehr:-)
Fhem Cubitruck  Armbian Buster with Linux 5.3.9-sunxi
HM-CC_RT-DN, HM-Sec-RHS,HM-Sec-SD, HM-Sec-SCo,IT1500,1xIT GRR-3500 Fritz!Dect200,Powerline546E,Enigma2 Modul mit 3 Vu+,Wol Modul für WinServer2016 und WinServer 2019,FB6590
Allnetl Wandtablett mit FTUI

Tommy82

JUHU, du bist der BESTE :-)

Es funktioniert!!!!!!!!!
Fhem Cubitruck  Armbian Buster with Linux 5.3.9-sunxi
HM-CC_RT-DN, HM-Sec-RHS,HM-Sec-SD, HM-Sec-SCo,IT1500,1xIT GRR-3500 Fritz!Dect200,Powerline546E,Enigma2 Modul mit 3 Vu+,Wol Modul für WinServer2016 und WinServer 2019,FB6590
Allnetl Wandtablett mit FTUI

RoBra81

Dann noch die Log-Einträge raus und alles ist gut

############################################
sub
switchChannel($)
{
  my %channellist = (
    pro7 => 'ProSieben_HD',
    rtl => 'RTL',
ard => 'Das_Erste_HD',
    kabel_1 => 'kabel_eins_HD',
sat1 => 'SAT.1_HD',
    rtl2 => 'RTL_II',
sport1 => '',
    vox => 'VOX',
zdf => 'ZDF_HD',
  );
 
  my $TVDevice = 'VU_Ultimo';

  my ($channel) = @_;
  $channel =~ s/_time//g; 
  my $next = 0;
  if ($channel =~ /_next/)
  {
    my @array = split('_next', $channel);
    $channel = $array[0];
    $next = 1;
  }
  my $lcchannel = lc $channel;
  my $command = '';
 
  $command = 'set '.$TVDevice.' channel '.$channellist{$lcchannel};

  if ($command ne '')
  {
    if ($next == 1)
    {
      $command =~ s/;/;;/g;
      fhem('delete '.$TVDevice.'.Senderwechsel.at');
      fhem('define '.$TVDevice.'.Senderwechsel.at at '.ReadingsVal('TV_Programme_next', $channel.'_next_time', '00:00').' '.$command);
      fhem('attr '.$TVDevice.'.Senderwechsel.at room Wohnzimmer');
    }
    else
    {
      fhem($command);
    }
  }
  else
  {
    Log(1, 'Channelnumber not found for channel: '.$channel);
  }
}