Enphase Solar monitoring

HOW?
By saying that you mean you generate more than you use?
Because I'm sure your rig cost at least 20K.
It's mathematically impossible to generate 20K with 15kW solar panels in 1year.

More than 20k.
But a great interest rate on a 12yr loan keeps my monthly payments less than what my electricity bill used to be, and I generate more than enough.

So I’m already saving each month as my utility bill is $0, I’ll save more as rates go up, and years 12+ Will be “free”

Ok, now I understand.
Your operational cash flow is positive.
If we don't count that you prepaid 12years of your electric bill with a loan.

I have a similar setup and I worried that I missed some government forgiveness program.
My cash flow in this project is pretty much that input is canceling output.
But 12 years loan I don't count as an asset.

Just installed this, simple, perfect. Thank you.

The loan is an overall asset if the payments allow me to pay out a substantially lower amount over that 12 years. During the loan's life I will save several thousand dollars. And that same loan allows me to save a minimum of $50,000+ after it is paid off. That is huge.

I love this app btw. I just came back to ask if anyone has been able to re-title their chart anything other than NULL.

If you ensure your device has the 'label' field set, this is the title on the graph.

HE console -> devices -> select your device -> Device label

1 Like

:slight_smile: :slight_smile: :slight_smile:

just don't say that on front of any accountants or you will blow their fuse.

If you are in the business of lending money,when you give out a loan, it would be an asset to you as you are expecting cash inflows in the form of principal as well as interest.

If you are a person who has taken a loan, in that case, to you the loan would be a liability since it represents an obligation to pay.

1 Like

I hope we never get to that point. I'm in Ramona and overproducing and have remaining credits from last year. I just added a mini split A/C to my workshop to suck up some of the excess. I have two solar systems, one 10 panel Enphase and then a 27 panel one on SolarEdge. My monitoring is messed up because they're separate Enphase is tracking the in/out so it always thinks there's an error as I'm exporting more than it generated.

Sorry if I missed this somewhere in the thread - my Enphase graph is up and running like a champ. I might just be a HE n00b, but is there a way to embedd the URL/Graph in a dashboard?

I have the same question. I got the graph running but I can't seem to copy and paste the link on the dashboard. It shows as a broken link.

My understanding is the dashboard have limit on size of html displayed, and this graph is much larger than that limit.

I also thought it does not render html as much as it can display devices attributes (with small html).

I'm no dashboard expert, so I defer to the experts.

I have the Enphase unit with the added consumption meter. This is basically amp clamps on the home power panel line inputs for whole house consumption. The data for consumption is available in the API. Can someone help me update the device driver to pull it?

1 Like

I just got my Enphase system running a month ago and also have the CTs for consumption monitoring. I was trying to figure out how to read it but didn't know there was a published API.

If someone doesn't beat me to it I will try to add it.

I have an Envoy and very much interested in seeing consumption data from my CTs. Hopefully someone with API and programming knowledge can add that to this driver.

I don't have access this monitoring device to test the api access....so hard to help without ability to test...

I don't know if my system has the CTs, they just finished installing it yesterday and I didn't see inside the main power panel. If I have them I'll see what I can do to incorporate those.

In the meantime, I actually came to this thread to offer a solution for the "First Day Startup" java errors that pop up when the system has no data for "Energy Yesterday" and/or "Energy Last 7 Days".

Replace:
def energyYesterday = dev.currentState("energy_yesterday").value
def efficiencyYesterday = dev.currentState("efficiency_yesterday").value

def energyLast7Days = dev.currentState("energy_last7days").value
def efficiencyLast7Days = dev.currentState("efficiency_last7days").value

With:
if (dev.currentState("energy_yesterday") != null){
    def energyYesterday = dev.currentState("energy_yesterday").value
    def efficiencyYesterday = dev.currentState("efficiency_yesterday").value
} else {
    def energyYesterday = 0
    def efficiencyYesterday = 0
}
if (dev.currentState("energy_last7days") != null){
    def energyLast7Days = dev.currentState("energy_last7days").value
    def efficiencyLast7Days = dev.currentState("efficiency_last7days").value
} else {
    def energyLast7Days = 0
    def efficiencyLast7Days = 0
}

This just makes those values report as 0 (zero) without throwing an error on a null attribute until there's something to report.

For anyone interested, I figured out how to get instantaneous consumption to show as an attribute within the device. If you type your envoys IP+"/production.json" You will see formatted instantaneous readings of production and consumption like below.
{"production":[{"type":"inverters","wNow":0,"whLifetime":17591228.707222223,"readingTime":1613963898,"activeCount":33},{"type":"eim","activeCount":1,"whLifetime":17352758.875,"wNow":-2.915,"readingTime":1613963898}],"consumption":[{"type":"eim","activeCount":1,"whLifetime":17383249.507,"wNow":3419.503,"readingTime":1613963898}]}

See below changes required to the drivers code:
Range was 2-59, change to 1 to get consumption readings every minute
input("pollingInterval", "number", title:"Polling Interval (min)",
defaultValue:"15", range: "1..59", required: true, displayDuringSetup: true)

Add attribute in the metadata section with the other attributes:
attribute "Current_Consumption", "number"

Replace the pulldata function with below :
void pullData() {
updateDNI()
if (!state.installationDate) {
debug "requesting installation date from Envoy…".toString()
sendHubCommand(new hubitat.device.HubAction([
method: "GET",
path: "/production?locale=en",
headers: [HOST:getHostAddress()]
],
state.dni,
[callback: installationDateCallback])
)
} else {
state.lastRequestType = (state.api == "HTML" ? "HTML" : "JSON API")
debug "requesting latest data from Envoy via ${state.lastRequestType}…".toString()
updateDNI()
sendHubCommand(new hubitat.device.HubAction([
method: "GET",
path: state.lastRequestType == "HTML" ? "/production?locale=en" : "/api/v1/production",
headers: [HOST:getHostAddress()]
],
state.dni,
[callback: dataCallback])
)
sendHubCommand(new hubitat.device.HubAction([
method: "GET",
path: state.lastRequestType == "HTML" ? "/production?locale=en" : "/production.json",
headers: [HOST:getHostAddress()]
],
state.dni,
[callback: dataCONSCallback])
)
}
}

** Add the callback function: **

void dataCONSCallback(hubitat.device.HubResponse msg) {
if (!state.mac || state.mac != msg.mac) {
state.mac = msg.mac
}
if (!state.api && state.lastRequestType != "HTML" && (msg.status != 200 || !msg.json)) {
debug "JSON API not available, falling back to HTML interface (Envoy responded with status code ${msg.status})".toString()
state.api = "HTML"
return
}
else if (!msg.body) {
log.error "${device.displayName} - no HTTP body found in '${message}'".toString()
return
}
def data = state.api == "HTML" ? parseHTMLProductionData(msg.body) : msg.json
state.lastDataCONS = data
debug "new CONSUMPTION data: ${data}".toString()
def wattsNow = data.consumption.get(0).wNow.toFloat()
state.CONSwattsNow = wattsNow
debug "new watts consumption data: ${wattsNow}".toString()
sendEvent(name: 'Current_Consumption', value: wattsNow, displayed: false)
}

EDITED 25MAR to fix formatting.

2 Likes

Just stopping by to say tanks to @nh.schottfam for porting my SmartThings implementation – I just received my Hubitat today and decided to see whether anything was already available before going down the rabbit hole of porting myself…

So excited to have my graphs back since they were no longer available when ST moved to the "new and 'improved' app"…

:clap:

3 Likes

So add this code to the driver in the areas indicated?