View Full Version : Send IR to different Instances of IR Plugins
Wilhelm
January 2nd, 2009, 04:26 AM
Hi everyone,
I am planning to extend my control setup to different rooms, with different means of IR distribution. I have one room, with USBUIRT and netremote is running on the PC where the UIRT is connected to and two other rooms that each have a GC device. So I think I need to set up 3 instanmces in the NR client, 1 direct IR and 2 GCs.
What I am trying to do, is to setup my Netremote CCF so that the differnet outputs are switched seemlessly by the buttons or panels.
Here is where I need your advice. How do I set up a specific button to switch to a specific output and back again.
Can I set a default for a single panel? What is the supposed way to define this in NRD 2.0?
I hope there is an workable way to do this.
TIA
Rob H
January 2nd, 2009, 05:44 AM
I'm not 100% clear on what you're trying to do here - is it :
Use the same CCF in multiple rooms to control just the devices in that room
Use the same CCF in multiple rooms to control devices in any room
If it's the second then you can use the SetPluginInstance method to change the default IR plugin instance for a given page. I'd recommend using RegisterPanelWatch to automatically handle this when you switch between pages.
Wilhelm
January 2nd, 2009, 05:50 AM
What I want to do is one ccf that is able to control all devices in every room.
You are suggesting SetPluginInstance. I tried to set that in one button send the ir and switch back to the original plugin instance. That didn't work. After it switched once to the other plugin it didn't switch back.
Are you saying that the plugin can only be changed for one complete panel?
Rob H
January 2nd, 2009, 05:57 AM
No, that shouldn't be a problem, however there may be an issue with trying to call SetPluginInstance while it's actually sending the IR - I can't remember whether that's an asynchronous call.
If you can keep all the IR buttons on one page using the same plugin instance you should be okay though. Otherwise you'll have to have each button specifying the instance before sending the IR (but not setting it back again).
Wilhelm
January 2nd, 2009, 07:06 AM
Thanks for your answers, I'll try that.
Cheers
Wilhelm
January 2nd, 2009, 07:55 AM
SetPluginInstance method to change the default IR plugin instance for a given page. I'd recommend using RegisterPanelWatch to automatically handle this when you switch between pages.
Well, I really can't find any place where to put this in the designer.
Maybe I'm just overlooking something, but could you perhaps make a simple example how to do that?
Thinking about it, perhaps it would be most logical, to caonnect an instance to a device group. How could I do that? There really aren't any properties to set
per device...
Thanks
Rob H
January 2nd, 2009, 08:59 AM
You'll have to use a bit of Lua code for this I'm afraid.
Wilhelm
January 3rd, 2009, 12:00 AM
Yeah, and how do I do that?
Rob H
January 3rd, 2009, 01:31 AM
Suppose you have a page group called "Bedroom" and you want to use IR instance -2003 for that group, you would use code something like
RegisterPanelWatch("Bedroom", "*",
function()
NetRemote.SetPluginInstance(-3, -2003)
end)
This would go in your CCF's .lua file
If you wanted you could specify this down at the page level too by changing the "*" in the code above to the name of the page.
Wilhelm
January 3rd, 2009, 02:17 AM
Thanks.
And this would set the default IR plugin for the "Bedroom" and automatically leave all other devices unchanged?
Would this also switch, when I enter any action button of the "Bedroom" page group in any macro?
Wilhelm
January 3rd, 2009, 03:16 AM
Hi Rob,
I just tested this and it doesn't work as suspected.
Lets stick to your example:
I have a amplifier in the bedroom. This device has a mute function which I trigger with a IR code stored in one of the panels under the Bedroom Group. Whenever I want to mute that AMP I set an alias to that button in the appropriate action. In fact I even have one of the hardkeys that appear on every screen tied to that alias.
Unfortunaletly, SetPluginInstance changes the default only when you switch to one of the Bedroom Panels. After that it stays there and never switches back to the original default.
So setting the default that way only works when the corresponding panel is visible. This really makes your suggestion unusable for me.
BTW SetPluginInstance is listed under the drepricated function as "Alternative, older, methods for working with plugins and instances. "
What is the actual method?
Any more ideas?
Wilhelm
January 3rd, 2009, 04:44 AM
... and one thing more:
Putting the SetPluginInstance into a button action is also not an option, because this cancels the ability to repeat when holding it pressed. :(
Rob H
January 3rd, 2009, 05:50 AM
No, this will set the IR plugin instance for all 'devices' so you'd need similar code for other page groups.
If you need to mix control for two IR instances on the same page we'll need to go another route.
Wilhelm
January 3rd, 2009, 06:05 AM
If there is any other route, I'd like to know.
I think you haven't read my 2 posts above. Are you sure there is any way to do this?
Rob H
January 3rd, 2009, 06:58 AM
The other route is to use the SendIR function from Lua code on the button
see this thread http://www.promixis.com/forums/showthread.php?t=19353&highlight=SendIR
Wilhelm
January 4th, 2009, 02:45 AM
Sorry, but this certainly is not an option, as such buttons won't repeat.
I suspected NR 2.0 to be able to control multiple instances. It appears now, that this has been implemented rather poorly. I would at least think a button alias should trigger the PanelWatch as the button alias clearly should react, as if the button would be pressed on the panel itself.
Aditionally I strongly suggest to add a property to every device or even panel that would specify the default instance of the IR plugin. Netremote has come a long way from the oringinal ccf format, so this should not be a problem any more.
Sorry if this all seems a bit harsh, but every time I want to try something new, I find that advertised functions don't work as expected. That is the main reason why my NR design hasn't changed for years, which I find rather sad...
Rob H
January 4th, 2009, 03:53 AM
Why shouldn't it repeat - if you use a Lua event action you can control what happens when the button is pressed, when it's held and when it's released.
I don't see the point of adding a default IR plugin instance to each page (or even page group) unless that was done for every single type of plugin - that would almost certainly be a nightmare.
I'm not too happy with the way that IR is handled either, but I'm not sure what the best solution is that won't break existing CCFs. I'll give it some thought.
Wilhelm
January 4th, 2009, 06:48 AM
I'll give it some thought.
Thanks, and YES please do.
I think however, that IR always has a special function and I don't think other plugins suffer from the same problems.
I find the most logical way is to tie the IR instance to a device group (meaning the panels that are used to control that appliance)
And even if the sendIR solution works, I would have to implement that sequence in every single button that has a learned IR code. I find that really uncomfortable, to say the least. I will try that anyway to see if it even has a chance to work.
Rob H
January 4th, 2009, 03:09 PM
There aren't many IR functions that require a repeat function surely, only things like volume controls I would have thought. For most IR functions you want to avoid repeats like the plague.
Wilhelm
January 4th, 2009, 11:43 PM
... and cursor functions on many devices, Page up Page down, mostly everything that was formerly operated by a potentiometer.
You see, I have more than one function on one device that need repeat.
In essence, whether there is a repeat or not, should be determined by the IR code and it usually is.
I give you that, if you are only using NR to control some kind of mediacenter PC you might be right - and that is the only thing I don't do at the moment.
Wilhelm
January 6th, 2009, 07:32 AM
And another bug ?!?
I entered in the first button
Infrared.SetPluginInstance() ActionID -2003,0,16
IRCode
I entered in the second button
Infrared.SetPluginInstance() ActionID -3,0,16
IRCode
-2003 is set to direct (USBUIRT)
-3 is set to GlobalCache
When I press the first button, NR switches to Direct and sends the IR-Code
When I press the second button, the code is also sent to Direct.
I'm close to giving up with this sh...
Please help!
Rob H
January 6th, 2009, 07:41 AM
As I said elsewhere you should not set a plugin instance ID to match the default plugin ID. NR should probably forbid it really since it causes all sorts of problems. The other instance should be numbered -2103, -2203 etc.
So when you do this
Infrared.SetPluginInstance() ActionID -2003,0,16
it aliases plugin instance -2003 as -3
When you then try this
Infrared.SetPluginInstance() ActionID -3,0,16
it looks up the plugin instance -3 and finds the aliased one from earlier.
Wilhelm
January 6th, 2009, 01:30 PM
As I said elsewhere you should not set a plugin instance ID to match the default plugin ID
I missed that, sorry, But in my NR client every plugin instance by default has the same ID als the plugin itsself. I would never have imagined theese ID's
NR should probably forbid it really since it causes all sorts of problems.
if that is so, not probably but definately.
Knowing what you have told me now, I made a button that switches to direct, sends an IR code and switches back to GC. This works in one action. Unfortunately, this button has no repeat - as I expected and the IR code cannot be learned any more, because this now is a macro.
I still urge you to please think about a default instance for the IR plugin for every device, which also is supported when using button aliases. This is a straight forward thing and would make things so much more flexible and easy.
Rob H
January 6th, 2009, 03:20 PM
It really shouldn't create default instances with the same instance id as the plugin id. I've just moved to a new PC today and installed NR on it, and it created different instance IDs for the IR, Mediabridge and Girder plugins.
The Zoomplayer plugin however doesn't do this, which should probably be addressed, but that's probably because the plugin ID is -1018 rather than -18
I'm still not convinced about linking IR instances to devices - it's not as easy as it sounds. There would have to be a general mechanism anyway since IR is implemented by a plugin. I will however see if I can work out why Lua actions can't repeat - they should do - as far as I know the only buttons that are not supposed to repeat are those with multiple actions. Lua event actions should be fine though, they're certainly designed to repeat.
Wilhelm
January 6th, 2009, 11:17 PM
It really shouldn't create default instances with the same instance id as the plugin id. I've just moved to a new PC today and installed NR on it, and it created different instance IDs for the IR, Mediabridge and Girder plugins.
Perhaps with a new installation. This might be a "residue" from NR 1.x installation. Since uninstall doesn't remove the registry entries...
I'm still not convinced about linking IR instances to devices - it's not as easy as it sounds. There would have to be a general mechanism anyway since IR is implemented by a plugin. I will however see if I can work out why Lua actions can't repeat - they should do - as far as I know the only buttons that are not supposed to repeat are those with multiple actions. Lua event actions should be fine though, they're certainly designed to repeat.
The action I put into the button clearly resembles a macro, which don't repeat.
As I see it, the only proper way to make this multi-IR-Plugins really work in all circumstances however, is to make the corresponding plugin instance a property of the device (or Panel). I essence it would mean, NR would have to set that property simply before any button is used. I find it odd, that such a general mechanism would be so difficult to implement. Any Button-Alias executes a code that is on a specific device. Why not set the context before that an be done with it. To define a lua sequence in every button and manualy copy an IR code into it really seems not such an elegant way.
Thanks anyway
Rob H
January 7th, 2009, 02:28 AM
I see where you're coming from, but that wouldn't solve the situation where you have a page that needs to talk to more than one IR plugin instance.
Let me see if I can add a function to the IR plugin instances to send IR directly from that instance instead. That would seem to make more sense.
Wilhelm
January 7th, 2009, 05:37 AM
I see where you're coming from, but that wouldn't solve the situation where you have a page that needs to talk to more than one IR plugin instance.
That would be no problem. If you organize the devices according to location, you have a device group for each device. If you need and panel wihich uses different devices, you could just make a button alias to the corresponding device.
Let me see if I can add a function to the IR plugin instances to send IR directly from that instance instead. That would seem to make more sense.
I don't understand what you want to accomplish by that - if I understand you correctly. In essence the goal is, to be able to define, with which IR plugin a given device is controlled. I cannot see, how this could be determined from the plugin itsself.
Maybe you should forget about lua for a moment and think like a user? ;)
Rob H
January 7th, 2009, 05:50 AM
I'm not talking about Lua here. I mean that in the Action Designer in NRD rather than selecting the single IR action, you'd pick from among the plugin instances directly in the same way that you would if you wanted to send a command to a given Girder plugin instance.
It's a much simpler mechanism that is already supported for other plugins and doesn't require changes to the CCF format or the internals of NR itself.
Wilhelm
January 7th, 2009, 06:04 AM
Ok, there is some downside though.
* IR has a special meaning in the CCF format. If you would implement it as you say, I would have to redefine every button of every device.
* IR learning would not be possible by simply entering learn mode and learn all the buttons at once. you would have to enter every button by hand and define a single action in the designer.
* If you move a device from one room to another, you would have to redefinde every button on every panel that uses this device.
This is not better than defining a macro with setinstance sendir and setinstance for every button. Perhaps one could handle the repeat better but I really don't see the advantage.
Wilhelm
January 16th, 2009, 03:19 AM
Ok, my 2 additional GC's have arrived today. So I would like to incorporate them into my system as soon as possible.
Is there any news on the issue? What is planned? When will there be any enhancement?
Pretty please ...
Rob H
January 16th, 2009, 08:38 AM
No news yet I'm afraid.
Currently mostly working on NetRemote Designer.
Wilhelm
January 30th, 2009, 01:41 AM
Just a reminder...I'm still waiting for a solution. :(
Do you have any ETA?
TIA
Rob H
January 30th, 2009, 02:21 AM
It's on my list for when I next dive in to the NR sources - I may end up changing the CCF format as you suggested earlier since I have another modification I would like to make to NR that will require a different change to the format.
Wilhelm
January 30th, 2009, 02:24 AM
Well, that keeps my hopes up!
Thank you very much.
Have a nice day!
Rob H
February 2nd, 2009, 03:01 AM
Just been looking at this again - before I make any changes I did notice one thing. If you make the first action for a button the "Set current plugin instance" action of an IR plugin instance then any subsequent IR actions should use that plugin - this doesn't involve Lua and there's specific code in NR to allow the associated IR action to repeat as normal (and I believe also to learn).
Can you give this a try? Sorry about the Lua distraction earlier, I'd completely forgotten (if I ever knew) that this was possible without it.
Wilhelm
February 5th, 2009, 08:20 AM
Hi Rob,
thanks for the follow-up but I'm quite sick at the moment, so it will take me some days to test.
I'll keep you posted. (I hope I'm not missing a window of oportunity here)
... nevertheless, even if it does work, it seems rather redundant to enter a switch-code into each button action under each panel....
Cheers
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.