Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion APS1.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///////// Plugin to extract APS data for Toon ///////////////
///////// By Oepi-Loepi ///////////////

function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getAPSData")
userName = encodeURIComponent(userName)
passWord = encodeURIComponent(passWord)
Expand Down
2 changes: 1 addition & 1 deletion CSI1.plugin(oud).txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
///////// By Oepi-Loepi ///////////////


function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getSolarData")
var data = "value=" + passWord;

Expand Down
2 changes: 1 addition & 1 deletion CSI1.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function sha256(ascii) {
}


function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getSolarData")
var newHash = sha256(passWord);
if (debugOutput) console.log("*********SolarPanel new function sha256: " + newHash)
Expand Down
2 changes: 1 addition & 1 deletion DELTA1.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
///////// By Oepi-Loepi ///////////////


function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getSolarData")
var xhr = new XMLHttpRequest()
xhr.withCredentials = true;
Expand Down
6 changes: 3 additions & 3 deletions DOM-DOUBLE1.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///////// Plugin to extract Domoticz (Double) Solar data for Toon ///////////////
///////// By Oepi-Loepi ///////////////

function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
var arraynew = apiKey.split("+")
var firstIDX
var secondIDX
Expand All @@ -18,11 +18,11 @@
secondIDX = arraynew[1].trim()
number = 2
}
getStep2(number,firstIDX,secondIDX,urlString,totalValue)
getStep2(number,firstIDX,secondIDX,urlString,useSSL,totalPower)

}

function getStep2(number,firstIDX,secondIDX,urlString,totalValue){
function getStep2(number,firstIDX,secondIDX,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getDomoticzData")
var http = new XMLHttpRequest();
http.open("GET", "http://" + urlString + "/json.htm?type=devices&rid=" + firstIDX, true)
Expand Down
5 changes: 3 additions & 2 deletions DOMOTICZ1.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
///////// Plugin to extract Domoticz Solar data for Toon ///////////////
///////// By Oepi-Loepi ///////////////

function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getDomoticzData")
var http = new XMLHttpRequest();
http.open("GET", "http://" + urlString + "/json.htm?type=devices&rid=" + apiKey, true)
var protocol = (useSSL == true) ? 'https' : 'http'
http.open("GET", protocol + "://" + urlString + "/json.htm?type=devices&rid=" + apiKey, true)
http.onreadystatechange = function() {
if (http.readyState == XMLHttpRequest.DONE) {
if (http.status === 200 || http.status === 300 || http.status === 302) {
Expand Down
6 changes: 3 additions & 3 deletions ENPHASE-T1.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///////// Plugin to extract Enphase Solar data for Toon ///////////////
///////// By Oepi-Loepi /////////////

function getSolarData(passWord,userName,sessionID,siteid,urlString,totalValue){
function getSolarData(passWord,userName,sessionID,siteid,urlString,useSSL,totalPower){
var sessionID = apiKey
if (debugOutput) console.log("*********SolarPanel Start getSolarData")
getEnphaseStep1(urlString,passWord,userName,sessionID);
Expand Down Expand Up @@ -66,7 +66,7 @@ function parseEnpaseInfo(urlString,passWord,userName,sessionID,totalValue){
}

if (envoyfirmware === 'D5'){
getD5data(urlString,totalValue)
getD5data(urlString,useSSL,totalPower)
}

}
Expand Down Expand Up @@ -289,7 +289,7 @@ function startLogin(passWord,userName,urlString,envoyserial,envoyfirmware, total
}


function getD5data(urlString,totalValue){
function getD5data(urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getD5data")
var http = new XMLHttpRequest()
var url = "http://" + urlString + "/production.json"
Expand Down
2 changes: 1 addition & 1 deletion ENPHASE1-D7.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@



function getSolarData(passWord,userName,apiKeyPlugin,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKeyPlugin,siteid,urlString,useSSL,totalPower){

if (debugOutput) console.log("*********SolarPanel Start getSolarData")
var http = new XMLHttpRequest()
Expand Down
2 changes: 1 addition & 1 deletion ENPHASE1.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///////// Plugin to extract Enphase Solar data for Toon ///////////////
///////// By Oepi-Loepi ///////////////

function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getEnphaseData")
var http = new XMLHttpRequest();
http.open("GET", "http://" + urlString + "/api/v1/production", true)
Expand Down
2 changes: 1 addition & 1 deletion ENPHASE2.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///////// Plugin to extract Enphase Solar data for Toon ///////////////
///////// By Oepi-Loepi ///////////////

function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getEnphaseData")
var http = new XMLHttpRequest();
var url = "https://api.enphaseenergy.com/api/v2/systems/" + siteid+ "/summary?key=" + apiKey + "&user_id=" + userName
Expand Down
2 changes: 1 addition & 1 deletion ENPHASEV4-2.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@



function getSolarData(passWord,userName,apiKeyPlugin,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKeyPlugin,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getSolarData")
var sessionID = apiKeyPlugin
var http = new XMLHttpRequest()
Expand Down
6 changes: 3 additions & 3 deletions ENPHASEV4.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}


function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getSolarData")
var base64encoded =base64Encode(userName + ":" + passWord);
if (debugOutput) console.log("*********SolarPanel base64encoded: " + base64encoded)
Expand All @@ -57,7 +57,7 @@
enphaseV4Access_token = JsonObject.access_token
enphaseV4Refresh_token = JsonObject.refresh_token
solarPanel_enphaseV4Refresh_token.write(JsonObject.refresh_token)
getStep2(passWord,userName,apiKey,siteid,urlString,totalValue);
getStep2(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower);
}
catch (e){
currentPower = 0
Expand All @@ -73,7 +73,7 @@
}


function getStep2(passWord,userName,apiKey,siteid,urlString,totalValue){
function getStep2(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getStep2")
var http = new XMLHttpRequest()
var url = "https://api.enphaseenergy.com/api/v4/systems/" + siteid + "/summary?key=" + apiKey
Expand Down
2 changes: 1 addition & 1 deletion FOX1.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///////// Plugin to extract FoxCloud Solar data for Toon ///////////////
///////// By Oepi-Loepi ///////////////

function getSolarData(passWord,userName,apiKeyPlugin,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKeyPlugin,siteid,urlString,useSSL,totalPower){

if (debugOutput) console.log("*********SolarPanel Start getSolarData")
if (debugOutput) console.log("*********SolarPanel Start getSolarData apiKey: " + apiKeyPlugin)
Expand Down
2 changes: 1 addition & 1 deletion FP4ALL.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///////// Plugin to extract FP4ALL Solar data for Toon ///////////////
///////// By Oepi-Loepi ///////////////

function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getFP4ALLData")
var http = new XMLHttpRequest();
http.open("GET", "http://" + urlString + "/status.xml", true)
Expand Down
2 changes: 1 addition & 1 deletion FRONIUS1.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///////// Plugin to extract Fronius Solar data for Toon ///////////////
///////// By Oepi-Loepi ///////////////

function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getFroniusData")
var http = new XMLHttpRequest();
http.open("GET", "http://" + urlString + "/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceID=1&DataCollection=CommonInverterData", true)
Expand Down
2 changes: 1 addition & 1 deletion GOODWE1.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///////// Plugin to extract Goodwe Solar data for Toon ///////////////
///////// By Oepi-Loepi ///////////////

function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getSolarDataStep1")
var http = new XMLHttpRequest()
var url = "https://www.semsportal.com/api/v1/Common/CrossLogin";
Expand Down
2 changes: 1 addition & 1 deletion GOODWE2.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///////// Plugin to extract Goodwe Solar data for Toon ///////////////
///////// By Oepi-Loepi ///////////////

function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getSolarDataStep1")
var http = new XMLHttpRequest()
var url = "https://www.semsportal.com/api/v1/Common/CrossLogin";
Expand Down
168 changes: 84 additions & 84 deletions GROW1.plugin.txt
Original file line number Diff line number Diff line change
@@ -1,85 +1,85 @@
///////// <version>1.0.13</version>
///////// GROW1 /////////////
///////// Plugin to extract Growatt Solar data for Toon ///////////////
///////// By Oepi-Loepi ///////////////
function getSolarData(passWord,userName,apiKey,siteid,urlString,totalValue){
if (debugOutput) console.log("*********SolarPanel Start getGrowattStep1")
//modified hash : if first of pairs is 0 then replace by c
var newpass= Qt.md5(passWord)
var newString =""
for(var x = 0;x < newpass.length ;x++){
if ((x%2 == 0) && newpass[x] == "0") {
newString += "c"
}
else{
newString += newpass[x]
}
}
var params = "password=" + newString + "&userName=" + userName
var http = new XMLHttpRequest()
var url2 = "https://server-api.growatt.com/newTwoLoginAPI.do"
console.log("*********SolarPanel url2" + url2)
http.open("POST", url2, true)
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
http.setRequestHeader("Content-length", params.length)
http.setRequestHeader("Connection", "keep-alive")
http.setUserAgent = "ShinePhone/5.92 (iPad; iOS 14.6; Scale/2.00)"
http.onreadystatechange = function() { // Call a function when the state changes.
if (http.readyState === 4) {
if (http.status === 200) {
var JsonString = http.responseText
if (debugOutput) console.log("*********SolarPanel JsonString " + JsonString)
var JsonObject= JSON.parse(JsonString)
getGrowattStep2();
} else {
if (debugOutput) console.log("*********SolarPanel getGrowattStep2 http.status " + http.status)
currentPower = 0
parseReturnData(0,totalValue,0,0,0,0,0, http.status,"error")
}
}
}
http.send(params);
}
function getGrowattStep2(){
if (debugOutput) console.log("*********SolarPanel Start getGrowattStep3")
var http = new XMLHttpRequest()
var params = "language=5"
var url2 = "https://server-api.growatt.com/newPlantAPI.do?action=getUserCenterEnertyDataTwo"
console.log("*********SolarPanel url2 " + url2)
http.open("GET", url2, true)
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
http.setRequestHeader("Content-length", params.length)
http.setRequestHeader("Connection", "keep-alive")
http.setUserAgent = "ShinePhone/5.92 (iPad; iOS 14.6; Scale/2.00)"
http.onreadystatechange = function() { // Call a function when the state changes.
if (http.readyState === 4) {
if (http.status === 200) {
try {
var JsonString = http.responseText
if (debugOutput) console.log("*********SolarPanel JsonString " + JsonString)
var JsonObject= JSON.parse(JsonString)
currentPower = parseInt(JsonObject.powerValue)
if (debugOutput) console.log("currentPower: " + currentPower)
var today2 = Math.floor((JsonObject.todayValue)*1000)
if (debugOutput) console.log("today2: " + today2)
totalValue= Math.floor((JsonObject.totalValue)*1000)
if (debugOutput) console.log("totalValue: " + totalValue)
//getGrowattStep3()
parseReturnData(currentPower,totalValue,today2,0,0,0,0,http.status,"succes")
}
catch (e){
currentPower = 0
parseReturnData(0,totalValue,0,0,0,0,0, http.status,"error")
}
} else {
if (debugOutput) console.log("*********SolarPanel getGrowattStep3 http.status " + http.status)
parseReturnData(0,totalValue,0,0,0,0,0, http.status,"error")
}
}
}
http.send(params);
///////// <version>1.0.13</version>
///////// GROW1 /////////////
///////// Plugin to extract Growatt Solar data for Toon ///////////////
///////// By Oepi-Loepi ///////////////

function getSolarData(passWord,userName,apiKey,siteid,urlString,useSSL,totalPower){
if (debugOutput) console.log("*********SolarPanel Start getGrowattStep1")
//modified hash : if first of pairs is 0 then replace by c
var newpass= Qt.md5(passWord)
var newString =""
for(var x = 0;x < newpass.length ;x++){
if ((x%2 == 0) && newpass[x] == "0") {
newString += "c"
}
else{
newString += newpass[x]
}
}
var params = "password=" + newString + "&userName=" + userName
var http = new XMLHttpRequest()
var url2 = "https://server-api.growatt.com/newTwoLoginAPI.do"
console.log("*********SolarPanel url2" + url2)
http.open("POST", url2, true)
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
http.setRequestHeader("Content-length", params.length)
http.setRequestHeader("Connection", "keep-alive")
http.setUserAgent = "ShinePhone/5.92 (iPad; iOS 14.6; Scale/2.00)"
http.onreadystatechange = function() { // Call a function when the state changes.
if (http.readyState === 4) {
if (http.status === 200) {
var JsonString = http.responseText
if (debugOutput) console.log("*********SolarPanel JsonString " + JsonString)
var JsonObject= JSON.parse(JsonString)
getGrowattStep2();
} else {
if (debugOutput) console.log("*********SolarPanel getGrowattStep2 http.status " + http.status)
currentPower = 0
parseReturnData(0,totalValue,0,0,0,0,0, http.status,"error")
}
}
}
http.send(params);
}



function getGrowattStep2(){
if (debugOutput) console.log("*********SolarPanel Start getGrowattStep3")
var http = new XMLHttpRequest()
var params = "language=5"
var url2 = "https://server-api.growatt.com/newPlantAPI.do?action=getUserCenterEnertyDataTwo"
console.log("*********SolarPanel url2 " + url2)
http.open("GET", url2, true)
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
http.setRequestHeader("Content-length", params.length)
http.setRequestHeader("Connection", "keep-alive")
http.setUserAgent = "ShinePhone/5.92 (iPad; iOS 14.6; Scale/2.00)"
http.onreadystatechange = function() { // Call a function when the state changes.
if (http.readyState === 4) {
if (http.status === 200) {
try {
var JsonString = http.responseText
if (debugOutput) console.log("*********SolarPanel JsonString " + JsonString)
var JsonObject= JSON.parse(JsonString)
currentPower = parseInt(JsonObject.powerValue)
if (debugOutput) console.log("currentPower: " + currentPower)
var today2 = Math.floor((JsonObject.todayValue)*1000)
if (debugOutput) console.log("today2: " + today2)
totalValue= Math.floor((JsonObject.totalValue)*1000)
if (debugOutput) console.log("totalValue: " + totalValue)
//getGrowattStep3()
parseReturnData(currentPower,totalValue,today2,0,0,0,0,http.status,"succes")
}
catch (e){
currentPower = 0
parseReturnData(0,totalValue,0,0,0,0,0, http.status,"error")
}
} else {
if (debugOutput) console.log("*********SolarPanel getGrowattStep3 http.status " + http.status)
parseReturnData(0,totalValue,0,0,0,0,0, http.status,"error")
}
}
}
http.send(params);
}
5 changes: 3 additions & 2 deletions HOMEASSISTANT1.plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

//////// v1.0.2 changed http to https

function getSolarData(password, username, apiKey, siteId, urlString, totalPower) {
function getSolarData(password, username, apiKey, siteId, urlString, useSSL, totalPower) {
if (debugOutput) console.log("*********SolarPanel Start getHomeAssistantData")
var url = "https://" + urlString + "/api/states/sensor.solar_panel"
var protocol = (useSSL == true) ? 'https' : 'http'
var url = protocol + "://" + urlString + "/api/states/sensor.solar_panel"
var http = new XMLHttpRequest();
if (debugOutput) console.log("*********SolarPanel HA url " + url)
http.open("GET", url, true)
Expand Down
Loading