Coder Social home page Coder Social logo

dlmcpaul / enphasecollector Goto Github PK

View Code? Open in Web Editor NEW
68.0 5.0 19.0 3.39 MB

Enphase Solar Metrics Collector

License: Mozilla Public License 2.0

Java 84.20% Dockerfile 0.83% HTML 6.30% CSS 0.41% JavaScript 8.25%
solar enphase enphase-api bulma influxdb pvoutput thymeleaf java prometheus enphase-envoy

enphasecollector's Introduction

EnphaseCollector

mpl2 Thymeleaf

Support for envoy firmware >= D7.0.88

From around V7 of the envoy firmware the security model for API access was changed. This is obviously problematic for software such as mine that relies on local access to the API's

While it is entirely up to Enphase as to how they develop their software I see a number of issues with their new security model

  • It links your enphase community account to the token needed to access the API (If you don't want an account or enphase suspends your account you will lose access)
  • It does not look to be based on a standard authentication mechanism such as OAuth (You should never write your own authentication protocol)
  • It is currently broken in a number of ways and will reduce the security of your envoy device (I will not list the issues here)

The current release does support V7 firmware, but you will either need to manage the token generation yourself or supply your enphase web user & password details. SSL over HTTP is also a requirement so the port will need to be set to 443

EnphaseCollector uses the undocumented API in the Envoy device to collect individual solar panel data and upload to an influx db, pvoutput site or just as an internal view

Can be run as a java application or using the docker image

Main Page Weekly History Tab Questions and Answers Tab
Screenshot Screenshot Screenshot

If using the jar file you will need a Java 21 that you can get from https://adoptium.net/

Example #1 with default internal website (assuming jar is named enphasecollector-development-SNAPSHOT.jar which is the default build artifact)

java -jar enphasecollector-development-SNAPSHOT.jar

where the application will attempt to guess the envoy location and password.

Example #2 when envoy.local is not resolved, and you need to specify the ip address and the password cannot be guessed.

java -jar enphasecollector-DEV.jar --envoy.controller.host=envoy-ip --envoy.controller.password=envoy-password

where envoy-ip is the ip address of your envoy controller and envoy-password is likely to be the last 6 characters of your envoy controller serial number

Example #3 run spring boot locally with debugger support connecting to enphase to pull down a token

mvn spring-boot:run -Dspring-boot.run.arguments="--envoy.controller.host=<PRIVATE IP OF ENVOY> --envoy.controller.port=443 --envoy.enphaseWebUser=<USER> --envoy.enphaseWebPassword=<PASSWORD>" -Dspring-boot.run.jvmArguments="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"

If using the docker image

Example #1 using influxDB for storage

docker run \
-e TZ=your-timezone \
-e ENVOY_CONTROLLER_PASSWORD=envoy-password \
-e ENVOY_CONTROLLER_HOST=envoy-ip \
-e ENVOY_INFLUXDBRESOURCE_HOST=influxdb-ip \
-e ENVOY_INFLUXDBRESOURCE_PORT=influxdb-port \
-e SPRING_PROFILES_ACTIVE=influxdb \
dlmcpaul/enphasecollector

where envoy-password is likely to be the last 6 characters of your envoy controller serial number

Example #2 in standalone mode with internal database storage

docker run \
-e TZ=your-timezone \
-e ENVOY_CONTROLLER_PASSWORD=envoy-password \
-e ENVOY_CONTROLLER_HOST=envoy-ip \
-p 8080:8080 \
dlmcpaul/enphasecollector

and a web page available at http://localhost:8080/solar and looks like this

You can also link the internal database to an external file system, so the database kept on upgrade of the image using the mount point /internal_db

docker run \
-e TZ=your-timezone \
-e ENVOY_CONTROLLER_PASSWORD=envoy-password \
-e ENVOY_CONTROLLER_HOST=envoy-ip \
-p 8080:8080 \
--mount target=/internal_db,source=host_path
dlmcpaul/enphasecollector

and replace host_path with the path on your host machine where you want to store the data.

Example #3 sending data to pvoutput.

docker run \
-e TZ=your-timezone \
-e ENVOY_CONTROLLER_PASSWORD=envoy-password \
-e ENVOY_CONTROLLER_HOST=envoy-ip \
-e ENVOY_PVOUTPUTRESOURCE_SYSTEMID=your-system-id \
-e ENVOY_PVOUTPUTRESOURCE_KEY=your-key \
-e SPRING_PROFILES_ACTIVE=pvoutput \
dlmcpaul/enphasecollector

Your timezone is something like Australia/Sydney or similar

Example #4 sending data to mqtt.

docker run \
-e TZ=your-timezone \
-e ENVOY_CONTROLLER_PASSWORD=envoy-password \
-e ENVOY_CONTROLLER_HOST=envoy-ip \
-e ENVOY_MQQTRESOURCE_HOST=mqqt-ip \
-e ENVOY_MQQTRESOURCE_PORT=mqqt-port \
-e ENVOY_MQQTRESOURCE_TOPIC=topic-name \
-e ENVOY_MQQTRESOURCE_PUBLISHERID=publisher-id \
-e SPRING_PROFILES_ACTIVE=mqtt \
dlmcpaul/enphasecollector

if ENVOY_MQQTRESOURCE_PUBLISHERID is not provided a random value will be chosen

Note the spelling mistake in the environment variables (MQQT instead of MQTT) This will likely be fixed in a later release

Available environment variables descriptions:

  • ENVOY_CONTROLLER_HOST Set to your Envoy Controller IP Address if envoy.local cannot be found (usually if run in Docker)
  • ENVOY_CONTROLLER_USER Set if the default user is not "envoy"
  • ENVOY_CONTROLLER_PASSWORD Set to your Envoy Controller password if you have changed it from the default
  • ENVOY_INFLUXDBRESOURCE_HOST Set to your Influx Database IP Address
  • ENVOY_INFLUXDBRESOURCE_PORT Set to your Influx Database Port No
  • ENVOY_INFLUXDBRESOURCE_USER Set if your Influx Database needs a user/password
  • ENVOY_INFLUXDBRESOURCE_PASSWORD Set if your Influx Database needs a user/password
  • ENVOY_PVOUTPUTRESOURCE_SYSTEMID Set to your pvoutput systemid
  • ENVOY_PVOUTPUTRESOURCE_KEY Set to your pvoutput key
  • ENVOY_MQQTRESOURCE_HOST Set to your MQTT Server IP Address
  • ENVOY_MQQTRESOURCE_PORT Set to your MQTT Server Port No
  • ENVOY_MQQTRESOURCE_TOPIC Set to the MQTT topic you want to write to
  • ENVOY_MQQTRESOURCE_PUBLISHERID Set to the MQTT publisher id you want to use
  • SPRING_PROFILES_ACTIVE Determines destination for stats. If not set only an internal database gets the stats. Values can be influxdb, pvoutput, mqtt
  • ENVOY_REFRESHSECONDS How often to poll the Envoy Controller. Default 60s
  • ENVOY_PAYMENTPERKILOWATT How much you get paid to export power to grid (FIT) eg 0.125 is 12.5c/Kw
  • ENVOY_CHARGEPERKILOWATT How much it costs to buy from the grid eg 0.32285 is 32.285c/Kw
  • ENVOY_DAILYSUPPLYCHARGE How much it costs to access the grid every day eg 0.93 is 93c/day
  • SERVER_SERVLET_CONTEXT-PATH Context path for local view if you want it on something other than /solar

V7 support

Either supply

  • ENVOY_BEARERTOKEN Set this if you want to control the token refresh process and not supply your website user/password

Or if you want auto refresh

  • ENVOY_ENPHASEWEBUSER Set this to your enphase website user id
  • ENVOY_ENPHASEWEBPASSWORD Set this to your enphase website password

New configuration

  • ENVOY_EXPORT-LIMIT If you have a limit on your export this will display a upper boundary on the main graph and display a new excess production line
  • ENVOY_BANDS[].FROM The bands array configuration will add a shaded band to the main graph that you can use to highlight changes to import costs and the like (See example below)
  • ENVOY_BANDS[].TO From and To are start and end times in 24hr format (must include a leading 0 eg 0700)
  • ENVOY_BANDS[].COLOUR The Colour field can be formatted like #55BF3B or rgba(200, 60, 60, .2)

External Configuration file

The easiest way to configure the bands is with an external configuration file

  • Create a file called application.properties containing values like the following (defining 2 bands 8am-12pm & 4pm-6pm)
envoy.bands[0].from = 0800
envoy.bands[0].to = 1200
envoy.bands[0].colour = #55BF3B
envoy.bands[1].from = 1600
envoy.bands[1].to = 1800
envoy.bands[1].colour = rgba(200, 60, 60, .2)
  • Pass the file to the jar using the spring.config.additional-location parameter
java -jar enphasecollector.jar --spring.config.additional-location=file:application.properties

All properties can be configured this way and will override any defaults set in the jar. Check the application.properties file for more properties that can be set

For Docker you will need a local directory to hold the file

docker run \
-e TZ=your-timezone \
-e ENVOY_CONTROLLER_PASSWORD=envoy-password \
-e ENVOY_CONTROLLER_HOST=envoy-ip \
-p 8080:8080 \
--mount target=/internal_db,source=host_path
--mount target=/properties,source=host_path
dlmcpaul/enphasecollector

Exposing this application to the web

While I make every effort to make this application secure I cannot make any guarantees. The application should be hosted behind a firewall and only exposed through a reverse proxy which includes an authentication mechanism and utilises https.

Dependencies

  • Docker (or Java 21)

  • If profile set to influxdb then an Influx DB is needed for storage of the statistics (Will autocreate 2 databases called 'solardb' and 'collectorStats')

  • If profile set to pvoutput then every 5m the stats will be uploaded to your account at https://pvoutput.org (you will need to create an account to to get the systemid and key)

  • You can set multiple profiles separated by a comma eg influxdb,pvoutput

  • The internal database is always populated so the local view is always available at /solar

  • Stats can be pulled to Prometheus by using the Actuator endpoint configured at /solar/actuator/prometheus

  • Stats can be pushed to a mqtt server with the mqtt profile (requires mqtt server)

Building for yourself

This is a fairly standard maven project using spring boot so mvn package -Dmaven.test.skip should get your started and can build a working jar located in the target directory

You will need the following tools installed to develop and build this code.

  • Git to clone the code and commit changes
  • Java 21 to compile the code
  • Maven to manage the build process
  • Docker to support the testing

There are also modules built in if you want to store the data somewhere other than the internal database. To use them you will need an installation or authentication for the specific system:

  • InfluxDB 1.8
  • PvOutput system id and key
  • Prometheus
  • Mqtt Server

There are some caveats

  • The build will generate a jar with a default version of unreleased

Docker Images

  • You can use the spring boot plugin build-image to generate a docker image that works but does not export a properties file location you can use
  • I also have a number of dockerfiles I use for my releases and experimentation. I have documented them under DOCKER.md

enphasecollector's People

Contributors

dlmcpaul avatar snyk-bot avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

enphasecollector's Issues

Receiving error after updating to current version

Caused by: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type int from String "0.36": not a valid Integer value; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type int from String "0.36": not a valid Integer value

Can't get Docker Build to Complete

I downloaded Docker Desktop 4.12.0 on PC just to run this collector, did docker build, it goes through quite a way but then gets an error:

[builder 4/4] RUN "/usr/lib/jvm/zulu17-ca/bin/jar" -xf app.jar:
#10 0.770 java.io.FileNotFoundException: app.jar (Is a directory)

Anyone know how to get past this?

Data is showing on the graph, but not in the text fields on the right

You can see my setup here: https://dev1.eriklentz.com/solar/

I'm running the Java version of the collector on Debian Linux.

I stopped the collector, added this flag to my run command to change from the default polling interval: --envoy.refreshseconds=15000
Then started the collector again. As far as what I intended to accomplish, it works, it now polls more often.

However, the graph still displays the collected data, but most of the text fields on the right are empty and all historical data cannot be displayed.

Reverting to the default polling interval does not appear to correct the issue. Has the internal database become corrupted? How can I restore functionality?

Need Graphics

The internal web site uses a single electricity.jpg image for several info lines.

I welcome contributions of images so each info has it's own graphic.

H2 database upgrade to V2

H2 database used is V1.

To upgrade to later Spring boot versions then H2 needs to migrate to V2

There is no auto-upgrade. Database requires an export using V1 library and import using V2 library

installer password

Not an issue, just a question.

great tool. Thanks for sharing. Quick question regarding the data streams /stream/meter. This needs the installer username and the password (to access via digest/browser). How does EnphaseCollector access this stream without the password? I dug through the code but i could not find anything obvious how this is achieved and I cannot see a good place to provide this information (e.g. main/resources/application.properties).

Thanks,

Pete.

Error retrieving solar stats - IO error

Hi all,

Been a user of the project for years so very appreciative of the team here!

My envoy got upgraded and I finally got the authentication via token working. I am now getting the following I/O error on GET request. Help anyone?

Thanks in advance.
Richard

2023-07-10T07:03:17.808Z INFO 8 --- [ scheduling-1] com.hz.services.EnvoyConnectionProxy : Preparing Realm Authentication Provider with user envoy
2023-07-10T07:03:17.813Z INFO 8 --- [ main] com.hz.EnphaseCollectorApplication : Started EnphaseCollectorApplication in 19.629 seconds (process
running for 20.706)
2023-07-10T07:03:17.826Z INFO 8 --- [ scheduling-1] com.hz.services.EnvoyConnectionProxy : Reading from protected Envoy controller endpoint http://envoy.l
ocal/api/v1/production/inverters
2023-07-10T07:03:18.427Z INFO 8 --- [ scheduling-1] o.a.h.c.h.i.c.HttpRequestRetryExec : Recoverable I/O exception (java.net.UnknownHostException) caugh
t when processing request to {}->http://envoy.local:80
2023-07-10T07:03:18.429Z INFO 8 --- [ scheduling-1] o.a.h.c.h.i.c.HttpRequestRetryExec : Recoverable I/O exception (java.net.UnknownHostException) caugh
t when processing request to {}->http://envoy.local:80
**_**2023-07-10T07:03:18.432Z ERROR 8 --- [ scheduling-1] com.hz.services.EnvoyService : Failed to retrieve Solar stats. Exception was I/O error on GET
request for "http://envoy.local/home.json": envoy.local

org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://envoy.local/home.json": envoy.local**_**
at org.springframework.web.client.RestTemplate.createResourceAccessException(RestTemplate.java:888) ~[spring-web-6.0.8.jar:6.0.8]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:868) ~[spring-web-6.0.8.jar:6.0.8]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:764) ~[spring-web-6.0.8.jar:6.0.8]
at org.springframework.web.client.RestTemplate.getForEntity(RestTemplate.java:405) ~[spring-web-6.0.8.jar:6.0.8]
at com.hz.services.EnvoyService.getSystemData(EnvoyService.java:46) ~[app/:na]
at com.hz.services.EnvoyService.collectEnphaseData(EnvoyService.java:57) ~[app/:na]
at com.hz.services.OutputManager.gather(OutputManager.java:47) ~[app/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-6.0.8.jar:6.0.8]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-6.0.8.jar:6.0.8]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
Caused by: java.net.UnknownHostException: envoy.local
at java.base/java.net.InetAddress$CachedAddresses.get(InetAddress.java:801) ~[na:na]
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1533) ~[na:na]
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1385) ~[na:na]

