Send a short "impulse" via http requests

Hi!
EDIT*

I just found that the problem is on a completely different point, which renders my post quite useless. It seems to have to do with the homematic remote control re-sending commands. But then again… The problem is, that it’s very late and I cannot think anymore. I wanted to delete the post, but I don’t see how or if I can do this. So, instead of just deleting what I’ve written below, leaving a strange empty post, I’ll keep it, but with this **** EDIT***. I’ll go have some sleep and look at it tomorrow and then I may tell you more exactly, WHAT is not working in my configuration.
:slight_smile:

***EDIT2 ****
I’ll leave this as it is and create a new post about the real problem, which concerns the homematic binding (or homematic itself)


(original post)

I’m trying to make OpenHAB talk to my Loxone Miniserver. Since i’m still at the beginning with learning OpenHAB, I first want to keep the ‘smart things’ in the Loxone and use openHAB as gateway to other devices (like a remote control).

Now, the problem is as follows: I want to trigger a Loxone http input, which is connected to a “dimmer module” in the Loxone configuration. What I want this input to do when I press a remote control button: Go ON and instantly (maybe 0.1 second later) go OFF again. This Loxone’s virtual input is just routed in parallel to a physical push-button-GPIO in the Loxone configuration. Just simulating a short trigger of the button.
First I tried it with a rule like this:

when
[remote control button pressed]
then
sendHttpPostRequest(‘http://…/ON’)
sendHttpPostRequest(‘http://…/OFF’)
end

I was able to switch on the light, but after a second or so, it turned off again. It appeared to me that the ON command was re-sent, turning the light off again (a second trigger to the on/off input of the dimmer module in the Loxone).

Then I learned about the exec binding. And in the command line I entered:

curl http://username:pw@IP/dev/sps/io/TestEingang/ON; curl http://username:pw@IP/dev/sps/io/TestEingang/OFF

This worked like a charm. Every time I executed this “chained” commands, the light was triggered on or off.

Now I tried pasting the above in an exec binding. But this doesn’t work. It looks like I cannot perform “chained” commands via the exec binding. Is this so? And does anyone have an idea how I can get this running?

BTW: I know that this is kind of stupid. I try to simulate a physical pulse by a “rising edge event” followed by a “falling-edge-event”. But unfortunately this is - as far as I know - the only way that works with Loxone. I cannot just send an event that is treated like an event. If I omit the OFF command, a subsequent ON command is ignored as the input is already ON. It’s always a “simulated physical pulse” It’s sort of an SPS, but just sort of… quite strange and annoying.

Well, there is one thing that would certainly work: Just write a shell script with these commands (with the input’s name passed as a parameter). And executing that script by the exec binding. But I hope that there is an easier way.

Thanks for your help!
Simon

If you make your virtual input a pushbutton type you can send “Pulse” commands instead of “On” or “Off”.
If you are still playing with Loxone and OpenHAB, I have just published a binding (https://github.com/ppieczul/org.openhab.binding.loxone/).
Looking forward to your feedback.
Thanks
Pawel