[BETA RELEASE ROUND 2] Curb Energy Monitor Integration

smartapp_powermeter
dth_powermeter

(Justin H) #1

UPDATE 7/7/17
An all new version of this integration (now called Curb Connect) is now available. This version does not require an intermediate server and enables SmartThings to pull data directly from Curb. Installation instructions can be found on the GitHub page.


UPDATE 6/12/17
CurbBridge is back online! Give it a shot and report here how it goes. If you are starting from scratch, the instructions on the GitHub page are up to date. If you’re updating from the old system see the steps below.


UPDATE 4/29/17
Thanks to @Neil_Z from Curb for dropping in with some insider info. Looks like CurbBridge is not permanently dead, just hibernating. I’ll update here when I have a working version.


UPDATE 4/27/17
This integration project no longer works. Details below.


I’ve had a Curb Energy Monitor installed at my house since they were first released. I’ve loved the data provided, but been disappointed that there was no way to get the power consumption data into SmartThings. This is no longer true! I’ve recently achieved my goal with a new project: CurbBridge

If there are any brave developer-types out there who have a Curb and would like to try this project at home, give it a shot! The github link above should provide all the information necessary on how to set up the integration. It does require an independent server running Node.js to bridge the gap between the ST cloud and Curb cloud, but is otherwise pretty simple.

I’ve had the bridge running at home for 2-3 weeks now without a problem, but I’m sure someone will find some bugs. Please do let me know how it goes for you (good or bad) here.


Aeon Labs Z-Wave Home Energy Meter - DSB09104 V.1
Any compatible smart power outlets that do historical energy monitoring?
(Devesh Batra) #2

Thanks, I have curb installed for almost a year now.

will try it tomorrow

I do have 2 curb modules with over 30 sensors. This should be interesting


(Justin H) #3

As of an hour ago, there was no chance my integration would work with two hubs. I’ve just made a first attempt at supporting multiple, so make sure you get the latest from GitHub. The Curb documentation isn’t very clear, so I’ll be surprised if it works right away. If you do have trouble I’ll need to have a look at the console output from the node.js program (most importantly the block of JSON that starts with “Curb Profile:”)

Good luck and thanks for being a guinea pig!


(Devesh Batra) #4

EDIT: reinstalled the code… works now

Installed the smartapp and node.js in an ubuntu VM…
paired the two together by providing the SmartAPP clientID, secret…

Have over 30 probes and they all showed up… Only issue is that the ones from the second unit show a negative energy draw

Like Study -8W, … probes on uint 1 show a positive energy draw … SunRoom 11W…

thanks


(Justin H) #5

Awesome! Lots of good progress! Can you post (or PM me) the console output from the node.js program? I’d like to have a look at your profile to see what’s going on with the negative power measurements. There are a couple of different ways Curb expresses that a sensor should be flipped and I’m guessing I’m not handling them all correctly. Please note that without your curb password, the information in your profile will not give me access to any of your usage data.


(Devesh Batra) #6

sending you the PM now

Also, the app did not parse 2 of my probe names correctly and they were bought over as unknown III,

the names have 3 words (with spaces) each, if that helps


(Devesh Batra) #7

Justin, thanks the latest updates seems to have fixed the issues with -ve temp display on some of the probes…


(Justin H) #8

Thanks to @BatraD for sharing his installation info to help me debug the multiple-hubs issues. As of now, the version on GitHub stands a good chance at working for any number of Curb hubs you happen to have installed at your house. I believe you will start to hit the ST rate-limits at 4 or 5 hubs, but I’ll be very surprised if anyone does!

Additionally, I have added a default icon and enabled icon switching for the power meter devices. This means you can select an icon for each meter that matches its application.


(Devesh Batra) #9

Justin,

thanks for your efforts… this was a big piece of the puzzle missing when i bought the curb units, i.e. getting the data into ST to manage triggers when certain circuits are used for long (like bath lights left on, dishwasher or washer done…)…

Installed the latest DH, do see that the icon is behind the numbers when you open each device
Could you use a different color for the numbers, like green for positive and red for negative (for folks that have a solar or generator being managed) ?

Thanks


(Devesh Batra) #10

Justin,

