Cloud based Smart Home using Pubnub

BobS0327

Active Member
I've been "doodling" with a smart home project for a while.  Right now, I'm leaning towards using Pubnub https://www.pubnub.com/solutions/home-automation-and-machine-signaling/   It's a cloud based Infrastructure As A Service (IAAS).  I'm impressed with the Pubnub claims that their SLA is 99.99%.  It's essentially a redundant, distributed system which essentially guarantees a reliable, redundant connection for a smart home application.  Latency is about 50 milliseconds.  So, it's not a "slow" system.  Pubnub is a global real time Data Stream Network (DSN) which IMHO is ideal for smart home apps etc.
 
Now, the other half of the project would be to use Heroku which is a Platform As A Service (PAAS) as my app "engine".  The Smart Home app would be a Heroku access enabled github project.  Link to Heroku https://www.heroku.com/
 
In a nutshell, Heroku would be the "brains" and Pubnub would be the communication medium between all the diverse devices (endpoints) in my home.  These endpoints would range from UPB switches, zigbee locks, Zwave switches, desktop PC's, tablets, cell phones.  IOW, anthing that can be connected to the internet would be  endpoint for my Pubnub/Heroku smart home app.
 
I've posted this to get some input on my anticipated project since there are a few alternatives to Pubnub and Heroku.  Hopefully, someone else is working on a similar project and can provide some insight.
 
I'm currently implementing Pubnub on my upbServer project and will eventually enable it on Heroku.  This will allow anyone with a Heroku/Pubnub account to deploy the app.  Both Pubnub and Heroku have free acounts.
 
Finally, here's a link to an entertaining video from the founder and CTO of Pubnub https://www.youtube.com/watch?v=HEz_UObB6PU
 
 
 
I've not played with Heroku or PubNub yet but I have been playing with local node.js/node-red. Mosquitto and various programs and scripts. Also I just started adding in Cloud services, I hope to try IFTTT later this spring. I just setup a bridge to Cloudmqtt and Adafruit.io. At the moment I'm not trusting the cloud though I am experimenting with it. So let's skip those concerns for now as eventually we'll either have resolved them or will ignore them.
 
I recall seeing someone, on Youtube, from Sweden, Norway or Finland who moved their home automation into the cloud because they couldn't get stable electrical at home. It was costing him too much to keep a PC. I don't see myself giving up having a good chunk of the intelligence in the home though I can see certain benefits to the Cloud. I've got SmartThings so I'm also learning the gotchas. It's their software so buggy libraries affect a lot of people and I end up spending a lot of time describing my finds. In other services (ISP) to people who have no clue (Mordac the Preventer of Information Services).
 
PubNub's pricing is really strange. I can easily see exceeding 100 device (per day) and would have to jump to the $150/month. I already have 77 topics and only a few devices. Some devices had more than 1 topic.
 
At the moment I find that the Arduino and Pi (and similar devices) are the greatest boon to HA. I can shoehorn one of these devices in between devices and services and add the missing features. If I'm dealing with remote locations (I don't have any other than a few experiments at the Maker Space) then I can see a cloud based service like CloudMQTT useful.
 
I'm also working on getting Node-Red on OpenShift. There are several issues involved there. One is actually installing it and the other securing it. I think I have the security part working, I'll find out more later.
 
Yea, I'm new to the “cloud computing” paradigm and it's overwhelming as far as the number of providers and the variety of IT services available. Spending most of my time just poring thru documentation/tutorials etc. Cloud computing is definitely a major learning experience.
 
I was swayed to go to cloud computing by the last CES show. Anyone who has attended that show will tell you that cloud computing seemed to be the major theme of the show. It was “cloud this, cloud that” etc.
 
My home automation project will never hit the 100 devices (ip addresses). So, I'll be able to use the free version. Same thing with Heroku, I'll never exceed their max limits. As far as I'm concerned “free” is good.
 
