Help with openHAB IP control

Forum to ask for any help
Post Reply
xluorp
Posts: 3
Joined: Fri Jun 28, 2013 3:58 pm

Help with openHAB IP control

Post by xluorp » Mon Nov 05, 2018 11:30 pm

Longtime iRule user looking for a replacement. I am impressed so far by Demopad but have run into a snag that I can't solve. I have set up several ip devices that are working fine but my openHAB device will not communicate (openhabian on RaspberryPi). This has always worked fine in iRule.
Using Hercules I have picked up what is being sent out.

From Demopad:

Code: Select all

/classicui/CMD?theater_group_dimmer=100{0D}{0A}
From iRule:

Code: Select all

GET /classicui/CMD?theater_group_dimmer=100 HTTP/1.1{0D}{0A}Host: 192.168.1.42:8080{0D}{0A}Accept: */*{0D}{0A}Accept-Language: en-us{0D}{0A}Connection: keep-alive{0D}{0A}Accept-Encoding: gzip, deflate{0D}{0A}User-Agent: iRule/4977 CFNetwork/974.2.1 Darwin/18.0.0{0D}{0A}{0D}{0A}
I have tried pasting the iRule command that was received by Hercules into Demopad but that did not work. I read in this forum about how to convert a command to "GET" but that did not wok either.

I am grateful for any help, Thanks

xluorp
Posts: 3
Joined: Fri Jun 28, 2013 3:58 pm

Re: Help with openHAB IP control

Post by xluorp » Sat Nov 10, 2018 2:57 am

OK, after hours of testing and sifting through this forum, I finally found the answer. I post here to save others the time.
You must use HTTP/1.0\x0D\x0A after the command. Not HTTP/1.1 The suffix \x0D\x0A must be part of the command even though it is set in the device. So in my case the command would be;

Code: Select all

GET /classicui/CMD?theater_group_dimmer=100 HTTP/1.0 \x0D\x0A

User avatar
DemoPad
Site Admin
Posts: 720
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: Help with openHAB IP control

Post by DemoPad » Sat Nov 10, 2018 10:36 am

Note that Hercules represents hexadecimal characters in {0D} format for example, you would need to swap to \x0D format within DemoPad. I suspect the HTTP/1.1 approach would have worked if these changes were made to the iRule command, but if HTTP/1.0 works anyway then it requires less parameters.

xluorp
Posts: 3
Joined: Fri Jun 28, 2013 3:58 pm

Re: Help with openHAB IP control

Post by xluorp » Sun Nov 11, 2018 6:53 pm

OK, yes, I see that now. Thanks for your comment.

Post Reply