- Posts: 339
- Thank you received: 28
Unwanted multiple actions on one key press e.g. navigation
- andrew
- Topic Author
- Offline
- User
-
Less
More
2 years 5 months ago - 2 years 5 months ago #1397
by andrew
Unwanted multiple actions on one key press e.g. navigation was created by andrew
I'm going to say one last thing about this then I'm going to shut up as a) I've been ignored every other time I've posted about it and b) I'll be using the Global Caché IP2IR as soon as I get it so hopefully I'll be shot of the Harmony hub and won't care any more (apart from feeling sorry for other people still using it).
I've been poking around looking at how myServer communicates with the Harmony hub and how it asks it to send IR commands. It looks to me like myServer uses the open source Harmony library from here . It also looks to me like myServer uses the client.SendCommandAsync() method to send IR requests to the hub. This only sends a 'press' command to the hub, it never sends a 'release'. The Harmony library has a test harness program that you can run to try things out and it too uses SendCommandAsysnc() to send requests to the main library. And when I use that test harness to send navigation commands I get exactly the same thing as with myServer - one navigation command results in the cursor, highlight or whatever moving two, three, four or more spots in a list on the device. I've tried this both with Kodi and my Sky+HD satellite box.
I then edited the test harness code and made it use the client.SendKeyPressAsync method instead of SendCommandAsync. SendKeyPressAsync is coded to explicitly send a 'press' request followed by a 'release' request. Making this change fixed the problem both for Kodi and the Sky box and navigation worked as desired - one command results in one movement.
So it seems to me that the myServer Harmony driver should use SendKeyPressAsync instead of SendCommandAsync, at least for navigation commands.
Relevant code from the open source Harmony library:
Andrew
I've been poking around looking at how myServer communicates with the Harmony hub and how it asks it to send IR commands. It looks to me like myServer uses the open source Harmony library from here . It also looks to me like myServer uses the client.SendCommandAsync() method to send IR requests to the hub. This only sends a 'press' command to the hub, it never sends a 'release'. The Harmony library has a test harness program that you can run to try things out and it too uses SendCommandAsysnc() to send requests to the main library. And when I use that test harness to send navigation commands I get exactly the same thing as with myServer - one navigation command results in the cursor, highlight or whatever moving two, three, four or more spots in a list on the device. I've tried this both with Kodi and my Sky+HD satellite box.
I then edited the test harness code and made it use the client.SendKeyPressAsync method instead of SendCommandAsync. SendKeyPressAsync is coded to explicitly send a 'press' request followed by a 'release' request. Making this change fixed the problem both for Kodi and the Sky box and navigation worked as desired - one command results in one movement.
So it seems to me that the myServer Harmony driver should use SendKeyPressAsync instead of SendCommandAsync, at least for navigation commands.
Relevant code from the open source Harmony library:
Code:
public async Task SendCommandAsync(string command, bool press = true, int? timestamp = null)
{
var text = new StringBuilder();
text.Append("action=").Append(command.Replace(":", "::"));
text.Append(":").Append("status=").Append(press ? "press" : "release");
if (timestamp.HasValue)
text.Append(":").Append("timestamp=").Append(timestamp.Value);
var xml = Xml.Element("iq")
.Attr("type", "get")
.Attr("id", _clientId + "_" + _messageId.ToString())
.Child(Xml.Element("oa", "connect.logitech.com")
.Attr("mime", HarmonyMimeTypes.DeviceCommand)
.Text(text.ToString()));
await FireAndForgetAsync(xml).ConfigureAwait(false);
}
/// <inheritdoc />
public async Task SendKeyPressAsync(string command, int timespan = 100)
{
var now =
(int)DateTime.Now.ToUniversalTime().Subtract(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds;
await SendCommandAsync(command, true, now - timespan).ConfigureAwait(false);
await SendCommandAsync(command, false, timespan).ConfigureAwait(false);
}
Andrew
Last edit: 2 years 5 months ago by andrew. Reason: Formatting as usual
The following user(s) said Thank You: CrabbyPatties, JGrana01
Please Log in to join the conversation.
- bowlingbeeg
- Offline
- User
-
Less
More
- Posts: 248
- Thank you received: 33
2 years 5 months ago #1399
by bowlingbeeg
Replied by bowlingbeeg on topic Unwanted multiple actions on one key press e.g. navigation
Yeah, I stopped using the harmony integration as well. Pulled out an old GC-100-6 that I haven't used in years for the one or two things that are entirely IR based. I would like to see Allonis focus more attention on the Harmony and HomeAssistant integrations just because I think that will help a lot of folks get something running. But I'm sure they're a little overwhelmed by how much work all of this is and I'm sure there are lots of corporate client projects that they're trying to juggle as well. Since I have been able to work around a lot of the issues I'm ok but I'm sure there are number of folks that are frustrated. I know it's a kickstarter and there will be growing pains but it sure sounded like the harmony integration was in working order before they shipped the remotes so it's a little frustrating that it's not.
Please Log in to join the conversation.
- David Li
- Offline
- Admin
-
Less
More
- Posts: 1019
- Thank you received: 99
2 years 5 months ago #1413
by David Li
Replied by David Li on topic Unwanted multiple actions on one key press e.g. navigation
Both were in "working order" but have been evolved to meet the particular needs of users. What else is needed? Please post those in the two respective forums. We have folks using both now.Yeah, I stopped using the harmony integration as well. Pulled out an old GC-100-6 that I haven't used in years for the one or two things that are entirely IR based. I would like to see Allonis focus more attention on the Harmony and HomeAssistant integrations just because I think that will help a lot of folks get something running. But I'm sure they're a little overwhelmed by how much work all of this is and I'm sure there are lots of corporate client projects that they're trying to juggle as well. Since I have been able to work around a lot of the issues I'm ok but I'm sure there are number of folks that are frustrated. I know it's a kickstarter and there will be growing pains but it sure sounded like the harmony integration was in working order before they shipped the remotes so it's a little frustrating that it's not.
Please Log in to join the conversation.
- bowlingbeeg
- Offline
- User
-
Less
More
- Posts: 248
- Thank you received: 33
2 years 5 months ago #1414
by bowlingbeeg
Replied by bowlingbeeg on topic Unwanted multiple actions on one key press e.g. navigation
Lots of other people have opened issues about the Harmony so I've stayed out of that one but I have talked about the HomeAssistant driver not working for certain things. I know HA is complicated and each device can have different services so I'm not expecting it to be fixed immediately but when I start a topic like this, allonis.com/forum/home-assistant/108-mis...-remote-entities#766 and it goes totally unanswered it gets frustrating.
Both were in "working order" but have been evolved to meet the particular needs of users. What else is needed? Please post those in the two respective forums. We have folks using both now.Yeah, I stopped using the harmony integration as well. Pulled out an old GC-100-6 that I haven't used in years for the one or two things that are entirely IR based. I would like to see Allonis focus more attention on the Harmony and HomeAssistant integrations just because I think that will help a lot of folks get something running. But I'm sure they're a little overwhelmed by how much work all of this is and I'm sure there are lots of corporate client projects that they're trying to juggle as well. Since I have been able to work around a lot of the issues I'm ok but I'm sure there are number of folks that are frustrated. I know it's a kickstarter and there will be growing pains but it sure sounded like the harmony integration was in working order before they shipped the remotes so it's a little frustrating that it's not.
Please Log in to join the conversation.
- CrabbyPatties
- Offline
- User
-
Less
More
- Posts: 116
- Thank you received: 1
2 years 5 months ago #1422
by CrabbyPatties
Replied by CrabbyPatties on topic Unwanted multiple actions on one key press e.g. navigation
David,
Is it possible to have a test where the Harmony driver / template is updated in the way Andrew suggests. If it would fix the multiple commands issue that would be great.
Andrew - having poked around in the opensource code for Harmony integration, can you also see what may be the cause of my volume issue (long presses of volume simply cache the commands which contiue to activate after button release)?
I appreciate the developer and community relationship which is fostered in these forums. Thank you both.
Is it possible to have a test where the Harmony driver / template is updated in the way Andrew suggests. If it would fix the multiple commands issue that would be great.
Andrew - having poked around in the opensource code for Harmony integration, can you also see what may be the cause of my volume issue (long presses of volume simply cache the commands which contiue to activate after button release)?
I appreciate the developer and community relationship which is fostered in these forums. Thank you both.
Please Log in to join the conversation.
- andrew
- Topic Author
- Offline
- User
-
Less
More
- Posts: 339
- Thank you received: 28
2 years 5 months ago #1424
by andrew
I suppose the same issue would arise as with navigation - if there's no button release being sent to Harmony then it could continue changing the volume the same way the navigation overruns. I don't actually know that though - in our setup volume is controlled by an AV amp and I haven't tried out the Harmony integration with it.
Andrew
Replied by andrew on topic Unwanted multiple actions on one key press e.g. navigation
...
Andrew - having poked around in the opensource code for Harmony integration, can you also see what may be the cause of my volume issue (long presses of volume simply cache the commands which contiue to activate after button release)?
...
I suppose the same issue would arise as with navigation - if there's no button release being sent to Harmony then it could continue changing the volume the same way the navigation overruns. I don't actually know that though - in our setup volume is controlled by an AV amp and I haven't tried out the Harmony integration with it.
Andrew
The following user(s) said Thank You: CrabbyPatties
Please Log in to join the conversation.
Time to create page: 0.220 seconds