helgew / emporia-downloader Goto Github PK
View Code? Open in Web Editor NEWA Java-based Emporia Energy API Client
License: GNU General Public License v3.0
A Java-based Emporia Energy API Client
License: GNU General Public License v3.0
Pulling into my Home Automation (Indigo 7.5) system, I am not using the influxDB, but simply calling the downloader to get the raw minute scaled JSON data once per minute and piping the stdout into a python dict... It works well for all 16 channels that I am monitoring to keep track of AC use and when the washer and dryer end their cycles, but it would be nice to know what the total power draw (shown in the csv files from emporia that I pull periodically and hand process), and I simply ignore the
{"channel":"1,2,3","deviceGid":"XXXXX","usageList":[null,null],"firstUsageInstant":"2021-12-04T22:30:00Z"}
entry... but I was just curious as to why it was there...
On latest JDK and with pom on lombok 1.18.10 we get the following error.
Fatal error compiling: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor
To fix, need to update pom to use to 1.18.20
Can you tell me what should be used for the influx-token setting? I've tried using the API token for my account, but I keep getting an "Invalid ID token" error.
23 Jan 2022 21:29:08 - ERROR (CognitoAuthenticationManager.java:123): Invalid ID token!
com.auth0.jwt.exceptions.InvalidClaimException: The Token can't be used before Sun Jan 23 21:29:11 EST 2022.
I can get it to work with displaying the Vue data to the terminal window, but whenever I try to include my InfluxDB, it get the above error. Thanks!
Mr. Weissig,
All I want to do is pull the current power usage or production from the emporia VUE. I can probably use a Raspberry Pi to try to run your Java script, but there is a lot I am unfamiliar with.
Are there any simple ways to query the unit directly? It's on my WiFi network. Is there a Telnet like feature?
I want to build a battery system to use with my solar power system. I want to turn on charging if I am making a high enough level of power. The device works great and gives me real time power generation or usage on my phone or on the web, but scraping the number is not easy either. The company said they have no API or SDK, but that I should check out the forums.
It would also be fun to create a device that turns on a green light when I am making power and a red light when I am using power.
My private email address is [email protected]
Thanks for your time.
Greg
Hi ! After update to new version emporia-downloader.1.2, around 20 hours later the process stops with this error (related to resources comsuption):
[73490.060s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
Exception in thread "main" java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/re source limits reached
at java.base/java.lang.Thread.start0(Native Method)
at java.base/java.lang.Thread.start(Thread.java:798)
at java.base/java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:937)
at java.base/java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1583)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:346)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:579)
at io.reactivex.internal.schedulers.NewThreadWorker.scheduleActual(NewThreadWorker.java:147)
at io.reactivex.internal.schedulers.NewThreadWorker.schedule(NewThreadWorker.java:51)
at io.reactivex.Scheduler$Worker.schedulePeriodically(Scheduler.java:433)
at io.reactivex.internal.operators.flowable.FlowableWindowTimed$WindowExactBoundedSubscriber.onSubscribe(FlowableWi ndowTimed.java:340)
at io.reactivex.internal.operators.flowable.FlowablePublishMulticast$MulticastProcessor.subscribeActual(FlowablePub lishMulticast.java:297)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.internal.operators.flowable.FlowableWindowTimed.subscribeActual(FlowableWindowTimed.java:67)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.Flowable.subscribe(Flowable.java:14882)
at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.onNext(FlowableFlatMap.java:163)
at io.reactivex.internal.operators.flowable.FlowableFromArray$ArraySubscription.slowPath(FlowableFromArray.java:162 )
at io.reactivex.internal.operators.flowable.FlowableFromArray$BaseArraySubscription.request(FlowableFromArray.java: 90)
at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.onSubscribe(FlowableFlatMap.java:117)
at io.reactivex.internal.operators.flowable.FlowableFromArray.subscribeActual(FlowableFromArray.java:38)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.internal.operators.flowable.FlowableFlatMap.subscribeActual(FlowableFlatMap.java:53)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at com.influxdb.client.internal.AbstractWriteClient.lambda$null$2(AbstractWriteClient.java:133)
at io.reactivex.internal.operators.flowable.FlowableDefer.subscribeActual(FlowableDefer.java:35)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.Flowable.subscribe(Flowable.java:14882)
at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.onNext(FlowableFlatMap.java:163)
at io.reactivex.internal.operators.flowable.FlowableFromArray$ArraySubscription.slowPath(FlowableFromArray.java:162 )
at io.reactivex.internal.operators.flowable.FlowableFromArray$BaseArraySubscription.request(FlowableFromArray.java: 90)
at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.onSubscribe(FlowableFlatMap.java:117)
at io.reactivex.internal.operators.flowable.FlowableFromArray.subscribeActual(FlowableFromArray.java:38)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.internal.operators.flowable.FlowableFlatMap.subscribeActual(FlowableFlatMap.java:53)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.Flowable.subscribe(Flowable.java:14882)
at io.reactivex.internal.operators.flowable.FlowablePublishMulticast.subscribeActual(FlowablePublishMulticast.java: 72)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.Flowable.subscribe(Flowable.java:14882)
at io.reactivex.internal.operators.flowable.FlowableConcatMap.subscribeActual(FlowableConcatMap.java:66)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.internal.operators.mixed.FlowableConcatMapSingle.subscribeActual(FlowableConcatMapSingle.java:62)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.internal.operators.mixed.FlowableConcatMapMaybe.subscribeActual(FlowableConcatMapMaybe.java:62)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.internal.operators.flowable.FlowableDoFinally.subscribeActual(FlowableDoFinally.java:46)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.Flowable.subscribe(Flowable.java:14872)
at io.reactivex.Flowable.subscribe(Flowable.java:14791)
at com.influxdb.client.internal.AbstractWriteClient.(AbstractWriteClient.java:175)
at com.influxdb.client.internal.WriteApiImpl.(WriteApiImpl.java:54)
at com.influxdb.client.internal.InfluxDBClientImpl.getWriteApi(InfluxDBClientImpl.java:120)
at com.influxdb.client.internal.InfluxDBClientImpl.getWriteApi(InfluxDBClientImpl.java:111)
at org.grajagan.emporia.influxdb.InfluxDBLoader.save(InfluxDBLoader.java:172)
at org.grajagan.emporia.EmporiaDownloader.processDevice(EmporiaDownloader.java:431)
at org.grajagan.emporia.EmporiaDownloader.run(EmporiaDownloader.java:344)
at org.grajagan.emporia.EmporiaDownloader.main(EmporiaDownloader.java:150)
The following worked in May 2022 and before, but it's not working in June 2022 any more.
java -jar emporia-downloader.1.2.jar --config config.properties --scale m --history 1d
Here is an example of warning message.
28 Jun 2022 13:38:37 - WARN (EmporiaDownloader.java:424): Readings: null
{"channel":"9","deviceGid":"21041","message":"requesting Minutes data from 2022-06-27T04:32:36Z to 2022-06-28T04:38:36Z is larger than the allowed limit of PT13H20M"}
BTW the following works even today, but it doesn't work with --history 13h and larger
java -jar emporia-downloader.1.2.jar --config config.properties --scale m --history 12h
I think minute data retention is for 7 days. I could download minutes data for 7 days in May 2022 and before, but it's not allowed any more. Is there any way to download minutes data for 1 day or 7 day?
Thanks!
Since about a day now getting the error : WARN (EmporiaDownloader.java:313): Customer null has no devices!
Looks like "customer" is returning null on service.getCustomer()
I want to start by saying thank you for putting this downloader together. It started me on a journey of capturing my own data locally and learning a new database (influxdb)
One thing I have noticed is that the downloader imports the smart plugs and vue mains inputs with null device names. So I have to go through each _measurement id and determine which device I am viewing and it makes queries by device name incomplete.
Is there a way to name the measurements a unique name or tag in influxdb? I have searched but am really new to databases in general so not finding what I am looking for.
Thanks,
Justin
I want to connect this java API with my Emporia device. I've my username and password. Now I downloaded the emporia downloader files. But whenever I try to execute the jar file through the command prompt, it doesn't show any response. I've attached a screenshot below. Please help me with it so I can communicate with my Emporia device. Thanks!
Not an issue, but a feature request to the influx data structure.
basically enhance the point building on line 124 of influxDBloader.java. Something like :
Point point =
Point.measurement("Emporia_energy_usage").time(i.toEpochMilli(), TimeUnit.MILLISECONDS)
.addField("watts", (int) (data.get(i) * multiplier * 100) / 100.0)
.tag("Channel Name", channelName )
.tag("Channel Number", channelNum )
.build();
Sorry if this is the wrong place, but I can't get it to connect to InfluxDB.
I have a "bucket" configured in InfluxDB called "electricity". I have it connecting to the Emporia API and dumping data to STDOUT, that all works. I just can't get it to get into Influx. Here's the error...I'm certain this is not your issue, but I need help. I am Windows user..I could swap and run on a ubuntu VM I have on my pc if it helps...
Exception in thread "main" org.influxdb.InfluxDBIOException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:8086
at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:831)
at org.influxdb.impl.InfluxDBImpl.executeQuery(InfluxDBImpl.java:814)
at org.influxdb.impl.InfluxDBImpl.query(InfluxDBImpl.java:549)
at org.grajagan.emporia.influxdb.InfluxDBLoader.load(InfluxDBLoader.java:84)
at org.grajagan.emporia.EmporiaDownloader.loadChannelData(EmporiaDownloader.java:394)
at org.grajagan.emporia.EmporiaDownloader.run(EmporiaDownloader.java:336)
at org.grajagan.emporia.EmporiaDownloader.main(EmporiaDownloader.java:151)
Caused by: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:8086
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:265)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:183)
Thank you!
Hi, at May 22th you‘ve added „Influx 2 compatibility“. But indeed you‘ve removed v1 compatibility, haven‘t you?
would it be possible to include a tutorial how to do this please for running the script on raspberry pi, also, how to get the data into node red?
Hello,
How do you setup influx to get the data from emporia-downloader?
I'm trying to run emporia-downloader v1.3 in Windows 10. I can get it to show its help file, but nothing else. Here is my PowerShell command line:
java -jar .\emporia-downloader.jar --debug --history 2y
What am I doing wrong? How do I get it to do some real work?
Thank you - Rowan
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.