Coder Social home page Coder Social logo

homecloudhub's Introduction

Home Cloud Hub

HomeCloudHub is a lightweight NodeJS server you can run on your home network that provides real time integration of your SmartThings Hub with the AT&T Digital Life alarm system and almost real time integration with MyQ. This is done via a local LAN connection between your hub and a linux machine running your HomeCloudHub server.

Community

If you're having any issues, feel free to open issues and PRs here.

Installation

Note: There are two parts to the installation:

  • Install the SmartApp and its associated Device Handlers
  • Install the HomeCloudHub NodeJS server

Installing the SmartApp and its associated Device Handlers

Go to your SmartThings IDE and go to your SmartApps. Click on Settings and add a new repository with owner ady624, name HomeCloudHub and branch master. Click Ok.

Click on the Update from Repo button and select the HomeCloudHub repo. Select the HomeCloudHub application and install it. Do the same for the Device Handlers, selecting whichever devices you plan on using. If your device is not on the list, let me know so I can add it.

Installing the HomeCloudHub NodeJS server

Install NodeJS. You can follow these instructions to install Node JS 4.x or 5.x. I have developed and tested this using NodeJs v5.7.1.

On your linux machine, create a folder /var/node (if it doesn't exist yet). Download the homecloudhub.local folder onto your linux machine. I use this on a Raspberry Pi running Raspbian. Install necessary modules:

sudo npm install -g request
sudo npm install -g colors
sudo npm install -g node-ssdp

NOTE: If your npm modules are installed in a different location than /usr/lib/node_modules, and you plan on running this as a system service, then please change each of the javascript files' first line to reflect the correct path.

Change

module.paths.push('/usr/lib/node_modules');

to

module.paths.push('<your node modules path goes here>');

Test the application:

    node /var/node/homecloudhub.local/homecloudhub.js

#Making the app a bash executable (optional)

Create the file /usr/bin/homecloudhub with this content:

#!/usr/bin/env node
//
// This executable sets up the environment and runs the HomeCloudHub.
//

'use strict';
process.title = 'homecloudhub';

// Run HomeCloudHub
require('/var/node/homecloudhub.local/homecloudhub.js');

Give it execute rights:

sudo chmod 755 /usr/bin/homecloudhub

#Testing your server

VERY IMPORTANT: If you have a firewall installed, make sure you allow inbound connections to port 42457.

To run the server, run either

    node /var/node/homecloudhub.local/homecloudhub.js

or, alternatively, if you made an executable at the optional step above:

    homecloudhub

With homecloudhub running, go to your SmartThings app and go to Marketplace. Scroll down to My Apps and click on the HomeCloudHub app. Select the local server method and it should automatically detect your server. If it doesn't, you can enter the IP manually, but it should detect it. Click next and enter your AT&T Digital Life credentials. These will be stored into the SmartApp settings collection, if security is a concern. Click Done to finish installing the application. At this point, within a few seconds, your Things should be automatically populated based on the Device Handlers you elected to install.

Installing homecloudhub as a system service

Create a new system username to run homecloudhub under:

sudo useradd --system homecloudhub

VERY IMPORTANT Make sure the new user has read/write access to configuration file!

    sudo chown homecloudhub:homecloudhub /var/node/homecloudhub.local/config/homecloudhub.json 

NOTE: Some Operating Systems may require the .service extension within the systemd ecosystem. CentOS/RedHat seems to be one of them, according to Keo (thank you). Debian seems to not need it.

Create the /etc/default/homecloudhub file with this content:

# Defaults / Configuration options for homecloudhub

# If you uncomment the following line, homecloudhub will log more.
# You can display this via systemd's journalctl: journalctl -f -u homecloudhub
# DEBUG=*

Create the /etc/systemd/system/homecloudhub file with this content:

[Unit]
Description=Node.js Local Home Cloud Hub Server
After=syslog.target

[Service]
Type=simple
User=homecloudhub
EnvironmentFile=/etc/default/homecloudhub
ExecStart=/usr/bin/node /var/node/homecloudhub.local/homecloudhub.js
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target

Setup the systemctl service by running:

sudo systemctl daemon-reload
sudo systemctl enable homecloudhub
sudo systemctl start homecloudhub

Check the service status:

sudo systemctl status homecloudhub

Enjoy :)

homecloudhub's People

Contributors

ady624 avatar brbeaird avatar deadmoo83 avatar pizzinini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homecloudhub's Issues

MyQ integration not working

From SmartThings IDE log:

ac695610-446c-47d6-8b01-be3d52f10d4a 9:27:01 PM: error groovy.lang.MissingMethodException: No signature of method: groovy.util.slurpersupport.NodeChildren.isArray() is applicable for argument types: () values: []
Possible solutions: isEmpty(), every()
ac695610-446c-47d6-8b01-be3d52f10d4a 9:27:01 PM: info Successfully connected to MyQ
ac695610-446c-47d6-8b01-be3d52f10d4a 9:27:01 PM: info Logging in to MyQ...
ac695610-446c-47d6-8b01-be3d52f10d4a 9:27:01 PM: info Successfully connected to AT&T Digital Life
ac695610-446c-47d6-8b01-be3d52f10d4a 9:27:00 PM: info Logging in to AT&T Digital Life...
ac6

Digital Life integration stopped working

Two weeks ago there appears to have been an update with the Digital Life API and if you try to start the service it tells you " Sorry, the credentials you provided for Digital Life are invalid." I reset my password several times and confirmed by logging into my actual account and my username and password are correct. I know I might be the last of the users but would love to have this continue working if possible. Thank you

On/Off States

Hello, I was wondering if it's possible to make the on/off state for the system an armed instant/disarmed state. I'm trying to use this with SIRI, and while I can get it to recognize the system, it can't toggle anything.

Error: read ECONNRESET

I have had the Homecloudhub integrations for the past two years and last night through this morning, I am getting an error stating that "[homecloudhub] Failed sending event: Error: read ECONNRESET and then it stops the node service and "throw er; //Unhandled 'error' event. I have tried to restart the service and now it is throwing error: Error read ECONNRESET at _errnoException (util.js:1024:11) at TCP.onread (net.js:615:25)

Addition Devices

First of all, thanks for developing this.

Would it be possible to add additional device handlers for AT&T's Temp/Water sensors, outdoor camera?

I also have a Yale lock pair with my AT&T DL system. I know SmartThings can pair with this directly, but would it be possible to add a handler for this via the AT&T DL system as well?

test

Nothing to see here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.