anyway to save the CientID/secret and curb credentials in a file ? if i restart the ubuntu PC, i have to retype my credentials everytime…

thanks


(Justin H) #11

This is definitely a feature I’d like to add. Overall I’d really like to make the whole thing more stateful so that if the server is running you can go to the browser page and it will give you stats, etc.

Does your browser not remember the form entries? In chromium on the RPi, it remembers everything except the curb password field, so I just select the field and hit the down arrow. I also have my ST credentials saved in the chrome password manager so that part auto-populates as well.


(Devesh Batra) #12

Justin, I have to also reauthenticate to ST every other time before I authenticate to curb.

I know it remembers everything except the ST and Curb passwords, but a pain to go back and type it in all the time. Thanks


(Justin H) #13

I’ve just pushed a change to the server which will store the access tokens in a file (CurbBridgeData.json) so you can freely stop/start the server without re-authenticating. If a token stops working (not sure if they expire…) then just fire up the browser and re-authenticate. The new tokens will be saved in place of the old.

No changes to the ST code, so just pull from the git repo on the machine that runs the node.js code.

Give it a try, @BatraD


(Devesh Batra) #14

Justin,

thanks… Deleted my local folder and performed a new Git Clone

When I run the install, its taking over 30 min to build and am Getting the following error

npm WARN EPACKAGEJSON curbbridge@1.0.0 No description
npm WARN EPACKAGEJSON curbbridge@1.0.0 No repository field.

also, when i start the server, and try to login to Curb, i’m getting the following error
Curb onConnect
Logging in to Curb
Something Went Wrong…


(Justin H) #15

Devesh,
Sounds like something is fishy… I just made a new clone and everything ran from scratch without a problem… The install step only takes about 15 seconds for me as well. It sounds like that might be the source of the problems.

I did see the warnings you mentioned, but they should not have caused a problem. Either way, I just pushed a change that fixes the warnings.

I also added some more useful print outs near the error you were encountering. Update and run it again and let me know what it does.

Another thing worth noting is that I have found some times where the Curb cloud is not behaving. If you continue to have problems, try logging into the normal curb portal and make sure the live data is available there.


(Justin H) #16

I just updated the device handler to render the power consumption in color. I just guessed at what would be a useful power to color mapping, so feedback is appreciated. This also fixes a bug where the power consumption appears on top of the icon when viewed inside the device page.


(Mark Kaplan) #17

I successfully got his working with my 2 Curb’s but 2 things I realized.

SmartThings doesn’t really need or can utilize the sampling rate from the app. I think it’s slowing my system (could be my imagination) ActionTiles nor Simple Device Viewer can’t display the data in real time.
Would it be possible to adjust the data acquisition rate? 1 min might be a good start.

Could the code be modified to work with www.initialstate.com ? I think that’s a better platform to analyze the data.

Very cool. Thanks for posting


(Justin H) #18

Glad to hear you got it up and running!

I originally limited the updates to 5 second intervals, but switched to 1 second since I’ve built a “dashboard” for my house with a needle gauge showing live power consumption and its much more satisfying to watch with a higher sample rate. I agree that most people don’t need this, so I’ve added a setting to the smartapp that allows you to select a sample period. After pulling from github, you will be able to go to the smartapp preferences and dial in your preferred period.

initialstate looks pretty cool! Since the CurbBridge generates ST events (like every other device), I’d guess you would be able to follow the instructions in this thread to shuffle the data off to initialstate. It should be possible to create a direct curb/initialstate connection with a different (but similar) bridge application like I’ve created if you don’t want ST involved at all, but I’ll leave that for the next dev who gets excited about initialstate :slight_smile:


(Mark Kaplan) #19

a few of my probes are showing up as negative. what woulds you need to figure out the issue? I saw mention of this issue in a past post.


(Justin H) #20

When the negative consumption issue was found before, the issue was related to using the bridge with multiple hubs. I believe I have corrected that bug. A few questions:

  • Are you using the latest version of the bridge from GitHub?
  • How many curbs do you have?
  • Do the sensors report positive values on the curb portal?

To investigate further, I’ll want to have a look at the console output from the node.js program during authentication. If you could pm me the output up until the data starts streaming that would be helpful.