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
- - activity <id>|<name>
- switch to this activity
+ - activity <id>|<name> [<channel>]
+ switch to this activit and optionally switch to <channel>
- channel <channel>
switch to <channel> in the current activity
- - command [<id>|<name>] <command>
+ - command [<id>|<name>] <command>
send the given ir command for the current activity or for the given device
- getConfig
request the configuration from the hub
@@ -1809,7 +1817,7 @@ harmony_decrypt($)
default -> 60 minutes
- sync
syncs the hub to the myHarmony config
- - hidDevice [<id>|<name>]
+ - hidDevice [<id>|<name>]
sets the target device for keyboard commands, if no device is given -> set the target to the
default device for the current activity.
- text <text>
@@ -1818,13 +1826,13 @@ harmony_decrypt($)
moves the cursor by bluetooth/smart keaboard dongle. <direction> can be one of: up, down, left, right, pageUp, pageDown, home, end.
- special <key>
sends special key by bluetooth/smart keaboard dongle. <key> can be one of: previousTrack, nextTrack, stop, playPause, volumeUp, volumeDown, mute.
- - autocreate [<id>|<name>]
+ - autocreate [<id>|<name>]
creates a fhem device for a single/all device(s) in the harmony hub. if activities are startet the state
of these devices will be updatet with the power state defined in these activites.
- update
triggers a firmware update. only available if a new firmware is available.
- 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.