Dockerfile bug: unknown instruction: IF

āÆ docker build -f Dockerfile-build .
[+] Building 0.1s (2/2) FINISHED
 => [internal] load build definition from Dockerfile-build                                                                                                                                                                                                                         0.0s
 => => transferring dockerfile: 1.98kB                                                                                                                                                                                                                                             0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                    0.0s
failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 27: unknown instruction: IF

Duplicate key error on new deployment when writing to influxdb

on latest version of influx i get:
enphaseCollector | 2022-08-30 00:21:34.814 INFO 1 --- [ main] com.hz.configuration.InfluxDBConfig : Writing solar stats to influx database at http://db:8086
enphaseCollector | 2022-08-30 00:21:35.093 WARN 1 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'influxService' defined in file [/app/com/hz/services/InfluxService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'destinationInfluxDB' defined in class path resource [com/hz/configuration/InfluxDBConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.influxdb.InfluxDB]: Factory method 'destinationInfluxDB' threw exception; nested exception is org.influxdb.InfluxDBException: {"code":"unauthorized","message":"unauthorized access"}
enphaseCollector | 2022-08-30 00:21:35.096 INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
enphaseCollector | 2022-08-30 00:21:35.103 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
enphaseCollector | 2022-08-30 00:21:35.143 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
enphaseCollector | 2022-08-30 00:21:35.212 ERROR 1 --- [ main] i.micrometer.influx.InfluxMeterRegistry : unable to create database 'collectorStats': {"code":"unauthorized","message":"unauthorized access"}
enphaseCollector | 2022-08-30 00:21:35.293 ERROR 1 --- [ main] i.micrometer.influx.InfluxMeterRegistry : failed to send metrics to influx: {"code":"unauthorized","message":"unauthorized access"}
enphaseCollector | 2022-08-30 00:21:35.310 ERROR 1 --- [ main] i.micrometer.influx.InfluxMeterRegistry : unable to create database 'collectorStats': {"code":"unauthorized","message":"unauthorized access"}
enphaseCollector | 2022-08-30 00:21:35.337 ERROR 1 --- [ main] i.micrometer.influx.InfluxMeterRegistry : failed to send metrics to influx: {"code":"unauthorized","message":"unauthorized access"}
enphaseCollector | 2022-08-30 00:21:35.340 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
enphaseCollector | 2022-08-30 00:21:35.385 INFO 1 --- [ main] ConditionEvaluationReportLoggingListener :

Trying to use influx 1.8, Error i'm receiving is:

enphaseCollector | 2022-08-30 00:30:21.515 WARN 1 --- [nio-8080-exec-9] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 23505, SQLState: 23505 enphaseCollector | 2022-08-30 00:30:21.516 ERROR 1 --- [nio-8080-exec-9] o.h.engine.jdbc.spi.SqlExceptionHelper : Unique index or primary key violation: "PUBLIC.UK_ESIJSR1QSXCG3GCQ4AF42OF09_INDEX_5 ON PUBLIC.EVENT_PANELS(PANELS_ID) VALUES 41"; SQL statement: enphaseCollector | insert into event_panels (event_id, panels_id) values (?, ?) [23505-200] enphaseCollector | 2022-08-30 00:30:21.517 INFO 1 --- [nio-8080-exec-9] o.h.e.j.b.internal.AbstractBatchImpl : HHH000010: On release of batch it still contained JDBC statements enphaseCollector | 2022-08-30 00:30:21.525 ERROR 1 --- [nio-8080-exec-9] com.hz.controllers.EnphaseController : populateMultiStatsStatusList Exception: could not execute statement; SQL [n/a]; constraint ["PUBLIC.UK_ESIJSR1QSXCG3GCQ4AF42OF09_INDEX_5 ON PUBLIC.EVENT_PANELS(PANELS_ID) VALUES 41"; SQL statement: enphaseCollector | insert into event_panels (event_id, panels_id) values (?, ?) [23505-200]]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement enphaseCollector | enphaseCollector | org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint ["PUBLIC.UK_ESIJSR1QSXCG3GCQ4AF42OF09_INDEX_5 ON PUBLIC.EVENT_PANELS(PANELS_ID) VALUES 41"; SQL statement: enphaseCollector | insert into event_panels (event_id, panels_id) values (?, ?) [23505-200]]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement enphaseCollector | at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:276) ~[spring-orm-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:233) ~[spring-orm-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:566) ~[spring-orm-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743) ~[spring-tx-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711) ~[spring-tx-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:654) ~[spring-tx-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:407) ~[spring-tx-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[spring-aop-5.3.21.jar:5.3.21] enphaseCollector | at com.hz.services.LocalDBService$$EnhancerBySpringCGLIB$$be5d2602.getMaxPanelProduction(<generated>) ~[app/:na] enphaseCollector | at com.hz.controllers.EnphaseController.populateMultiStatsStatusList(EnphaseController.java:80) ~[app/:na] enphaseCollector | at com.hz.controllers.EnphaseController.populateStatusList(EnphaseController.java:100) ~[app/:na] enphaseCollector | at com.hz.controllers.EnphaseController.status(EnphaseController.java:149) ~[app/:na] enphaseCollector | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] enphaseCollector | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] enphaseCollector | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] enphaseCollector | at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na] enphaseCollector | at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067) ~[spring-webmvc-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.21.jar:5.3.21] enphaseCollector | at javax.servlet.http.HttpServlet.service(HttpServlet.java:655) ~[tomcat-embed-core-9.0.64.jar:4.0.FR] enphaseCollector | at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.21.jar:5.3.21] enphaseCollector | at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[tomcat-embed-core-9.0.64.jar:4.0.FR] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at com.hz.controllers.filters.SecurityHeaderFilter.doFilter(SecurityHeaderFilter.java:25) ~[app/:na] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.springframework.web.servlet.resource.ResourceUrlEncodingFilter.doFilter(ResourceUrlEncodingFilter.java:67) ~[spring-webmvc-5.3.21.jar:5.3.21] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.21.jar:5.3.21] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.21.jar:5.3.21] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96) ~[spring-boot-actuator-2.6.9.jar:2.6.9] enphaseCollector | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.21.jar:5.3.21] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.21.jar:5.3.21] enphaseCollector | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.21.jar:5.3.21] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1787) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.64.jar:9.0.64] enphaseCollector | at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na] enphaseCollector | Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement enphaseCollector | at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:59) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:37) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:200) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:46) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1352) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.action.internal.CollectionUpdateAction.execute(CollectionUpdateAction.java:84) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:604) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.engine.spi.ActionQueue.lambda$executeActions$1(ActionQueue.java:478) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) ~[na:na] enphaseCollector | at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:475) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:344) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:40) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1407) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:489) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3290) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2425) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:449) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:183) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$300(JdbcResourceLocalTransactionCoordinatorImpl.java:40) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:281) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:101) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:562) ~[spring-orm-5.3.21.jar:5.3.21] enphaseCollector | ... 72 common frames omitted enphaseCollector | Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or primary key violation: "PUBLIC.UK_ESIJSR1QSXCG3GCQ4AF42OF09_INDEX_5 ON PUBLIC.EVENT_PANELS(PANELS_ID) VALUES 41"; SQL statement: enphaseCollector | insert into event_panels (event_id, panels_id) values (?, ?) [23505-200] enphaseCollector | at org.h2.message.DbException.getJdbcSQLException(DbException.java:459) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.message.DbException.getJdbcSQLException(DbException.java:429) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.message.DbException.get(DbException.java:205) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.message.DbException.get(DbException.java:181) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:103) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.mvstore.db.MVSecondaryIndex.checkUnique(MVSecondaryIndex.java:221) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:196) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.mvstore.db.MVTable.addRow(MVTable.java:531) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.command.dml.Insert.insertRows(Insert.java:195) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.command.dml.Insert.update(Insert.java:151) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.command.CommandContainer.update(CommandContainer.java:198) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.command.Command.executeUpdate(Command.java:251) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:191) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:152) ~[h2-1.4.200.jar:1.4.200] enphaseCollector | at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[HikariCP-4.0.3.jar:na] enphaseCollector | at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[HikariCP-4.0.3.jar:na] enphaseCollector | at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final] enphaseCollector | ... 92 common frames omitted enphaseCollector |

problems connecting MQTT server

i've tried the docker commandline and add parameters for connection to a MQTT server, unfortunately in my MQTT server i don't see a new topic appearing ?

docker run --rm -e TZ=Europe/Amsterdam
-e ENVOY_BEARER_TOKEN=xxx
-e ENVOY_CONTROLLER_HOST=192.168.110.80
-e ENVOY_MQTTRESOURCE_HOST=192.168.110.250
-e ENVOY_MQTTRESOURCE_PORT=1883
-e ENVOY_MQTTRESOURCE_TOPIC=enphase
-p 8080:8080
dlmcpaul/enphasecollector:latest

Missing stats after restart on RPi

Kia ora,

I had to restart my Raspberry Pi after a power cut, and despite using an InfluxDB the stats are missing. So are some of the stats on the right-hand side.

Screen Shot 2020-10-15 at 8 34 22 AM

This is the command I am using to kick it off:
docker run -it
-e TZ=Pacific/Auckland
-e ENVOY_CONTROLLER_PASSWORD=passwordishere
-e ENVOY_CONTROLLER_HOST=envoy.ip.is.here
-e ENVOY_INFLUXDBRESOURCE_HOST=host.ip.is.here
-e ENVOY_INFLUXDBRESOURCE_PORT=8086
-e SPRING_PROFILES_ACTIVE=influxdb
-e ENVOY_REFRESHSECONDS=5000
-e ENVOY_PAYMENTPERKILOWATT=0.05
-e ENVOY_CHARGEPERKILOWATT=0.16
-e ENVOY_DAILYSUPPLYCHARGE=2.30
dlmcpaul/enphasecollector:arm

Is there something I am missing? I can see the InfluxDBs have some data in them, but it looks like it didn't read it back in.
Up until now it's been running sweet as a nut!

Thanks heaps

New release needed

Looks like you've made a lot of improvement lately. It would be great if you push a new release and update the dockerhub image so we could get all the new goodies :)

Enphase Gateway (Envoy) API changes

API Documentation can be found here

Here is a summary of the changes that will go into effect with release 07.03.120 and higher:

  • Added a new capability to generate and authenticate secure access tokens via web UI to secure all custom applications and API calls.
  • Documentation now includes examples of how to use URLs to get tokens programmatically using shell script-based or Python-based methods.
  • Revised documentation also explains how to connect securely using the updated IQ Gateway local UI and/or IQ Gateway APIs.

How to run on Android Device

Thanks David for such a great app.

I would like to run EnphaseCollector on an android device but am unsure if this is possible? Any tips would be much appreciated.

Support InfluxDB > 1.8

There are different libraries needed to support Influx DB <= 1.8 and Influx DB >= 2

Can we support both?

Unrecognized field "system_id"

I get this error suddenly from the docker container running Enphasecollector. The container still answers with prometheus data the "important to me" solar data is missing. i.e. "solar_meter_production_watts" is not in the collector output then this error is happening.

`2023-09-05T08:51:45.053-07:00 ERROR 7 --- [ scheduling-1] com.hz.services.EnvoyService : Failed to retrieve Solar stats. Exception was Unrecognized field "system_id" (class com.hz.models.envoy.LogInResponse), not marked as ignorable (4 known properties: "is_consumer", "session_id", "message", "manager_token"])
at [Source: (String)"{"message":"success","session_id":"3086e4bae322887a5a1efdc613c20270","manager_token":"eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InNlc3Npb25faWQiOiIzMDg2ZTRiYWUzMjI4ODdhNWExZWZkYzYxM2MyMDI3MCIsImNvbXBhbnlfaWQiOm51bGwsImVtYWlsX2lkIjoibWlzY0ByZXRsYXcubmV0IiwidXNlcl9pZCI6MjM5MjQ5MCwiY2xpZW50X2FwcCI6Iml0azMiLCJmaXJzdF9uYW1lIjoiSmFtZXMiLCJsYXN0X25hbWUiOiJTdXRoZXJsYW5kIiwibG9naW5fdXNlciI6bnVsbCwiaXNfZGlzdHJpYnV0b3IiOmZhbHNlfSwiZXhwIjoxNjk0NTMzOTA0LCJzdWIiOiJtaXNjQHJldGxhdy5uZXQifQ.aU_flbzO9FodCzfLr8xXcUwVY30r8K"[truncated 54 chars]; line: 1, column: 554] (through reference chain: com.hz.models.envoy.LogInResponse["system_id"])

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "system_id" (class com.hz.models.envoy.LogInResponse), not marked as ignorable (4 known properties: "is_consumer", "session_id", "message", "manager_token"])
at [Source: (String)"{"message":"success","session_id":"3086e4bae322887a5a1efdc613c20270","manager_token":"eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InNlc3Npb25faWQiOiIzMDg2ZTRiYWUzMjI4ODdhNWExZWZkYzYxM2MyMDI3MCIsImNvbXBhbnlfaWQiOm51bGwsImVtYWlsX2lkIjoibWlzY0ByZXRsYXcubmV0IiwidXNlcl9pZCI6MjM5MjQ5MCwiY2xpZW50X2FwcCI6Iml0azMiLCJmaXJzdF9uYW1lIjoiSmFtZXMiLCJsYXN0X25hbWUiOiJTdXRoZXJsYW5kIiwibG9naW5fdXNlciI6bnVsbCwiaXNfZGlzdHJpYnV0b3IiOmZhbHNlfSwiZXhwIjoxNjk0NTMzOTA0LCJzdWIiOiJtaXNjQHJldGxhdy5uZXQifQ.aU_flbzO9FodCzfLr8xXcUwVY30r8K"[truncated 54 chars]; line: 1, column: 554] (through reference chain: com.hz.models.envoy.LogInResponse["system_id"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61) ~[jackson-databind-2.14.2.jar:2.14.2]
at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:1132) ~[jackson-databind-2.14.2.jar:2.14.2]
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:2202) ~[jackson-databind-2.14.2.jar:2.14.2]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1705) ~[jackson-databind-2.14.2.jar:2.14.2]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1683) ~[jackson-databind-2.14.2.jar:2.14.2]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:320) ~[jackson-databind-2.14.2.jar:2.14.2]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) ~[jackson-databind-2.14.2.jar:2.14.2]
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323) ~[jackson-databind-2.14.2.jar:2.14.2]
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4730) ~[jackson-databind-2.14.2.jar:2.14.2]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3677) ~[jackson-databind-2.14.2.jar:2.14.2]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3645) ~[jackson-databind-2.14.2.jar:2.14.2]
at com.hz.utils.EnphaseJWTExtractor.postLogin(EnphaseJWTExtractor.java:79) ~[app/:na]
at com.hz.utils.EnphaseJWTExtractor.fetchJWTV2(EnphaseJWTExtractor.java:165) ~[app/:na]
at com.hz.services.EnvoyConnectionProxy.getSecureTemplate(EnvoyConnectionProxy.java:145) ~[app/:na]
at com.hz.services.EnvoyService.getSystemData(EnvoyService.java:46) ~[app/:na]
at com.hz.services.EnvoyService.collectEnphaseData(EnvoyService.java:57) ~[app/:na]
at com.hz.services.OutputManager.gather(OutputManager.java:47) ~[app/:na]
at jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-6.0.8.jar:6.0.8]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-6.0.8.jar:6.0.8]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]`

