Powerwall - Extended Parameters

no worries, looks like its all working

Hil folks. Got my powerwall here in SA three weeks ago. Ive set up a Raspberry pi to monitor based on the mikesgear post and have the service running but like some folks above ive not been retrieving extended data successfully.

The log shows
20180714;15:51:19;-1000.0;-1.0;598;-1.000;-1.000;NaN;NaN;NaN;NaN;100.000;NaN
20180714;15:51:32;-1000.0;-1.0;606;-1.000;-1.000;NaN;NaN;NaN;NaN;100.000;NaN
20180714;15:51:44;-1000.0;-1.0;623;-1.000;-1.000;NaN;NaN;NaN;NaN;100.000;NaN

Seems im missing something.

Powerwall.ini shows
url=http://x.x.x.x/api/meters/aggregates
poll=30
direction=in
voltage=instant_average_voltage
v7=battery.instant_power
v8=load.instant_power
v10=site.instant_power
v12=solar.instant_power
soc-url=http://x.x.x.x/api/system_status/soe
soc-parameter=v11
powerwall.ini (END)

Suggestions welcome

Have a look at the other powerwall thread, I think from 1.18 firmware you access the powerwall though https not http, which one can be reached in a browser if you just type http://x.x.x.x/api/meters/aggregates or https://x.x.x.x/api/meters/aggregates?

1 Like

Thanks. good advice.

Ive also grabbed the latest version and loaded it.

Make sure you also grab the patch described at Tesla Powerwall2 data to PVoutput?.
Unless BB has been very very quick, you’ll need this to get the charge percentage out of https://x.x.x.x/api/system_status/soe working.

1 Like

The latest release v1.5.3.1 now includes the patch

1 Like

Thanks guys.

I found my problem. There were trailing spaces on the URL’s that broke the code.
Ive downloaded the patch and updated the URL’s to https. QAll working I just need to adjust the scaling of some of the parameters in PVOutput itself.

In case anyone is interested I setup a docker that can run the pvoutput service, currently only setup to work with powerwalls but can easily work with any of the others with minor tweaks.

It uses the latest build 1.5.3.1 and uses a very minimal system based on alpine linux

Link:
https://hub.docker.com/r/bshep/pvoutput

3 Likes

Sorry to bother, The instruction says:

map /config to a directory on the host her settings will live

What MacOS command would you use for doing the mapping?

docker --config ?

Also to synch Timezone, I found this online:

docker run -e “America/Los_Angeles”

would that do it? The posts say that for the " workaround to work , tzdata of course has to be installed in the container you’re trying to run."


Update:

this seems to do it:

$docker run -v ~/PVConfig:/config -e “TZ=${TZ}” bshep/pvoutput

Just so you know. I run two decker containers, on for production and one for consumption, started about 2 minutes apart, with uploads every 5 minutes. I keep separate log and ini folders as in:

$docker run -v ~/PVConfig:/config -e “TZ=${TZ}” bshep/pvoutput

$docker run -v ~/PVConfigOut:/config -e “TZ=${TZ}” bshep/pvoutput

Works beautifully.

5 minutes uploads last for about a day and a half, then the Powerwall “refuses” the connection. I am trying to see if 15-minutes intervals last longer.

Hi - I had a PW2 installed today. My solar system is setup already using the Solaredge interface - https://pvoutput.org/list.jsp?userid=11554

Can I add the PW2 to the existing system or should I replace the solaredge configuration with the PW2 using the pvoutput integrator?

Thanks in advance,

Paul

I updated the version from 1.5.4 to 1.5.4.1, nothing else has changed so please let me know if you have any issues.

I am getting this message in the logs:

2019-07-14 07:08:02,973 INFO [Thread-2] (WebClient.java:243) - >>> http://192.168.0.17:80/api/meters/aggregates
2019-07-14 07:08:02,985 ERROR [Thread-2] (AHttpLogReader.java:463) - Http Error
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(Unknown Source)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:397)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:573)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at org.pvoutput.integration.reader.AHttpLogReader$ASimpleLogFileWriter.get(AHttpLogReader.java:430)
at org.pvoutput.integration.reader.AHttpLogReader$ASimpleLogFileWriter.run(AHttpLogReader.java:354)

Update powerwall.ini to use https instead of http

Hi @bshep

First, THANKS for taking the extra effort to share your docker image!

I get this error in the setup when running your docker image on my Diskstation 1812+…I also get an error when just trying to ping the Powerwall2 gateway from my diskstation in a terminal window.

