Button is always locked for 2s

Hi,
I have some Timing issues with KEY Inputs.
My setup is quite simple. I have installed openhabian and homegear on a Raspberry PI 3 and connected a Homatic wired bus (RS485) with an external USB to RS485 converter to homegear. In the Paper UI I setup the Homematic Binding and also the Things and Items. Everything works fine. I created a simple rule txt file in the rules Folder that has one very simple rule:

rule "Relais schalten"
when
  Item Office_1_PS1 changed to ON

then
  if(Office_1_REL1.state != ON) {
    sendCommand(Office_1_REL1, ON)
  }
  else {
    sendCommand(Office_1_REL1, OFF)  
  }
end

that just toggles an relay by pushing a button. That works very well.
My problem is that the button is locked for about 2s each time I push it. The Events.log file Shows the behaviour:

2018-06-03 22:11:45.478 [vent.ItemStateChangedEvent] - Office_1_PS1 changed from OFF to ON
2018-06-03 22:11:45.491 [vent.ChannelTriggeredEvent] - homematic:HG-HMW-IO-12-Sw7-DR:12f88c10:OEQ08xxxxx:1#PRESS triggered SHORT
2018-06-03 22:11:45.500 [ome.event.ItemCommandEvent] - Item ‘Office_1_REL1’ received command ON
2018-06-03 22:11:45.515 [vent.ItemStateChangedEvent] - Office_1_REL1 changed from OFF to ON
2018-06-03 22:11:45.772 [vent.ChannelTriggeredEvent] - homematic:HG-HMW-IO-12-Sw7-DR:12f88c10:OEQ08xxxxx:1#PRESS triggered SHORT
2018-06-03 22:11:47.778 [vent.ItemStateChangedEvent] - Office_1_PS1 changed from ON to OFF

Description:
At 22:11:45.478 I push the button on the Homematic Wired Module.
At 22:11:45.515 the Relay on the Homematic Wired Module is turned on
At 22:11:45.772 I released the button on the Homematic Wired Module
But only 2 seconds later at 22:11:47.778 the button is again released so that I can again trigger on the ON-Event in my rule.
This behaviour can also be seen in the “Control” section of the Paper UI.

Is there a possibility to minimize the delay or to turn it off? I would like to push the button and react on the button very quickly.

Thanks in advance,

Artur

I am sorry but I don’t see where to problem is. You push the button and 22ms later your relay turns on. I call that “very quickly”

You wäre Wright, but if I want to switch the relay back again within 2s it is not possible because the push button state is still ON and the rule does not Fire. After 2s I can switch the Relay again because the internal state of the button is again OFF and I can trigger on the OFF to ON transition again.

ARTUR

This is due to your hardware. The switch it self send 2 ON updates and then an OFF update after 2 seconds. Maybe the switch config can be changed or the firmware updated.

Thank you for your Reply but I don’t think that the Hardware sends the “OFF” state that late. I again performed a smal test and attached the log files:

OpenHAB Events.log:

1    2018-06-04 17:46:36.403 [vent.ChannelTriggeredEvent] - homematic:HG-HMW-IO-12-Sw7-DR:12f88c10:OEQ0862609:1#PRESS triggered SHORT
2    2018-06-04 17:46:36.411 [vent.ItemStateChangedEvent] - Office_1_PS1 changed from OFF to ON
3    2018-06-04 17:46:36.647 [vent.ChannelTriggeredEvent] - homematic:HG-HMW-IO-12-Sw7-DR:12f88c10:OEQ0862609:1#PRESS triggered SHORT
4    2018-06-04 17:46:36.702 [ome.event.ItemCommandEvent] - Item 'Office_1_REL1' received command ON
5    2018-06-04 17:46:36.711 [vent.ItemStateChangedEvent] - Office_1_REL1 changed from OFF to ON
6    2018-06-04 17:46:38.653 [vent.ItemStateChangedEvent] - Office_1_PS1 changed from ON to OFF

Homegear.log:

1    06/04/18 17:46:36.382 HomeMatic Wired packet received: FDFFFFFFFF980001B3D2064B0000CEEF68
2    06/04/18 17:46:36.383 Module HomeMatic Wired: Info: PRESS_SHORT of HomeMatic Wired peer 1 with serial number OEQ0862609:1 was set to 0x33.
3    06/04/18 17:46:36.399 HomeMatic Wired packet received: FDFFFFFFFF9A0001B3D2124100120003064F455130383632363039F3D6
4    06/04/18 17:46:36.638 HomeMatic Wired packet received: FDFFFFFFFF9C0001B3D2064B0000D2CD42
5    06/04/18 17:46:36.638 Module HomeMatic Wired: Info: PRESS_SHORT of HomeMatic Wired peer 1 with serial number OEQ0862609:1 was set to 0x34.
6    06/04/18 17:46:36.670 HomeMatic Wired packet received: FDFFFFFFFF9E0001B3D2124100120003064F45513038363236303901A0
7    06/04/18 17:46:36.708 RPC Server (Port 2001): Info: Client number 9297 is calling RPC method: setValue (2) Parameters:
8    (String) OEQ0862609:13
9    (String) STATE
10   (Boolean) 1
11   06/04/18 17:46:36.709 Module HomeMatic Wired: RS485 Module "CTI-RS485": Info: Sending: FD0001B3D21A0000000105780CC8D224
12   06/04/18 17:46:36.734 HomeMatic Wired packet received: FD00000001380001B3D206690CC800D176
13   06/04/18 17:46:36.734 Module HomeMatic Wired: Info: STATE of HomeMatic Wired peer 1 with serial number OEQ0862609:13 was set to 0xC8.
14   06/04/18 17:46:36.734 Module HomeMatic Wired: Info: WORKING of HomeMatic Wired peer 1 with serial number OEQ0862609:13 was set to 0x00.
15   06/04/18 17:46:36.753 Module HomeMatic Wired: RS485 Module "CTI-RS485": Info: Sending: FD0001B3D21900000001020C4E

Here you can see that in the Homegear.log file line 1 the button was pressed at 17:46:36.382 and in line 2 Homegear creates the info that the button 1 received the PRESS_SHORT event.
openHAB is creating the …TriggerEvent (line 1 of the openHAB Events) and than in line 2 creates …ChangeEvent where the Item Office_1_PS1 is changed from OFF to ON.
In line 4 to 6 of the homegear log file it is logged that the button is released again (~300ms later). This action is registered in the openHAB events.log file in line 3.
In line 4 of the openHAB events.log file the state of the relay is set to ON.
This state Change is processed in the homegear.log file in lines 7 to 15.
So everything is very quick within about 400ms! Perfect!!!

BUT than, and that can be seen in line 6 of the openHAB events file the state of the Item “Office_1_PS1” is changed from ON to OFF about 2 seconds later. And it is alway about 2 seconds later so it can’t be a performance problem in openHAB or the Raspberry PI.
In my opinion this state change must take place when the …TriggerEvent in line 3 of the openHAB events file had been received and not 2 seconds later.

Thank you for your help,

Artur

Some testing later …
If I add the command

Office_1_PS1.sendCommand(OFF)

at the end of my rule so that it Looks like:

rule "Relais 1 toggeln"
when
   Item Office_1_PS1 changed to ON
then
   if(Office_1_REL1.state != ON) {
    sendCommand(Office_1_REL1, ON)
  }
  else {
    sendCommand(Office_1_REL1, OFF)  
  }
  Office_1_PS1.sendCommand(OFF)
end

Then it works as expected - I can toggle the relay between ON and OFF very quickly. So I manually reset the state of the button in my rule…
But if I do it that way, the “LONG_PRESS” with the button does not work any longer :frowning:
So isn’t there a possibility to decrease the mentioned time of 2 seconds to let me say 0.5 seconds? Somewhere in the configuration of openHAB?

Have a nice day,

Artur

What is the configuration of the item Office_1_PS1?

I configured the item

Office_1_PS1

with the Paper UI and checked that the 2 delays, that can be configured are set to 0. The item Office_1_PS1 is configured as switch.
I already tried to set the two delays (If I can remember one delay was for incoming and one delay was for the posting of events) in the configuration to 1 or 0.5s because sometimes 0 means “default” and I thought that default could be 2s :wink: but that doesn’t help either.
Tonight I can post a screenshot of the configuration and I will try to set up the system by textfiles only not using the Paper UI. I read a lot of posts where at least user got there problems solved by using the text configuration with the .items, .sitemap files etc.only and not using the Paper UI.

Thank you for your help,

Artur

Good idea

Hi,
I now reinstalled everything starting at openhabian. I installed the Homematic Binding with the PaperIU and created the .things, .items and .rules files from scratch.

Outcome: Same behaviour as setting up the system with the Paper UI… :frowning:

Now it seems to me that this behaviour is in the homematic binding. So no way to change it?

Best,

Artur