Automatically select https (port 443) for V7 enphase devices

It would be good to auto select HTTPS for enphase devices running the V7 firmware but allow downgrade if required.

Might be difficult since we don't know the version until we fetch the info.xml file.

Maybe try with passed in values and if failure retry with HTTPS?

Mobile responsive view

Hi David,
Firstly: thanks for providing this on github! this is very good and well done.
Now, I'm creating this issue because when viewing the resulting page on a mobile, the graph just does not work.
I gave a try at fixing it, but I'm really bad at frontend and got nowhere ...

If you have time for this, I'd really appreciate help ;)

Launch Failure - MacOS / Java 11

Hi thanks for publishing. The tool looks like it could be very useful. I downloaded enphasecollector-0.22.jar & latest Java 11 from adoptopenjdk.net. Launch gets as far as this message:
ERROR 38852 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.

-and then a long stack dump - the 1st few lines are pasted below. (full trace enclosed). Iā€™m able to reach the envoy locally & see stats. I tried running both with & without explicitly setting address/password. The 6-digit password works fine manually. I wondered if the new Java engine is battling with previous installation? I have this variable set:
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-15.0.1.jdk/Contents/Home
Any suggestions are much appreciated.

org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database may be already in use: null. Possible solutions: close all other connection(s); use the server mode [90020-200]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:622) ~[h2-1.4.200.jar!/:na]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:429) ~[h2-1.4.200.jar!/:na]
	at org.h2.message.DbException.get(DbException.java:194) ~[h2-1.4.200.jar!/:na]
	at org.h2.mvstore.db.MVTableEngine$Store.convertIllegalStateException(MVTableEngine.java:206) ~[h2-1.4.200.jar!/:na]

