Use Raspberry PI’s GPIO in HomeSeer3

I recently purchased a Raspberry Pi 2 Model B with the aim of making it my new HomeSeer3 ‘box’. Previously I ran HS3 in a Windows 7 virtual machine on an ESXI server. However, that server had to be repurposed for my security cam system (using BlueIris). Furthermore, I had an Arduino (and ofcourse the Arduino HS3 plugin) in the utility closet to interface with my alarm system and automated gate. The final goal was to have everything combined in to 1 system, so using the GPIO of the RPI (running HS3) to replace the Arduino.

rmasonjr over at the HomeSeer message board created a Raspbian image which can easily be flashed to the memory card by following the official HS guide. There’s also a thread about how to install the HS3 software on a RPI.

To have the status of the GPIO pins in HomeSeer (and to be able to control them from within HomeSeer), I created a python script using the RPi.GPIO library.
The script works like this:

  • It connects to the ASCII command interface of HS3 to get ‘realtime’ status changes of devices
  • If the status of a ‘monitored’ (virtual) device has changed, the matching GPIO output pin will be updated accordingly
  • When a monitored GPIO (digital) input pin changes state, the matching (virtual) device in HS3 will be updated to reflect the state

Configuration is done in the script itself, check lines 24-35. The INPUT, INPUT_PULLUP, INPUT_PULLDOWN and OUTPUT configuration parameters are arrays of tuples with 2 values.
The first element of the tuple is the pin number on the RPI, the second is the deviceId of the device in HomeSeer.

Example:

  • GPIO input pin 20 -> HS3 device 59
  • GPIO input pin 21 -> HS3 device 60
  • GPIO output pin 12 -> HS3 device 61

 

 

8 thoughts on “Use Raspberry PI’s GPIO in HomeSeer3

  1. Question for you can this be pulled off on a beaglebone black. I have a pi2 and a beaglebone black. Im trying to see if i can get all this to work on a beaglebone as it has more GPIOs and functions

  2. Tried to run but received an error any help is welcome.

    Traceback (most recent call last):
    File “./hspio.py”, line 20, in
    from enum import Enum
    ImportError: No module named enum

  3. Hi,
    could this be installed on a remote Raspberry to connect to the HS3 server (HS3 on Raspberry)?
    Does it require HS3 also on the remote Raspberry? Would mono be required?

    The first error is that Python can’t find Enum.

    Thank in advance,

    Ulrich

  4. ok, the issue with enum is solved; installed the packege.
    But now I got the problem that it can’t connect to the HS3 server. I used the port 11000 and my HS3 cridentials??
    ./a.py
    ***************************************************************************************
    * THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
    * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
    * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
    * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION *
    * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE *
    * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
    ***************************************************************************************

    Connecting to 192.168.2.4:11000
    Disconnected
    Connecting to 192.168.2.4:11000
    Logging in …
    Disconnected

Leave a Reply

Your email address will not be published. Required fields are marked *