Page 1 of 1

Virtual devices and conditional on/off actions

PostPosted: Mon Dec 16, 2019 4:27 am
by nick.perry
I have a curtain motor - one that i can just turn on/off with no knowledge of what the state of the curtain is.

Years ago, before virtual devices, I created my own X10 device for the purpose (using an unused X10 address). Wrapped around it were various triggers, schedules and action groups that would attempt to remember the state so if the curtain was open (the device was 'on') and I switched or scheduled the device on, the motor wouldn't run. It worked pretty well.

I've just retired my last X10 device (the motor relay is now Z-wave) and though I'd try unwrapping all the complex triggering and use a Virtual Device with actions associated with on and off and a variable to hold the state. Great. But I was hoping it would handle the situation of a virtual device that was on being switched on again by not executing the on action group. No such luck.

Am I missing something or will I still have to have triggers? My proposed workaround is for the on/off action groups to simply change the state of the variable associated with state and then have triggers that operate when that variable CHANGES. Not super messy but would like it to be simpler if possible.

TIA

Nick

Re: Virtual devices and conditional on/off actions

PostPosted: Mon Dec 16, 2019 4:31 pm
by jay (support)
At the moment, all ON and OFF requests will be executed regardless of the current state. Adding the ability to not do them based on the state has been requested and is on the feature request list.

Re: Virtual devices and conditional on/off actions

PostPosted: Mon Dec 16, 2019 5:56 pm
by nick.perry
Thanks Jay

Re: Virtual devices and conditional on/off actions

PostPosted: Mon Dec 16, 2019 7:07 pm
by lalisingh
I have used a dry contact sesnsor(door/window) to update a open/close state of the curtain. May work in your case as you can then make an open/close action conditional on the state.

Hope I understood your question correctly.