This page last changed on Aug 07, 2014 by amir.

I have been using OR for a while to control shutters, so far it works well.
I'd now like to have some images which change to match the shutter position.
I have no feedback as to the position and only operate the up or down commands for 20s.
Would it be possible with rules to have some sort of a flip flop or latch which changes state with the activation of either the up or down commands?
Very much a Java beginner but would like to know if it is possible and maybe get some pointers.

If I do understand correctly, you have a UI with something like 2 buttons, one for up, one for down, with a single command for each button.

If that is the case, then you can manage images even without the need for rules.

Use an In Memory Virtual Commands to maintain the state (simply have a boolean like opened).
You can create commands for ON, OFF and STATUS.
Have a switch Sensor linked to that STATUS command.
You'll use that sensor, linked to an Image widget to known which image to display.

Then create 2 macros, one for open and one for close. The macro send the command to your shutter controller and also set the boolean flag appropriately.
Then use those macros on the buttons instead of the original command.

Posted by ebariaux at Aug 07, 2014 12:16

Thanks Eric, very useful.
I have a couple of spare outputs i plan to use for lighting. I was going to use a switch and have the image change to reflect the state of the switch, again i have no feedback. I thought of running a macro from the switch but this does not seem possible. Are there any options for this?

Posted by amir at Aug 08, 2014 04:04

For the switch, you'll need to use rules.
Have the switch only toggle the In Memory Virtual Command and control the real device from the rules.

The details have been explained multiple times on the forums already, e.g. for control of IR devices.

Posted by ebariaux at Aug 08, 2014 07:20

Thanks Again

Posted by amir at Aug 08, 2014 08:46

i've got this all up and running on my laptop, added a few rules and images are switching as they should. i'm having a problem when i try do the same thing running on Synology, the commands work but the images do not change,
Anyone else seen this? or have any ideas

Posted by amir at Aug 18, 2014 10:43

Hi Amir.

I tried to do something similar with my shades but the issue is mine are more complex. A short command changes the slat (angle) of the shades while a long one moves the shades the proper direction. Another press simply stops them. This is what the Schneider H/W does. Way back I tried doing that but my work stopped. Few weeks back I returned to the issue.
I have some basic set of rules but I had no time to check them.
The issue was the decision between a short and a long press. The solution seems to be the use of duration XXX where XXXX is time in mSec.

Posted by niraviry at Aug 21, 2014 14:07
Document generated by Confluence on Jun 05, 2016 09:38