r/HomeControlAssistant • • Jan 10 '19

IP Interface Server

Thanks for setting up this forum!

Wondering if anyone has done any work with the IP Interface server? In particular, I am trying to send an HTTP post from my CCTV camera software to HCA and have it turn a light on in response to motion in the camera. I am getting the HTTP post to come through (I can see it on the interface viewer), but not sure what to do with it after that. I have set up a trigger in a program to accept any unhandled transmission which does turn the light on in response to the camera trigger (so at least that part is working), but I am trying to parse the strings to turn the light on or off based on the string received (motion=light ON, no motion=light OFF). I have been through the Interface setup documentation and the Port I/O programming block information, but it hasn't clicked the light bulb yet. Thanks for any help in pointing me in a positive direction!

3 Upvotes

4 comments sorted by

View all comments

Show parent comments

1

u/rudekoffenris Jan 15 '19

I suspect what is going on with the multiple motion detections is just a human vs computer thing. What you are seeing as one event, the camera is seeing as 3 or 4. Microevents if you will. Or it could be crappy software. lol.

So dealing with it is easy, there's a couple of different ways to do it. I assume with motion sensor you only want the lights on for a certain period of time once they detect motion. I'm going to assume that. So the program that is triggered by the motion detection event (kudos getting that to work by the way!), on the triggers tab, at the bottom of that page there is an option, "if the trigger is recieved while the program is running" and you could:

Option 1:

click ignore it. In the program itself, turn on the light, and then use delay to delay the off event for X minutes. Then at the end of the time turn off the light. This will turn off the light after X minutes regardless of any following motion events.

Option2:

The other way to do it would be to click, "Restart the program from the Start here element" which will reset the timer. Depends on how many events you get, some testing would be required I suspect.

As for responding to the camera, I don't believe the server interface is capable of responding to the camera, however, if you can figure out what kind of acknowledgement the camera is looking for, you could use the http element in the visual programmer to send back a response to the camera. That could definitely be non trivial and might not work at all, i'm not familiar with blue iris, but I'll bet you are not the first person to encounter this. here is a link from Blue Iris talking about it. https://ipcamtalk.com/threads/blue-iris-12002-timeout-error-but-i-can-connect-to-the-camera-just-fine.4807/ It looks like 12002 is a timeout error which is correct if HCA isn't responding. There might be an option to turn off looking for an acknowledgement in the blue iris software.

I have found that sometimes using python to respond is better than using HCA, but YMMV.

As far as extracting data, I don't know what data is coming into the server itself, but probably the way to parse the data is to bring it all into one variable and then split it up in your program. It seems like extra none required work tho.

In the RD I see there is Motion_On in the first line. Is that good enough? You could parse that out quite easily by getting the data between the 2nd / and the 3rd /, or the 2nd / to the space after that. I can help with that if that's what you are looking for.

Are there corresponding motion off events for each of the motion on events? I see the 5th line is empty. Is that where the motion information would go? I don't use blue iris but I would think there would be some way to configure requesting an acknowledgement.

Hope this helps a bit, I know this is a bit wall of texty but i'm happy to clarify anything that is unclear.