Hello Internet Neighbours!

So I’ve recently figured out how to programmatically tell my light switch to turn on when the door sensor is triggered. If you missed the first post on HomeGenie, here it is. It’s basically a Home Automation web application that can control all your ZWave devices. You just need to buy a ZWave controller and run it on a computer that’s always on.

The Hardware

You’ll need:

A Z-Wave compatible sensor (For the garage door detection, I used this tilt sensor)
(They are all Amazon affiliate links – i.e. you’ll be helping me out by buying the Amazon products through these links. Thanks in advance!)

Where do I click?

Configure > Programs > [select a group] > Actions (bottom right) > Add new program
After entering the program name, change the “Program Type” to C# Program

The Code

Copy and paste the following code into the C# program text area as explained here: https://youtu.be/aQLze9mWkYQ?t=1m57s

Including a photo from your IP camera as an attachment

Here’s the code to do it:

References

Check out the HomeGenie C# Helper Class References to see what else you can do!
https://genielabs.github.io/HomeGenie/api/ape/annotated.html