[ANSWERED]Is this overly complicated or...missing something?

Posted on
Sun Nov 01, 2015 7:32 pm
Swancoat offline
Posts: 480
Joined: Nov 20, 2009
Location: Houston

[ANSWERED]Is this overly complicated or...missing something?

I have a pretty simple problem: I have a TV lift that uses one remote code as an up/down toggle and doesn't have discrete codes.. State, however, is easily monitored with an Insteon Door sensor.

SO: I'd like to have a 'device' that represents the lift: Turn it on to move it up, turn it off to move it down.

However, I set up a virtual device, and it still sends an 'off' signal if the device is off (which basically defeats of monitoring the state).

So, first I have to create a variable, and then two variable actions for when the door sensor turns on or off, setting the variable to true or false.

Then I create the virtual device. You can't leave the on and off action groups blank, so include the IR Action for both of those and the toggle (since there's only one action I can use).

This SEEMS like the right way to set it up... except like I say, when the lift is 'off' and you shut it off, it still sends the code (so say... including it in some kind of 'all off' command is pointless).

Simple things that COULD solve this, but for some reason we can't do:

a) Have a conditional in an action. I can think of a MILLION reasons why I'd want to have an action be conditional on something - but they aren't.
b) Have the ability to fire a trigger with an action group. This would just be a workaround so that you could use an action group (which the virtual device needs). Even if this worked it would ultimately require 4 triggers and 3 action groups and 1 variable created just to make this simple thing work.

I kinda figured this would be a very typical case for using a virtual device, so I'm surprised it's so cumbersome. Ultimately, it looks like the only way I'll get the conditional is by making my action groups just a few lines of applescript that send the IR conditional on the lift state. Ugh.

http://nerdhome.jimdo.com

Posted on
Mon Nov 02, 2015 9:43 am
FlyingDiver offline
Posts: 2879
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Is this overly complicated, or am I missing something?

Sounds like it would be simpler to write a minimal device plugin that has the right logic in it.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Nov 02, 2015 12:26 pm
jay (support) offline
Site Admin
User avatar
Posts: 15351
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Is this overly complicated, or am I missing something?

Well, given that this is the first time we've heard of this particular scenario, it's clearly not something that's very common. ;)

We've heard of conditions per action before, and it's on the list, but demand is quite low and the UI would become quite complex so the tradeoff just hasn't been there.

For your particular situation, though, seems like what you really need is a way to tell the virtual device to NOT perform the ON action if it's already ON (and vice versa). Is that about right?

This would be an extremely simple script action, but it might be an interesting option on a virtual device - I'll add it to the list. In the meantime, for your ON action group:

Code: Select all
sensor = indigo.devices[430257708] # "your door sensor"
if not sensor.onState:
    #do whatever to send the remote code


and for your OFF action group:

Code: Select all
sensor = indigo.devices[430257708] # "your door sensor"
if sensor.onState:
    #do whatever to send the remote code

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Nov 28, 2015 1:24 pm
Swancoat offline
Posts: 480
Joined: Nov 20, 2009
Location: Houston

Re: [ANSWERED]Is this overly complicated or...missing someth

I know this is like 4 weeks after the fact, but this method totally works.

Basically, I now have a tv lift device cobbled together. It is only enacted via a single IR code that toggles the lift, and I have a door sensor reporting if it's open or closed.

So, there's a variable:
1) used to track the state of the lift.

Triggers:
1) If sensor is closed, set variable to false
2) If sensor is opened, set variable to true.

Action Groups:
1) Toggle Lift (basically just sends the IR code)
2) Lift 'On': 3 or 4 lines of python that executes the above action group only if the sensor is closed.
3) Lift 'Off': 3 or 4 lines of python that executes the above action group only if the sensor is open.

Virtual Device:
1) Basically ties up all of the above and rolls it into one single device for the user interface. So now a user can 'turn the lift on or off' and if they try to shut it off when it's already off (down), nothing will happen (correctly) and vice versa.

http://nerdhome.jimdo.com

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests