Vantage Controls Qlink Automation

Oh oh, I see what you mean. I’m not sure how that helps, though. I mean you can telnet to the device, issue the commands, and see what it responds with.

I mean I can see it being useful for troubleshooting the openhab gateway to the device, but not sure what else it is good for.

–Donnie

I think it’s my fault…I read that you were looking to capture button status if someone was manually pressing one. Sorry…after re-reading I see you are looking to query the button status.

I did see in the documentation you posted that STATUS + TYPE seemed to be valid. And there is a type=BTN.

Did you try that?

Squid

Yeah. It just returns nothing useful (this is two tries, the second trying a button ID):

STATUS BTN
R:STATUS BTN
STATUS BTN 91
R:ERROR:5 "Wrong Number of Parameters"

But yeah, if I leave that telnet open, I’m seeing real button presses. So you’re right that those could be captured. But you’re also right that I just want to query status so I can have a “turn this thing on” button in openhab rather than a less-intelligent “emulate a button press on this button.” Because if I’m somewhere I can’t see the output, I don’t know if it’s on already or not.

–Donnie

Okay, I’m finally back to poking at this. But I’m a tad lost. Here’s where I am so far:

Used PaperUI to install TCP binding and Map transformation.

Added your tcp.cfg to /etc/openhab2/services

Now I’m a bit stuck. I think I understand what to change in your examples to convert your QLink stuff to my Infusion stuff (the VSW stuff gets converted to BTN, basically, then my IP address and port numbers, etc). But what’s vague to me is still things like where the .things file and the Map file go.

And then once I have those in the right places, what do I do to create a button in OH to trigger the on and off?

I think these are fairly easy questions to answer for someone experienced with OH, but getting started is a bit of a maze of documentation.

–Donnie

Glad to see that you are back at it :slight_smile:

I’ll do my best to assist where I can.

First thing to note, is that the TCP binding is a OpenHab version 1 binding which does not utilize Things - so there is no .thing file. You will need to manually create Vantage Items for each load/switch you want to control. These items will be placed in a .items file which is placed in your conf/items folder

The .map files are placed in your conf/transform directory.

So let’s take a simple light switch that controls my hallway lights.

I have a file called uplights.items which contains all of my upstairs lighting. The first line of that file contains the switch for my hallway lights:

Switch Hallway "Hallway Lights" [ "Switchable" ]{ tcp=">[ON:10.5.x.x:3040:'MAP(90.map)'],>[OFF:10.5.x.x:3040:'MAP(90.map)']"}

Switch = The type of item
Hallway is the name of the item
“Hallway Lights” is the label of the item (used on the sitemap)
[ “Switchable”] is a tag for allowing ALEXA to control via Hue Emulation to control it
{ tcp=“>[ON:10.5.x.x:3040:‘MAP(90.map)’],>[OFF:10.5.1.6:3040:‘MAP(90.map)’]”} is the command that we are issuing to control the light via Vantage. TCP is the protocol, the > sign indicates we are sending commands via TCP (if it were < it would indicate we are listening for data to process) The [ON:10.5.x.x:3040 ‘MAP(90.map)’] says for the ON command send it to 10.5.x.x port 3040 and the ON command string can be found in the 90.map file. The [OFF:10.5.x.x:3040 ‘MAP(90.map)’] performs the same function for the OFF command.

My 90.map file looks like this:

ON=VSW!1 90 1 6\r
OFF=VSW!1 90 1 6\r

These are the Vantage commands I am sending to mimic a button press, that’s the reason they are the same for ON and OFF as I am toggling the button.

Now that we have an item and the mapping which shows which commands to send, we need a switch to operate this item.

You create this switch in your sitemap.

The switch in my sitemap looks like this:

Switch item=Hallway icon="light"

The above code must be part of a valid sitemap to work, I think it would be in your best interest to review the docs for sitemaps and items so you can get a good understanding of how they work if you are new to OpenHab. I have a feeling that once you get a handle on the concepts you’ll be miles ahead of me in making your system work the way you want it to.

Let me know what else I can do - can’t wait to hear your results.

Squid

YOU DA MAN

Followed these instructions plus the instructions on creating a Sitemap and now I have a working basic switch that turns one light on and off.

Biggest difference is my .map file is a much simpler “ON=BTN 171\r” followed by the same OFF like you. But same thing, different syntax.

I also learned something about InFusion TCP that wasn’t clear before. If you just telnet to it, you get no status output until you TELL it you want it. I don’t mean direct queries…I mean rolling output whenever something happens on the system (ie. someone hits a physical button). You see that by issuing the proper STATUS , like “STATUS ALL” shows all sorts of info, including which loads turned on.

So if you want to get jiggy with things, it is possible to listen to the TCP traffic and know what state the lights are in for sure. How you do that with OH, though, is a much bigger learning matter. For now I’m okay with toggling and not knowing. I’m going to skip straight to seeing how to get this going with IFTTT from here. I may revisit state, we’ll see.

BOOM, thanks @kidsquid. Big big help.

–Donnie

And it took me not very long to connect to the cloud connector, then connect IFTTT to that, and now I control my outside lights from anywhere in the world via SMS, button widget, Alexa, and web.

Awesome. Thanks again!

–Donnie