New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Demo - Bypass Toggle Logic #2
Comments
Just now I'm seeing it. Anyway, at my home all of the switches and etc have separate commands for on and off (and not the only one for toggle only). |
@radinsky Right, my remote just has a button for TV Power. So, the "powerTvOn" command is defined as "CHECK" which checks to see if the IP is alive. If it's ON, it prints the status (and sends it back to the client). If it's off, it runs the "power" command, which is the IR. I've just got a little RF remote I picked up for $1 with 3 AC Outlets. It has separate ON and OFF commands, but since all I have is the BlackBean Mini, and it can't talk to RF devices, I'll be adding GPIO support to this project. It's running on a Beaglebone so I have plenty of GPIO lines to play with. I'm not exactly sure how that will look in the config file just yet, but it seems a logical addition. I'm just waiting for a couple 4066 ICs to control the remote buttons with and it will all be wired into the BeagleBone. |
Now turning off lights and fans using GPIO lines! |
New behavior. If a command ends in on or off (MACRO or otherwise) then a global Status variable checked (0 for off, 1 for on) to make sure the device is not already in the given state. If it is, a warning is issued and no further processing is done. Otherwise, it sets the variable to the new state and then will look for a command without the "on" or "off" in the name. If found, it executes it. Othewise, it defaults into trying to find an IR code with on or off already in the command name. However, this is great for many things, but its more reliable to test if a host is up, as in the first example. However, you always ping a device to see if its on as many keep the network stack on all the time (for example, my Vizio only works with the above in Eco mode, not Fast mode, since Fast keeps the network stack up when the TV is off). |
Sometimes you want to turn something on (or off) and not toggle it. For example, if a device is already on and you run a morning routine that turns it on again, you don't want it to go off, but that's exactly what sending the command again will do. Here is one method to tackle this:
This assumes that "power" is defined in your "Commands" section and toggle's the power. Instead of using "power" directly, use powerTVOn and powerTvOff in your Macros. This checks to see if the host if on by pinging it. On some models, this may fail if it keeps it's network on, but it gives you an idea of how to work some of this stuff.
The text was updated successfully, but these errors were encountered: