Gate command has to be easier than I am making it


#1

if i open this web address my gate opens
http://192.168.1.128:XXXX/axis-cgi/io/port.cgi?action=2:/
if i open this web address my gate closes
http://192.168.1.128:xxxx/axis-cgi/io/port.cgi?action=2:\

I am not even going to mention or say what i have tried to create or cobble together it would only make it worse. it just cant be that difficult. i guess i literally need “how to do this for extra dumb dummies” how to instructions. what surprises me is that no one has used this method… i looked all over hubactions and forty other tasks I couldn’t even figure out how to start to add it. i assumed the device would be a virtual device obviously I have no clue

I should have mentioned the ip address range i use is a class A 10.x.x.x. and those ports are obviously not what I use


(Ben Lebson) #2

If you are using a local IP address you need to use the ‘hubAction’ command. Check out the following devicetype to see how the command works:


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #3

How far did you get using the Developer Documentation section on LAN Device Types?

If you share your source code, we’re more likely to be able to get you over the part where you are getting stuck.


(Stuart Buchanan) #4

look at the device type I recently posted for voxcommando to Sonos integration. That’s about as stripped down as you need for sending web requests


#5

OK i realize why i failed at programming…I want to condense two post I have. i have been reading and I guess its just over my head.

I have an axis camera that has 2 buttons they do nothing but send an open command and a close command.

if I inspect the element i see this

[a id=“buttonOn01_link” href="/axis-cgi/io/port.cgi?action=2:/" target=“Temp”][img name=“buttonOn01” width=“27” height=“27” title=“Activate Open Close” alt=“Activate Open Close” src="/pics/on_blue_pressed_button_27x27px.gif" border=“0”][/a]

[img name=“buttonOn01” width=“27” height=“27” title=“Activate Open Close” alt=“Activate Open Close” src="/pics/on_blue_pressed_button_27x27px.gif" border=“0”]

<=[
if i open this web address my gate opens
http://192.168.1.128:XXXX/axis-cgi/io/port.cgi?action=2:/
if i open this web address my gate closes
http://192.168.1.128:xxxx/axis-cgi/io/port.cgi?action=2:\

I use a 10.x.x.x

Now if someone can give me a tile that works I will be glad to send some money to your paypal account obviously im a little frustrated at this point mainly because im ignorant when it comes to this

if you need more info from me ill provide it but at this point im just going to use the weblink i have on my phone until i figure out a solution to integrate with ST.


(Ben Lebson) #6

so the variable that decides it’s going to open or close is the / or \? Is there any response website that shows when you input that url? Something with the status of the gate (open/closed)?


(Stuart Buchanan) #7

I have created a Device Handler for you, please add this by creating a new device handler from code. then all you need to do is create a device with this handler and update the server name and port number in the device properties with the the correct values.

there is of course only so much i can test and i am unsure what responses will come back from the device, but please test and let me know the result.

https://github.com/fuzzysb/SmartThings/blob/master/DeviceTypes/fuzzysb/Axis%20Gate%20Opener/Axis_Gate_Opener.groovy


#8

a bit out of my expertise here actually a lot but. it seems that yes / is the only variable. there are no responses at all. If i click that link it triggers the camera to send a signal to open the gate if i select the other link it tells the gate to close. just for extra info if i open the gate with the link it will stay open until i select the close link. I hard wired the camera to the control box of the gate and i “think” its a simple open closed circuit. my cheap foscam does the same thing but the axis does it much better. I can open and close from anywhere if I have internet. I hope that answers your question.

The only reason I wanted to go down this path is because of the distance from the house and running more wire for a zigbee type controller. it doesn’t cost me anything to open a weblink and the distance would probably be a problem for any mesh type network. all this coming from someone who has owned ST for a week and have no experience with it or really even what it can or cant do. I truly thought what i wanted to do would be super simple but obviously its not that simple.


(Ben Lebson) #9

Ok, so there is no way to get what the current status of the gate is? If so, the devicetype will not be able to give you an accurate status, unless you want to create a devicetype for the whole camera and retrieve a still picture to get a visual of the gate itself…

Also, to clarify, if you send the open command (http://192.168.1.128:XXXX/axis-cgi/io/port.cgi?action=2:/) when the gate is already opened nothing will happen? Likewise sending the close command (http://192.168.1.128:xxxx/axis-cgi/io/port.cgi?action=2:) when the gate is closed won’t trigger any change?


#10

correct if i send the open command and its open it will do nothing and vise versa for closed
If i send a close command with the link the gate actually waits a pre selected time before it will shut.


(Ben Lebson) #11

You can either try @Fuzzyligic’s DTH above or try this one I just threw together quickly:

I obviously couldn’t test it but let me know how it works.


#12

Fuzzyligic code worked fairly flawless. I have a couple of issues that no code could have resolved since i cant give ST any return info that the gate actually opened or closed. I guess if you could tell ST just trust me it worked with no type of return message.
I greatly appreciate the help and i feel the code was very well written for something he has no access to and had never tried before. I hope that it may help others down the rd.
again I thank you very much and it seems this community is what keeps ST head above water