Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeated Commands, long delay #6

Open
narolinus opened this issue Jun 16, 2017 · 3 comments
Open

Repeated Commands, long delay #6

narolinus opened this issue Jun 16, 2017 · 3 comments
Assignees

Comments

@narolinus
Copy link

narolinus commented Jun 16, 2017

I use OpenHAB2 and Node-Red on a Raspberry Pi 3 with OpenHABian. My current setup is:

  • 1 Homematic Switch in OpenHAB2 with two items (PRESS_1_SHORT and PRESS_2_SHORT)
  • 1 Homematic Wall Plug in OpenHAB2 with one item (STATE)

I wired up both in Node-RED via four OpenHAB2-nodes as follows:

openhab2-in (ItemName=PRESS_1_SHORT) --> openhab2-out (ItemName=STATE, Topic=ItemCommand, Payload=ON)

and

openhab2-in (ItemName=PRESS_2_SHORT) --> openhab2-out (ItemName=STATE, Topic=ItemCommand, Payload=OFF)

This works, but with a noticeable delay of 1 to 2 seconds. Sometimes the ON-Command is repeated and the wall plug turns ON, OFF and ON again. This habens allways, if both events (PRESS_1, PRESS_2) follow shortly after each other.

I can observe this in the OpenHAB-UI and on the device itself. Using debug-nodes in Node-RED does not show anything suspicious.

If I use OpenHAB-Rules or MQTT-messages via OpenHAB-MQTT-Binding, the switching works almost instantly and without repetitions, but I really want to use Node-RED with your Nodes, because it is much nicer and simpler to deploy rules with it.

What am I doing wrong?

@narolinus
Copy link
Author

I think I found the source of the problem: The item changes it state to "ON" after pressing the switch button and keeps this state for around 2 seconds.

Adding a switch-node (checking for "ON") and a trigger-node (50ms) between the openhab2-in-node and the openhab2-out node fixes the repetition-problem. Sadly it adds around a second to the delay. I also tried to use a Node-RED instance on my pc, thinking the Pi could be to slow to interpret those rules. It did not change the delay. This is strange.

Adding a Node-RED-UI with buttons to trigger the openhab2-out-nodes, showed the switching itself works flawlessly and almost instantly (as MQTT-messages did).

@pdmangel
Copy link
Owner

hi narolinus, I've been mostly away from home the last 2 weeks. Sorry for the delay in answering.
I'll try to reproduce the problem here and find out what the cause is.

@pdmangel pdmangel self-assigned this Jun 30, 2017
@pdmangel
Copy link
Owner

pdmangel commented Jul 3, 2017

Hi @narolinus, I did some tests with a virtual switch and a z-wave light switch and I don't experience any delays at all.

  • are you running node-red and openhab on the same pi ?
  • does your openhab2-controller (in node-red) connect to localhost or 127.0.0.1 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants