I simplified this a little.
First, I downloaded the SSL root certificate for my PW2 using openssl:
openssl s_client -showcerts -connect 192.168.1.30:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >mycertfile.pem
I then imported it into Java’s cacert file:
sudo keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -alias PW2 -import -file mycertfile.pem
I then restarted openhab to make sure the new cacert was loaded.
I added the following to services/http.cfg:
http:pw2grid.url=https://192.168.1.30/api/system_status/grid_status
http:pw2grid.updateInterval=60000
http:pw2soe.url=https://192.168.1.30/api/system_status/soe
http:pw2soe.updateInterval=60000
http:pw2aggregates.url=https://192.168.1.30/api/meters/aggregates
http:pw2aggregates.updateInterval=60000
And the following to items:
String Grid_Status "PW2 Grid Status" {http="<[pw2grid:10000:JSONPATH($.grid_status)]" }
Number Battery_SOE "PW2 Battery State" {http="<[pw2soe:10000:JSONPATH(.percentage)]" }
Number:Power PW_InstPower_Site "InstPower Site [%.1f W]" {http="<[pw2aggregates:10000:JSONPATH($.site.instant_power)]" }
Number:Power PW_InstPower_Battery "InstPower Battery [%.1f W]" {http="<[pw2aggregates:10000:JSONPATH($.battery.instant_power)]" }
Number:Power PW_InstPower_Load "InstPower Load [%.1f W]" {http="<[pw2aggregates:10000:JSONPATH($.load.instant_power)]" }
Number:Power PW_InstPower_Solar "InstPower Solar [%.1f W]" {http="<[pw2aggregates:10000:JSONPATH($.solar.instant_power)]" }
Number:Energy PW_EnergyExported_Site "EnergyExported Site [%.1f Wh]" {http="<[pw2aggregates:10000:JSONPATH($.site.energy_exported)]" }
Number:Energy PW_EnergyImported_Site "EnergyImported Site [%.1f Wh]" {http="<[pw2aggregates:10000:JSONPATH($.site.energy_imported)]" }
Number:Energy PW_EnergyExported_Battery "EnergyExported Battery [%.1f Wh]" {http="<[pw2aggregates:10000:JSONPATH($.battery.energy_exported)]" }
Number:Energy PW_EnergyImported_Battery "EnergyImported Battery [%.1f Wh]" {http="<[pw2aggregates:10000:JSONPATH($.battery.energy_imported)]" }
Number:Energy PW_EnergyExported_Load "EnergyExported Load [%.1f Wh]" {http="<[pw2aggregates:10000:JSONPATH($.load.energy_exported)]" }
Number:Energy PW_EnergyImported_Load "EnergyImported Load [%.1f Wh]" {http="<[pw2aggregates:10000:JSONPATH($.load.energy_imported)]" }
Number:Energy PW_EnergyExported_Solar "EnergyExported Solar [%.1f Wh]" {http="<[pw2aggregates:10000:JSONPATH($.solar.energy_exported)]" }
Number:Energy PW_EnergyImported_Solar "EnergyImported Solar [%.1f Wh]" {http="<[pw2aggregates:10000:JSONPATH($.solar.energy_imported)]" }
…and voila ![]()
Cheers,
Paul