Your Universal Remote Control Center
RemoteCentral.com
URC's Consumer Remotes Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 3 made on Wednesday August 22, 2007 at 10:30
aedile
Long Time Member
Joined:
Posts:
August 2006
114
Here is a quick break down on how I handle this situation. First, there is no perfect solution. Second, there are some things you can do to make things work a lot better. Let me preface this by saying I am not an authorized CI or anything, so this may not be the proper way to do things, but it has worked for me. I figured this out all on my own or through the help of some of the files here.

Step One is to set up a logic page in your television device. I assume you can add a new page on your own, so do that. Then right click on it and select "Is Hidden". This will prevent it from being shown when you are paging through, which we want cause we don't want to waste time on making the page pretty. I also usually rename this page "Logic" so that I know it is for logic procedures.

Next, let's make a new button. Change the ID to TVOn and I also like to give it a label of TVOn so I can get to it easily if need be. This will be our "Turn the TV On" macro. Now, down at the bottom of the screen, where you put in IR and sounds and stuff, there is a little toolbar above that section. The last button to the right should have two teeny pages and an arrow between the two. If you hover over it you should get a ToolTip that says "Variable Mode". Click on this button. You should see some new stuff appear over to right side of the screen called "Option".

Now we need to set up a variable. In the option section, there should be a button called "NEW". Click on this button to bring up a dialog box. We are going to have to create a variable, so in the "New Variable" box at the bottom, type in "TVPower" and click apply. Then click close.

This has created our TVPower variable. In the drop down in the option section, select our "TVPower" variable. On a technical note, this is a simple boolean variable. That I know of it only has two states: off(0) and on(1). Initialization when you first start the remote should be setting them to off (0). Now the important thing here is to realize that you are going to have to write two different procedures. One will handle when the tv is in an off(0) state and the other when it is in an on(1) state. Notice above the "NEW" there is a set of radio buttons that say 0 and 1. These are for our two states.
Now think to yourself, what do I want to happen when my TV is off(0)? Well, we want it to turn on, of course. So in the "IR Data" field, go in and select the TV Power toggle command that you learned or got off the IR DB. Now, when we activate this button, our TV will turn on. Unfortunately, if we do nothing else, this won't help us. Because we have moved the TV from an off(0) state to an on(1) state, we need to update our variable. Fortunately, URC has given us an easy way to do this. On the next line in the command area, double-click on the "Var" field to the left of the "IR Data" field. This should bring up a dialog box with a list of your variables (which should only be one at this point). You will see our friend, the "TVPower" variable, in the list. Click on it to highlight it. Then click on the check box. Notice that some stuff has ungreyed below the list. There should be a set of Radio Buttons with 0, 1, and Invert Status options. Since we have moved our TV to an on(1) state, you should select one. Now click ok.

Now, lets review what will happen when we go through this set of procedures. First of all, when we start the remote up, the TV is off. The TVPower variable is set to off(0). We activate this macro and it goes and checks the TVPower variable. It sees that it is set to off(0) so it uses that set of procedures. The first thing it will do is use your IR code to turn the tv on, then it sets the TVPower variable to on(1). So now, the remote "knows" that your TV is on. Now, I skipped over a big portion of the normal procedure to get you to a payoff, now lets discuss the flipside. What if your TVPower variable is set to on(1), as it would be if we had activated our macro. Well, let's think about it. If our TV is on(1) and we click on the "TV On" macro, what do we want to happen? Well, nothing. So, while still on our "TVOn" button, click on the 1 over in the "Option" section. This should give you a new, clean command section. Since we don't want to really do anything here, just leave it blank though.

To further reinforce this, lets do a quick repeat with the TVOff functionality. Create a new button, call it TVOff and label it as with the other one. Enter variable mode as above and select the TVPower variable from the drop down. Now, if the TV is off(0) and activate the TV Off macro, then we don't want anything to happen at all, so we will leave option 0 blank. But if the TV is on(1), then we want it to turn off. Click on option 1. In the first command slot, put in your IR Code for TV power toggle. Remember, now that the TV has been turned to off(0) we will want to change the variable, so in the second line, double click the Var field and set the TVPower variable to 0.

Well, what does this give us? Simple. We have basically tricked the remote into giving us a psuedo-discrete TV On and TV Off functionality. Now, any time you need to make sure that the TV is on, just go into Alias instead of IR and select our TV On macro.

There is one HUGE caveat to all of this. Since the remote is not two-way, there is never any way to ensure that the TV has "actually" turned on via the remote. The only way to do that is if you are a person and can visually verify that the TV is indeed on. The problem with this lies in the fact that the remote thinks the TV is on when you activate that macro, whether or not the TV actually turned on. We all know that sometimes a person isn't pointing the remote right or whatever and the TV doesn't turn on. Unfortunately, this breaks our TVOn macro because the remote "thinks" the tv is on, but it really isn't. So no matter how many times you run that on command, it will assume that the tv is on and do nothing. How do we fix this? Well, I have seen several things, but my own solution is the "Help" page (which I mostly stole from Harmony). In the top left corner (or somewhere else unobstrusive) of almost every page that I have is a "Help" button which takes me to a "help" page for the particular activity I am in at the time. On this page, i have a listing of all the devices and their states that can be easily toggled. For example, if we are watching the tv, I know the tv needs to be on. So on my help page for watch tv, i have a "Is the TV turned on?" button. Now in this button, under alias, I have gone through to my TVOn command. But Rather than just selecting the alias, you can actually double click on the TVOn alias and it will open up once more with the two different options. Now, to force it to assume the TV is off, you would click on the Before(0) option. What this is telling the remote is "Ok, even though you think the TV is on, assume it isn't and run the TVOn command as if the TV were off". This will run the TV Power toggle IR and set the TVPower variable to on(1) even if it is already set to on(1) and now the remote thinks the TV is on PLUS it actually IS on.

That process takes care of the only hole in our scheme. We now have a pseudo-discrete for our tv and a way to fix it if the remote gets out of sync with reality. There are lots of other things you can track with variables. I have a cheapo Vizio TV with no discretes for inputs and I use a similar scheme to track what input I am on. I have seen people use variable to make a PIN for their remote and do all sorts of other cool stuff. If you would like to see the file I created for this tutorial, please check out the following url:
[Link: flamingchickens.org]
If you would like to see an in-depth look at what can be done with variables you can check out the RCC file I am using for my Home Theater here:
[Link: flamingchickens.org]
But fair warning, that is fairly large. I hope that this has been helpful to you. Apologies to any programmers out there who find my techniques offensive. As I said, I've never had the benefit of a class to teach me all of this stuff. And I apologize for the length here as well. I just know that if I had found something like this when I was starting out, it would have made my life a lot easier.

Regards,
-aedile-
www.mx-3000.com
Templates, tutorials, files and more.


Hosting Services by ipHouse