I definitely agree the single board computers are a boon to home automation. I currently use a PRI2 as a back end server for UPB lighting control. It works great. Next update to my project will be Pubnub implementation which means the RPI2 will also “translate” between Pubnub and the UPB protocol.
 
Openshift appears to be an Red Hat's alternative to Heroku. Just goes to prove that more and more organizations are getting involved with cloud computing. IMHO, it'll probably get to the point where so many options will be available making it nearly impossible to select any one particular option.
 
BTW, Pubnub also supports MQTT. Here's a link to Pubnub MQTT documentation https://www.pubnub.com/blog/2014-08-14-what-is-mqtt-use-cases/
 
 
 
 
PubNub's pricing is really strange. I can easily see exceeding 100 device (per day) and would have to jump to the $150/month. I already have 77 topics and only a few devices. Some devices had more than 1 topic.
 
 
I think I've just had a epiphany of sorts.  I'm currently experimenting with Pubnub using six devices.  Each device has it's own unique local IP address.  I initially assumed each local device would be added to the Pubnub device count for billing purposes.  But when I checked my Pubnub billing statement, it indicated that I was ONLY using ONE device.  My assumption here is that Pubnub bases device count on WAN IP addresses not locally assigned addresses.  IOW, you can have several hundred local devices using Pubnub but if they are using the same WAN IP address, they will all show up as ONE device.
 
Currently, I'm doing a lot of Pubnub testing for my smart home project. My Pubnub account indicates that I'm generating approximately 8,000 messages  per day.  This is high because of my automated testing procedures.  I estimate my daily messages will be in the 2 to 3K area  when the project is completed.  Thus, I'm well below the daily cap of 33,333 mesages (1M messages per month).
 
So, it looks like it'll never cost me to use Pubnub.
 
 
 
 
 
 
BobS0327 said:
So, it looks like it'll never cost me to use Pubnub.
 
You kind of have to ask yourself, why would someone make high availability servers available to a large number of people for free on an ongoing basis? Like the other lower end solutions out there, they are going to either have to make money from it eventually or it's not going to work. And if your needs are basically average, that would mean that the vast bulk of their customers probably wouldn't pay them anything. That's not a very viable business plan long term.
 
BobS0327 said:
So, it looks like it'll never cost me to use Pubnub.
You also are putting your home control at the whims of an outside company.  If Leviton or ELK discontinue their panels tomorrow, there is no reason to believe that either of these systems can't continue running for 20 more years.  If Pubnub folds tomorrow, how long will your be running? 
 
I love it when companies boast: "No Long term contracts required."  That is code for "we can close up tomorrow, and you can't sue us."

 
 
I think Pubnub is using the little guy like myself as a marketing tool. I'm assuming that they believe that all us little guys are associated with IT in one way or another since we can implement Pubnub in our personal projects. If we little guys have a favorable opinion of Pubnub, we'll probably “spread the word” at our respective shops. So, we little guys are really a Pubnub marketing tool rather than a source of revenue.
 
Competition is getting stiff in the cloud services area since everyone now realizes that there's some serious money to be made in that area. Thus, it appears to me that Pubnub is trying to utilize any form of marketing including using us little guys as “evangelists” to increase market share.
 
Pubnub's revenue really comes from the BIG guys such as Coke, CBS, McDonalds, Yahoo etc. IBM just selected Pubnub for use as their global data streaming network in their BlueMix PAAS project, a cloud development project.  A list of Pubnub's BIG customers can be found at this link https://www.pubnub.com/customers/
 
If Pubnub were to fold tomorrow, it would take me about four hours to move over to another IAAS service provider such as PushBullet, Pusher etc. All these IAAS service providers use essentially the same publish/subcribe methodology. Migration is a “piece of cake” since I now have a solid understanding of the methodology. I think I would spend most of that time trying to determine which service provider to use.
 
EDIT
 
