Gate opener question


#1

right now I have my a camera that is connected to my gate that i can use to open and close the gate through the camera web interface obviously its just a web trigger so does any one have any idea how i could integrate that.


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

Is there a published API too? Sometimes clicking a button ain’t that easy if you have to authenticate first,

You can Google the camera model to find extra documentation… is it AXIS P1353?


#3

i have the camera working in smart tiles and i do have it set so you have to authenticate. i will have to look around some and do some research i was just thinking of some virtual button. but i literally just got the hub few days ago and started messing around with it so I don’t have a clue what i am doing


#4

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”]

<=[


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

Yup… That’s probably the simple relative html path to “on” Command (action=1 or 0 might be “off”)?

Try the path directly from your browser (prefixed with cameras IP address). If that works, then you just have to read up on on the hubAction() method in SmartThings; probably lots of examples available… Start by searching for sample camera device type Handlers?


#6

you are right if I open the link it performs the action. guess ill go read up on hubaction. guess i should have added this will save me money since i don’t have to buy any extra device and most cameras have the same input output ports even 1 of my cheap foscams have the ports.


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

Yup…

For basic http calls without any fancy parsing needed, I believe it’s fairly simple.

http://docs.smartthings.com/en/latest/cloud-and-lan-connected-device-types-developers-guide/building-lan-connected-device-types/building-the-device-type.html#making-outbound-http-calls-with-hubaction

def result = new physicalgraph.device.HubAction(
    method: "GET",
    path: "/somepath",
    headers: [
        HOST: "device IP address"
    ],
    query: [param1: "value1", param2: "value2"]
)

(JZst) #8

See my project here as it may help you a bit: Raspberry Pi with PHP (or Arduino/ESP8266/NodeMCU) to GPIO to Relay to Gate/Garage Trigger

Also install Fiddler Tool and monitor your HTTP traffic while running some of the commands from the web browser. This is how I capture the device’s actions and attempt to talk to their internal API. In your case, it seems pretty simple. Just concentrate on the SENT headers and making sure that you replicate those in the Groovy/ST code. SENT panel is the top right of Fiddler while RECEIVED response panel is bottom right in Fiddler.