Any advice on how to get the proper network ports open to allow the communication? Is there a set of ports I need to map in the container config?

2019-07-16 23:08:06,571 INFO [main] (Controller.java:109) - *** Starting PVOutput Integration Service v1.5.4

2019-07-16 23:08:06,600 INFO [Thread-0] (Controller.java:130) - Install Directory: /usr/src/app

2019-07-16 23:08:06,621 INFO [Thread-0] (Controller.java:139) - Loaded Config: pvoutput.ini

2019-07-16 23:08:06,854 INFO [Thread-0] (AdminConsole.java:35) - Starting admin console on port: 8888

2019-07-16 23:08:10,705 INFO [Thread-0] (WebClient.java:133) - >>> http://pvoutput.org:80/service/r2/getsystem.jsp?donations=1

2019-07-16 23:08:11,228 INFO [Thread-0] (Controller.java:2136) - <<< Skyscraper of Panels & PW,10980,94028,36,305,Mission Solar 305W,4,2500,SMA SunnyBoy,N,11.0,No,20030109,37.374421,-122.213,5;;1

2019-07-16 23:08:13,231 INFO [Thread-0] (WebClient.java:133) - >>> http://pvoutput.org:80/service/r1/getstatus.jsp?d=20190716

2019-07-16 23:08:13,382 INFO [Thread-0] (Controller.java:323) - --------------------------

2019-07-16 23:08:13,384 INFO [Thread-0] (Controller.java:324) - System Name: Skyscraper of Panels & PW

2019-07-16 23:08:13,385 INFO [Thread-0] (Controller.java:325) - System Size: 10980

2019-07-16 23:08:13,386 INFO [Thread-0] (Controller.java:326) - Timezone: America/Los_Angeles

2019-07-16 23:08:13,387 INFO [Thread-0] (Controller.java:327) - Donation Mode: true

2019-07-16 23:08:13,389 INFO [Thread-0] (Controller.java:328) - Max History: 90

2019-07-16 23:08:13,391 INFO [Thread-0] (Controller.java:329) - Status Interval: 5-min

2019-07-16 23:08:13,392 INFO [Thread-0] (Controller.java:330) - Status Date Time: null

2019-07-16 23:08:13,394 INFO [Thread-0] (Controller.java:331) - Upload Temperature: true

2019-07-16 23:08:13,396 INFO [Thread-0] (Controller.java:332) - Upload Voltage: true

2019-07-16 23:08:13,398 INFO [Thread-0] (Controller.java:333) - Energy Generation: -1

2019-07-16 23:08:13,400 INFO [Thread-0] (Controller.java:334) - Energy Consumption: -1

2019-07-16 23:08:13,404 INFO [Thread-0] (Controller.java:335) - Create Local Graph: true

2019-07-16 23:08:13,406 INFO [Thread-0] (Controller.java:336) - Retry Limit: 60 to 80

2019-07-16 23:08:13,407 INFO [Thread-0] (Controller.java:337) - --------------------------

2019-07-16 23:08:13,438 INFO [Thread-0] (Controller.java:372) - Loaded Reader 1: powerwall

2019-07-16 23:08:13,440 INFO [Thread-0] (Controller.java:373) - Log Directory 1: [/logs]

2019-07-16 23:08:13,442 INFO [Thread-0] (Controller.java:384) - Loading Config 1: powerwall.ini

2019-07-16 23:08:13,446 INFO [Thread-0] (SimpleLogReader.java:428) - Read 0 log entries

2019-07-16 23:08:13,455 INFO [Thread-0] (AHttpLogReader.java:80) - URL 1: https://192.168.2.200/api/meters/aggregates

2019-07-16 23:08:13,464 INFO [Thread-0] (AHttpLogReader.java:97) - Poll Frequency: 300 seconds

2019-07-16 23:08:13,466 INFO [Thread-0] (AHttpLogReader.java:119) - v7 mapped: battery.instant_power

2019-07-16 23:08:13,468 INFO [Thread-0] (AHttpLogReader.java:125) - v8 mapped: load.energy_imported

2019-07-16 23:08:13,469 INFO [Thread-0] (AHttpLogReader.java:131) - v9 mapped: solar.energy_exported

2019-07-16 23:08:13,471 INFO [Thread-0] (AHttpLogReader.java:137) - v10 mapped: site.instant_apparent_power

2019-07-16 23:08:13,473 INFO [Thread-0] (AHttpLogReader.java:143) - v11 mapped: load.frequency