IBM invested over a BILLION dollars in the BlueMix cloud project.  So, I guess they must have some confidence in the future of Pubhub.
 
I'm also working on getting Node-Red on OpenShift
 
@linuxha
 
How do you like Openshift?  The reason I ask is that I'm near the point where I'll have to select a PAAS. I was considering Heroku but the free tier requires that the dynos (front end processes) have to be spun down (put in sleep mode) for 6 hours out of a 24 hour period.  So, I'll probably end up using a paid tier costing anywhere from $7 to $50 per month in order to get 24 hour uptime.
 
I briefly reviewed Openshift and it appears to have a similar fee schedule.  I'm assuming the Openshift lingo for major/minor gears are the equivalent of Heroku dynos.  IOW, they are front end processes.   Thus, the free Openshift tier requires your gears to idle for set amount of time.
 
My conundrum is that I'm using a blazingly fast data stream network (Pubnub) to access a PAAS which may be in sleep mode.  It seems to me that there would be a lag time if the dyno had to be spun up (awakened) to process all the messages (transactions).  This is akin to having a Windows desktop in sleep mode and then sending it a flurry of messages.  It'll take the desktop a few seconds to wake up  and start processing the messages.
 
Unfortunately, I do not yet have any actual "hands on" experience with any PAAS.  I just don't want to select a PAAS and then after the fact determine it wasn't the best solution for my 24/7 smart home project.
 
I'm nearly finished with implementing Pubnub in my project and wil probably upload it to github within a week. So, now I have to start thinking about a PAAS which is the brains and brawn of the project.  So, any insight would be greatly appreciated.
 
At $50/month, a year's worth would buy you a nice locally based automation software solution, which is guaranteed never to have any network based down time.
 
Dean Roddey said:
At $50/month, a year's worth would buy you a nice locally based automation software solution, which is guaranteed never to have any network based down time.
My guess is younger people without much home automation experience tend to believe that these cloud solutions are the answer, but lets wait a few years and hear back after they actually have had a chance to live with them.
 
BobS0327 said:
@linuxha
 
How do you like Openshift?  The reason I ask is that I'm near the point where I'll have to select a PAAS. I was considering Heroku but the free tier requires that the dynos (front end processes) have to be spun down (put in sleep mode) for 6 hours out of a 24 hour period.  So, I'll probably end up using a paid tier costing anywhere from $7 to $50 per month in order to get 24 hour uptime.
 
I have no clue, my attempts to get node-red working on Openshift ran into a lot of difficulty.  I still need to do a lot of work on that as nod-red isn't a standard application on Openshift. I also need to secure it so I was spending a lot of time working on both. I hope to get back to that in a few weeks.
 
I wasn't attempting to do anything more than learn about using the various services. I have a Heroku account also. I've found quite a few Open Source projects use these services with things like Docker to perform continuous release testing. Another thing on my growing todo list.
 
Dean Roddey said:
At $50/month, a year's worth would buy you a nice locally based automation software solution, which is guaranteed never to have any network based down time.
Well, I really don't need a locally based software solution since I will need to access the system from several remote sites. “locally” implies that I'll never access it from remote sites via the internet, ergo, no network downtime. “locally based automation software” also implies that I'll have this software installed on a desktop PC or possibly a back end server. In this case, there are other issues to contend with. For example, a hard drive crash, a power supply failure, even the dreaded MS updates to the Windows OS which may put the hardware in an unstable state. Not to mention that the automation software may be defective causing the whole system to fail.
 
OTOH, using a cloud based solution such as Heroku or Blue Mix, I would immediately be notified of any issues with my software. For example, software on Heroku would become unstable, the dyno would spin down (deactivate) my software and I would receive a notice to that effect. Now I can access my github repo from anywhere in the world, identify and fix the problem by reviewing the Heroku logs, redeploy the fixed app to Heroku which will spin up the dyno (reactivate the fixed app).
 
