Jump to content

Program Action Addition - Web Request


ngeren

Recommended Posts

Posted

For developers like my self, it would be great if the ISY could perform an HTTP POST to an internal address within a program.

 

Example URL: http://user:pass@192.168.0.100:8080/isy?program=(JSON object of program details)).

 

Example Program:

 

If

Status 'Garage - Sensor" is On

Then

HttpPost "http://noel:secret@192.168.0.100:8080/isy?garage=open"

Else

- No Actions ....

Posted
For developers like my self, it would be great if the ISY could perform an HTTP POST to an internal address within a program.

 

Example URL: http://user:pass@192.168.0.100:8080/isy?program=(JSON object of program details)).

 

Example Program:

 

If

Status 'Garage - Sensor" is On

Then

HttpPost "http://noel:secret@192.168.0.100:8080/isy?garage=open"

Else

- No Actions ....

 

 

You can if you have the network resources module. I don't see the value in your example however, I do something similar to test my internet connection from the ISY by setting a mvar by calling a network resource using my DynDNS name from inside the ISY. Anything that you can do from a browser using the /REST interface, you can do with a network resource called from a program.

 

-Xathros

Posted

Sorry, not a great "application" example. I want my own web service to be notified of any event that occurs, so my custom applications can take over. The REST interface is great, but it's not ideal to poll the ISY constantly looking for status changes (especially in my case where it's a relay through an IOLink, that will flip back from on to off once it's finished) -- this would lead to false positives and a lot of unnecessary network traffic.

Posted
Sorry, not a great "application" example. I want my own web service to be notified of any event that occurs, so my custom applications can take over. The REST interface is great, but it's not ideal to poll the ISY constantly looking for status changes (especially in my case where it's a relay through an IOLink, that will flip back from on to off once it's finished) -- this would lead to false positives and a lot of unnecessary network traffic.

 

OK that makes more sense to me now. Still, the Network Resources module is EXACTLY what you want and asked for. Your program can monitor status/control of the IOLinc and execute a net resource doing an HTTP post to your external webservice. I do this for Prowl notifications to my iPhone/iPad and to send data to an external syslog service running on a linux pogoplug. Works like a champ.

 

Here is one of my garage door monitor programs:

If
       Status  'Garage / Garage Door IOLinks / GD- Dad Garage Door' is Off

Then
       Set Scene 'Garage / Garage-Dad' Off
       Run Program 'Door Close Beep' (Then Path)
       Resource 'Syslog-Dad Garage Door Closed'
       Resource 'GarageCamPosition2'
       $i.Dad_GD_Status  = 0
       Run Program '.Dad-Open-Close' (Else Path)

Else
       Set Scene 'Garage / Garage-Dad' On
       Run Program 'Door Open Beep' (Then Path)
       Resource 'Syslog-Dad Garage Door Opened'
       Resource 'GarageCamPosition1'
       Wait  1 minute 
       Resource 'GarageCamPosition2'
       $i.Dad_GD_Status  = 1

 

Here is am not only logging the door open/close events but also positioning a PTZ camera in the appropriate direction depending on the door action. Another program decides whether or not to send a notification and yet another will tell the cam to record if the security system is armed and a door opens or motion is detected. All made possible by network resources and all driven by events, not polled.

 

Here is a network resource definition for a prowl notify:

 

 

Hope this helps.

 

-Xathros

post-1437-140474156611_thumb.jpg

Posted

Awesome! This is perfect. Looks like these cats just got $50 from me. :)

Posted

BTW, What cameras are you using? Are they indoor/outdoor?

Posted

I have a mix of old Trendnet (crap), Foscam PTZ - inexpensive fairly good indoor and Smarthome (Identical to the Foscam). I have heard that Panasonic is the cream of the crop. I haven't found enough "Extra cash" to test those for myself.

 

-Xathros

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...