2019-07-16 23:08:13,475 INFO [Thread-0] (AHttpLogReader.java:149) - v12 mapped: load.instant_total_current

2019-07-16 23:08:13,499 INFO [Thread-0] (AHttpLogReader.java:189) - Id: 0, sensor: 0, channels: [], direction: Export, calibration: 1.0

2019-07-16 23:08:13,512 INFO [Thread-9] (WebClient.java:243) - >>> https://192.168.2.200:443/api/meters/aggregates

2019-07-16 23:08:13,523 INFO [Thread-0] (Controller.java:435) - Found 1 Sensors

2019-07-16 23:08:13,529 INFO [Thread-0] (Controller.java:536) - Added Reader: powerwall0

2019-07-16 23:08:13,542 INFO [Thread-0] (Controller.java:560) - Log File: powerwall0 [PW0-2019-07-16.log]

2019-07-16 23:08:13,545 INFO [Thread-0] (Controller.java:572) - Export Sensor: 0, id: 0

2019-07-16 23:08:13,589 INFO [Thread-0] (Controller.java:579) - Service: [http://pvoutput.org:80/service/r2/addbatchstatus.jsp] Test: false, End: 20:00

2019-07-16 23:08:13,590 INFO [Thread-0] (Controller.java:587) - Loaded 1 Readers (Import: 0, Export: 1)

2019-07-16 23:08:15,593 INFO [Thread-0] (Controller.java:731) - Startup Complete: Waiting for data…

2019-07-16 23:08:16,648 INFO [Thread-9] (DefaultRequestDirector.java:586) - I/O exception (java.net.NoRouteToHostException) caught when connecting to the target host: Host is unreachable (Host unreachable)

2019-07-16 23:08:16,650 INFO [Thread-9] (DefaultRequestDirector.java:593) - Retrying connect

2019-07-16 23:08:19,650 INFO [Thread-9] (DefaultRequestDirector.java:586) - I/O exception (java.net.NoRouteToHostException) caught when connecting to the target host: Host is unreachable (Host unreachable)

2019-07-16 23:08:19,651 INFO [Thread-9] (DefaultRequestDirector.java:593) - Retrying connect

2019-07-16 23:08:22,656 INFO [Thread-9] (DefaultRequestDirector.java:586) - I/O exception (java.net.NoRouteToHostException) caught when connecting to the target host: Host is unreachable (Host unreachable)

2019-07-16 23:08:22,657 INFO [Thread-9] (DefaultRequestDirector.java:593) - Retrying connect

2019-07-16 23:08:25,667 ERROR [Thread-9] (AHttpLogReader.java:463) - Http Error

java.net.NoRouteToHostException: Host is unreachable (Host unreachable)

at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)

at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)

at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)

at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)

at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:322)

at java.base/java.net.Socket.connect(Socket.java:591)

at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:285)

at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:375)

at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)

at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)

at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)

at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:573)

at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)

at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)

at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)

at org.pvoutput.integration.reader.AHttpLogReader$ASimpleLogFileWriter.get(AHttpLogReader.java:430)

at org.pvoutput.integration.reader.AHttpLogReader$ASimpleLogFileWriter.run(AHttpLogReader.java:354)

OK, the answer is pretty simple – my account, even though it was in the administrator group, did not have permission to run certain network commands at root privileges. If I “sudo ping 192.168.2.200” then everything worked fine from the terminal. Who knew that “ping” would be a restricted command!

So…had to log in as Admin, and run the docker image as Admin. It’s running now and I’ll see if it produces good data.

I’ll probably end up running two, one for solar generation and one for consumption, but for now I just want to see solar production.

1 Like

@pvpvpw

Sorry I didnt get a chance to reply to your message, I set this up for my brother who runs a powerwall and he does the same as you, he runs two instances, one for generation and one for consumption, i can modify the docker to run two instances in one image, but its probably cleaner to leave it as is and just run 2 dockers.

If anyone is interested for me to expose other config files in the config directory let me know.

1 Like

Sure, please do share that. I’ve not gotten around to setting up the second one…spent my time getting a Sense installed instead. That’s been fun, but haven’t tried interfacing to it.

In case anyone is interested I have updated the docker image to 1.5.5.1

Also I have an experimental image tagged ‘dual’ that will run 2 instances so you can have generation and usage on the same docker image, fair warning i have done some preliminary sanity checks but seems to work fine. If you decide to test it, i recommend you back up your configuration directory as it will move any config files it finds to the ‘in’ directory, you will of course have to configure the ‘out’ directory with the correct parameters.

Hope that helps!

1 Like