javadump.log

Is "excess" equal to what is being exported to the grid?

I believe because of #55 the database might be little incomplete.
Does the solar.excess measurement track the amount of power I'm sending back to the grid? Or does it measure a combination of what I give back to the grid and charge the battery with?

Prometheus Support

Would you consider adding an endpoint to expose the data in Prometheus format?

Thanks!

How to compile/run outside docker?

This looks like a great project and I'd like to use it with my enphase system.
But no docker on my device.

Any hints on how to run on a native JRE? mvn install doesn't work.

Comments

This is the best plug-and-play program to gather data from Envoy. I'm using the docker container and it works like a champ!
Do you think you could share your Grafana dashboard? I saw it on whitpool.net.au and it looks wonderfully.

Thank you so much!

How to connect to MQTT publisher

I'd love to get this connected to my MQTT setup but I'm having a hard time locating the syntax for passing mqtt configuration parameters (mqtt host, username, pass, topic, etc).

Can anyone please point me in the right direction?

Consumption values wrong when another hybrid inverter is present in the system

I'm not sure if some math is being preformed but when there is another inverter in the system and enphase is only part of the PV production, when I am exporting power back to grid, the consumption is the total of the export + enphase PV generation which makes consumption way too high. I don't know how to work around this but maybe an option just to show Net Grid import/export instead of trying to show consumption.

