Integration with AT&T digital life

They do still charge me for the service, but once my contract is up I will cancel all but the alarm and camera service. I would be very interested in trying your project out, I have a server I could use.

Iā€™ve already setup a server, I can give you the code and instructions on how to setup yours. Itā€™s still under construction - the web page is not even there, I plan on making it available to the public, eventually, if AT&T does not have anything to argue :slight_smile:

I can also setup an account for you to test it. Iā€™ll private message you when I have set your account up if you want to test it. I need to limit the number of accounts that are up so that AT&T does not get upset with my IPā€¦

Regards,
Adrian

Okay, now that Iā€™ve got my Raspberry PI3, Iā€™ll work on developing a LAN version and once itā€™s stable enough Iā€™ll publish it. The one I built uses a cloud server and supports multiple users, making the individual setup a nightmare (requires LAMP, nodejs, pm2, etc.)

The main problem Iā€™m seeing with a LAN version is figuring out the hub IP / server IP. While the server IP can easily be fixed to a static IP, the hubā€™s canā€™t (unless the router allows static IP based on mac address). Iā€™ll figure something out so that they can find each other automatically.

Will update here when I have a working version.

Adrian

Ready for BETA!

Iā€™ve made progress with the stability of the app and server. Find all code here https://github.com/ady624/HomeCloudHub

Youā€™ll need a linux server running on the same network as the hub. Iā€™m using this on a Raspberry PI 3. Hope I didnā€™t miss any steps in the README.md, if I did, please let me know so that I can fix it.

Adrian

Do you think the will run fine on a Pi 2? I have one sitting around I can use.

I donā€™t see why it wouldnā€™t, as a matter of fact I am sure it does. It should run on anything that can run NodeJS and supports the ā€œrequestā€, ā€œnode-ssdpā€, and the ā€œcolorsā€ modules. Of all, only the ā€œrequestā€ module is absolutely required. The ā€œnode-ssdpā€ module is used for automatic discovery within the SmartApp (and I provided a way to manually enter the IP of the server) and the ā€œcolorsā€ module is used for nice looking logs which look b&w into the journalctl log anyways, if you decide to run it as a service, which you normally would.

If processing power was your concern, hereā€™s the output of the top command for the homecloudhub process:

top - 11:09:01 up 4 days, 12:33, 4 users, load average: 0.00, 0.01, 0.05
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.1 us, 0.0 sy, 0.0 ni, 99.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 948056 total, 784996 used, 163060 free, 203608 buffers
KiB Swap: 102396 total, 0 used, 102396 free. 346688 cached Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4875 homeclo+ 20 0 133352 35792 16316 S 0.0 3.8 0:04.24 node

Nothing, really :slight_smile:

So I have a mac I wanted to test on, just because itā€™s linux and already waiting to be used. When I run homecloudhub.js I get a token error. I looked at the script and I donā€™t see syntax errors, but maybe I am missing something.

./homecloudhub.js: line 2: syntax error near unexpected token '/usr/local/lib/node_modules'' ./homecloudhub.js: line 2: module.paths.push(ā€˜/usr/local/lib/node_modulesā€™);ā€™

What nodejs version are you running? Try commenting out that line, I only needed it when I ran it in systemctl - it stopped finding any node modules when run under a different user, even though nodejs modules were installed globally.

Youā€™ll find the same line in each of the three js files.

Why does it say line 2? Thatā€™s line 1ā€¦ do you have any character on the first line? Character encoding (i.e. UTF-8) special characters that nodejs doesnā€™t like? Try opening the file in vim/nano?

I commented out the first line and made the second line with changes to where node_modules was:

//module.paths.push(ā€˜/usr/lib/node_modulesā€™);
module.paths.push(ā€˜/usr/local/lib/node_modulesā€™);

vim and nano donā€™t show anything out of the ordinary.

If I remove the line all together the syntax error just moves down to the next line

./homecloudhub.js: line 3: syntax error near unexpected token (' ./homecloudhub.js: line 3: var app = new function () {ā€™

How did you create the file? Did you use TextEdit? It might have been saved in UTF-8 which normally contains two characters at the very beginning of the file to signal the encoding. Not visible in normal text editors. Try and save it as ASCII, not UTF-8. Or even better, use git to download the file. Or use https://github.com/ady624/HomeCloudHub/archive/master.zip to download the archive and drag the filesā€¦

Check this out too http://stackoverflow.com/questions/12719859/no-visible-cause-for-unexpected-token-illegal

This is how I got the files.

5.9.0

how are you running the file?
node homecloudhub.js ?

Why does it say line 3? When thatā€™s clearly line 2? Try and copy everything from line 2 onwards (exculde the commented line) and then recreate the file and paste the content?

It is ascii

homecloudhub.js: ASCII English text

Sorry I wasnā€™t I was running it like you would a standard shell ./homecloudhub.js

Running it the correct way seems to have worked. LOL

Oh :slight_smile: well, itā€™s a nodejs app, so it needs node to understand it. Bash wonā€™t.

Let me know how it goes.

Make sure you allow port 42457 through the firewall, if you have one (most likely).

Stands for hchls (home cloud hub local server) if you need to remember it :slight_smile:

So using port forwarding, would I forward traffic from 39500 to 42457 on the machine running Home Cloud Hub app?

No. The port 39500 is what my Hub is listening on. Yours may listen on a different port, you donā€™t have to worry about it. Once your SmartApp identifies the server, it will send it an init command in which it will instruct it at what IP and port to reply. The server will then save that into config/homecloudhub.json file. HomeCloudHub listens on port 42457. You just need to make sure that port is in your list of accepted incoming connections for TCP. Since both the hub and the hch server are on the same network, there is no port forwarding required. Is your Mac in the same network as your hub? The SmartApp uses HubAction to communicate directly with the LAN ā€œdeviceā€ - thatā€™s the server, so this is a requirement. Be in the same network.