Adding logic to an on/off IR device

Hi,

I have a usbuirt connected to my veralite which turns on my tv on and off. If does this by sending a single prontocode i.e. the original tv remote has one button for on and off. I’m wondering if its possible to add some logic so that vera ‘knows’ if the tv is on or off. For example, i have a scene ‘going to bed’ which turns off all lights and the tv. This works fine the majority of the time but if the tv is already off, running this scene turns the lights off and turns the tv on. I would like this scene to only send the prontocode if the tv is on.
The tv only gets turned on/off via the veralite/usbuirt so it seems like it should be possible to add some variable that keeps track of the on/off state and use this as a condition in scenes.

If anyone can point me in the right direction, it would be much appreciated. Thanks!

I’d add a virtual switch and whatever scene/pleg condition you have to turn it on/off turns the virtual switch on/off also.

You can use the condition of the virtual switch as part of the logic

[quote=“casmo, post:1, topic:194654”]Hi,

I have a usbuirt connected to my veralite which turns on my tv on and off. If does this by sending a single prontocode i.e. the original tv remote has one button for on and off. I’m wondering if its possible to add some logic so that vera ‘knows’ if the tv is on or off. For example, i have a scene ‘going to bed’ which turns off all lights and the tv. This works fine the majority of the time but if the tv is already off, running this scene turns the lights off and turns the tv on. I would like this scene to only send the prontocode if the tv is on.
The tv only gets turned on/off via the veralite/usbuirt so it seems like it should be possible to add some variable that keeps track of the on/off state and use this as a condition in scenes.

If anyone can point me in the right direction, it would be much appreciated. Thanks![/quote]

I use a power plug Fibaro and with the power consumption it tells me if the equipement is OFF, ON in sleeping mode, or ON in active mode… then my scene ( or ALTUI workflow ) can take the right decision