Getting EnphaseCollector running on Raspberry Pi

Hello! We've just installed our solar setup and I'd love to have a permanent display running in our kitchen. Your app would be utterly perfect (it's is way better than what comes with the envoy!)

I got it working on my laptop but have been unsuccessful getting it to run on a Pi 4. I installed docker and docker-compose, but when I use docker-compose up I just get exec user process caused "exec format error"

Is it possible to run this on a Pi?

Thanks heaps

Adding "on-peak" and "off-peak" colouring to the production/consumption graph

Kia ora,

I love your visualiser software. We have it proudly displayed in the kitchen and it's much remarked upon by visitors to our house! It frequently prompts us to ask "why are we using so much power?" and go looking for the offending appliance. It also prompts us to do something with the power once the hot water has finished heating. Awsome stuff!

Our power company is offering us on-peak and off-peak rates for our power at very set times of the day. I wondered how easy it would be add some background colour to the production/consumption graph to show these times (and prompt us to avoid them for high power use appliances). Is this a couple of lines or a complete re-write?

Thanks again for your awesome software, and please ignore this if it's a cheeky thing to ask :-)

Karl

Update "How to build" docu

It would be super helpful if you could update the README.md with the instructions on how to build/test/run this locally.

Some people, like me, have never used springboot or maven, so it would be very helpful if you could give quick step by step instructions on how I can build and run this locally.

Thank you!

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.