I'm setting up my homematic system (switches, dimmers , thermo , ccu1).
But i would like to detect a double click on one of my switches.
So 1 click is light on , doubleclick is all lights in living room on.
I made a script comparing the last timestamp to the current one..and calculate the time between.
Code: Alles auswählen
!puts timestamp in var_time_press and compares to last press..if less <5 sec activate doubleclick
var mySysVar = dom.GetObject("var_time_press");
var source = dom.GetObject("$src$");
var timeStamp = source.Timestamp().ToInteger();
var oldTimeStamp = mySysVar.Variable().ToInteger();
var diff=timeStamp-oldTimeStamp;
if (diff<5) {dom.GetObject("BidCos-RF.BidCoS-RF:1.PRESS_SHORT").State(true);}
!write timestamp to system var
mySysVar.Variable(timeStamp);
I would like it to work with a normal doubleclick , like 0.5 sec.
It seems that it takes about 2 seconds before the click is transfered to the ccu..if within this time a second press is done..only one click event is send.
All idea's are welcome.
Thanks.
Greetings , arnold