diff --git a/fhem/FHEM/37_harmony.pm b/fhem/FHEM/37_harmony.pm index 7ff0de040..21a772f66 100644 --- a/fhem/FHEM/37_harmony.pm +++ b/fhem/FHEM/37_harmony.pm @@ -351,8 +351,12 @@ harmony_Set($$@) harmony_sendEngineGet($hash, "startactivity", "activityId=$param:timestamp=0"); + delete $hash->{channelAfterStart}; + $hash->{channelAfterStart} = $param2 if( $param2 ); + return undef; } elsif( $cmd eq "channel" ) { + delete $hash->{channelAfterStart}; return "no current activity" if( !defined($hash->{currentActivityID}) || $hash->{currentActivityID} == -1 ); my $activity = harmony_activityOfId($hash, $hash->{currentActivityID}); @@ -832,7 +836,11 @@ harmony_updateActivity($$;$) readingsSingleUpdate( $hash, "currentActivity", "$modifier$activity", 1 ); $activity =~ s/ /./g; - readingsSingleUpdate( $hash, "activity", $activity, 1 ) if( !$modifier && $activity ne ReadingsVal($hash->{NAME},"activity", "" ) ); + if( !$modifier && $activity ne ReadingsVal($hash->{NAME},"activity", "" ) ) { + readingsSingleUpdate( $hash, "activity", $activity, 1 ); + + harmony_sendEngineGet($hash, "changeChannel", "channel=$hash->{channelAfterStart}:timestamp=0") if( $hash->{channelAfterStart} ); + } delete $hash->{hidDevice} if( $id == -1 ); } @@ -1640,20 +1648,20 @@ harmony_Get($$@) if( $cmd eq 'showAccount' ) { my $user = $hash->{helper}{username}; my $password = $hash->{helper}{password}; - + return 'no user set' if( !$user ); return 'no password set' if( !$password ); - + $user = harmony_decrypt( $user ); $password = harmony_decrypt( $password ); - + return "user: $user\npassword: $password"; } $list .= " showAccount"; $list .= " currentActivity:noArg"; - $list =~ s/^ //; + $list =~ s/^ //; return "Unknown argument $cmd, choose one of $list"; } @@ -1789,11 +1797,11 @@ harmony_decrypt($) Set - The command, hidDevice, text, cursor and special commmands are also available for the autocreated devices. The <id>|<name> paramter hast to be omitted.

+ The command, hidDevice, text, cursor and special commmands are also available for the autocreated devices. The <id>|<name> paramter hast to be omitted.

Get @@ -1846,7 +1854,7 @@ harmony_decrypt($)
  • showAccount
    display obfuscated user and password in cleartext
  • - The commands commmand is also available for the autocreated devices. The <id>|<name> paramter hast to be omitted.

    + The commands commmand is also available for the autocreated devices. The <id>|<name> paramter hast to be omitted.