Reflecting Alarm state into a Simulated Contact & Motion Sensor


(Ben Vincent) #1

Hi All,

I’m looking for some advice on the right way of completing a project I’m working on. I have Leviton OmniPro alarm and I’ve written a pretty basic Raspberry PI that uses a Serial cable to integrate with the alarm. The app get updated every time a Zone changes state and the Alarm gets armed etc.

My goal is to reflect this state into ST. My thought is to create a Simulated Contact & Motion Sensor but I’m trying to figure out the best way of reflecting this state from Raspberry PI into ST.

I figured out away of doing this with AlexaHelp, using the Cloud Interface, but before I take the plunge I want to get some advice.

In the long run I also want to be able to reflect ST state back into the alarm, such as turning the alarm on.

Does anyone have some guidance on how to create a proxy like this?

Cheers

Ben


(Joe) #2

@ady624 - can you help at all? You did something similar with Digital life.


( I hate Mondays) #3

No, sorry. Of course I can :wink:

@taasss needs what is called a Web Service SmartApp. This app needs to create a child device for which it will keep updating states as it gets updates from the Raspberry PI.

I built an app called Home Cloud Hub which can be used as a backbone and a new module added for your alarm. Look for the AT&T Digital Life integration, Joe can help you locate it.

How do you get the events from the RS232? NodeJs? php? perl? bash?


(Ben Vincent) #4

Cool that does make sense. I think AlexaHelp\Cloud Interface is a similar concept, it allows you to call ST to update the state of a module (might be limited to a switch). I’ll check out Home Cloud Hub.

The events I receive are via RS232, so at the moment I have a simple c# app running on Raspberry PI that receives the strings from the alarm and writes them into a text box. I can easily expand this to call a Web Service every time there’s an update, and probably do the mapping between Zone X and ST Module in my app.


( I hate Mondays) #5

Oh okay, then, to get you started, get the HomeCloudHub smartapp and look at its code.

Step 1: enable oauth
Step 2: create mappings - look them up in the hch smartapp - each one defines an entry point - use the createAccessToken and the code that follows it to figure out the root path for the calls you need to make from your pi3. Then add /endpoint to it, whatever “endpoint” name you decide to use
Step 3: within the endpoint, define a method to execute. Also define http method there. You will need to create a device, find the example in hch. Create a DTH and use its namespace and name in the smartapp to create the device. You will need a unique dni device network id to make sure you don’t keep creating devices - you look for it, if it doesn’t exist, you create it, else you use the one you found.
Step 4: send the dth events to update attributes.


(JBrown) #6

I’ve been using JSON with a esp8266, I used this code as example for my project https://github.com/cschwer/esp8266/tree/hardcoded and here are some examples for virtual switches https://github.com/DanielOgorchock/ST_Anything


(VM) #7

Hi - I’m trying to get my raspberry pi to talk with my omnipro as well. Can you please share your code with me and also tell me what kind of serial cable you used?


(Ben Vincent) #8

Sorry, I didn’t get the notification for your post. I’m happy to share my code, it might not be very generic, but it’s working reliably for me.