To remotely resolve an automation software problem would be difficult or even impossible to do. If it's a “local” only app, well I'm just plain out of luck. If it's a network connected app, I may be able to resolve the problem if the hardware is stable enough for me to remotely connect to it. Now this is assuming that I somehow become aware of the issues.
 
One thing I've learned about available cloud servers is that I really have to “shop around” for the best deal. IBM's BlueMix now offers a free “Hobbyist” tier which offers 24/7 availability. The catch is, I can't exceed 300 messages (transactions) per SECOND. Otherwise, I go into the next fee tier of $24.00 a month. I seriously doubt I will exceed that threshold with my smarthome project. Also, all Bluemix tiers are at a Sevice Level Agreement (SLA) of 99.99%
 
A lot of assumptions there, and I'm pretty sure all of them are misplaced....
 
1. If you have a network outage, then you are no worse off than with a cloud based system. So that's a wash either way
2. The odds of a solid state PC dying are so slim that it's much less likely than there being network issues. How many times has your internet gone out vs. how many times have you had a PC die? Almost every person will have had many, many times more internet issues than PCs (which are never even used directly) spontaneously dying.
3. You are assuming that they won't have issues either, which is probably unfounded optimism. Look at SmartThings as an example. They've had various failures on their side, which means you can't even use it if you are at home.
4. Turn off Windows update. Only install them when you choose to. Since an automation server is not used to connect to the outside world other than a few things like a weather data service, it doesn't need the sorts of constant updates that actively used client machines do.
5. If defective software is a concern, then you shouldn't be using any system. It's not like their product isn't software, plus all the extra points of potential failure of running it remotely.
6. And there's no way they are going to warn you of ahead of time about bugs that they don't know they have. That's the nature of bugs. 
7. With remote desktop you have complete access to the whole machine, much more than you'd have using a cloud based system, since you can use all of the tools available on the machine to diagnose issues. 
 
ano said:
My guess is younger people without much home automation experience tend to believe that these cloud solutions are the answer, but lets wait a few years and hear back after they actually have had a chance to live with them.
 
 
I'm beginning to think that this cloud issue is more of a generational issue than a technical issue.
 
It's like the baby boomers versus the GenXers. The BabyBoomers want to live in the 20th century. That is, use a Digital Multi meter and screwdriver to attach a foreign sensor to a HA sytem and configure it using some draconian protocol via a Windows desktop. Whereas the GenXers want to use JSON, RESTful, subcribe/publish technologies to install and configure sensors etc.
 
Or maybe it's the following scenario..
 
BB: “I just turned my living room lights on using my BlackBerry HA app. That's Groovy!!!”
 
GenXer: I just had an intelligent conversation with Alexa, my smart home controller on the status of my home. That's PHAT!!!”
 
There's absolutely nothing wrong with being a neophobe. My personal preference is to adapt emerging technologies that appear to be the future of technology. In this case, cloud technologies. If folks didn't adapt to innovative technologies, I believe we'd still be driving Model T's.
 
linuxha said:
I have no clue, my attempts to get node-red working on Openshift ran into a lot of difficulty.  I still need to do a lot of work on that as nod-red isn't a standard application on Openshift. I also need to secure it so I was spending a lot of time working on both. I hope to get back to that in a few weeks.
 
I wasn't attempting to do anything more than learn about using the various services. I have a Heroku account also. I've found quite a few Open Source projects use these services with things like Docker to perform continuous release testing. Another thing on my growing todo list.
Thanx.  In about three weeks, I'll be at a point where I have to commit to one of the PAAS's.  I now like IBM's BlueMix since it has a totally free "hobbyist" tier.  To exceed this tier, I'll have to do more than 300 messages (transactions) a SECOND.  I honestly don't do that much in a day.
 
Also, it's my understanding the IBM just recently partnered with github to provide github enterprises to ALL tiers free of charge.  This will make deploying a github app to Bluemix very easy.
 
Back
Top