mumblebaj / MMM-Growatt

MagicMirror² module - To get and display Growatt Inverter information on you MM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blank Screen.

Paul-Sysum opened this issue · comments

Hi. I am getting a blank screen as well. I have updated my Magic Mirror software and followed all the installation steps as show but still nothing. Could it be because I have two sets of plant running on my Growatt account? I did try putting the extra config lines in with the serial number and plant number but im at a bit of a loose to find my plant number? Any pointers would be much appreciated.

Hi Paul. What Inverter are you using? I need to be able to get to the data that is returned from Growatt to see if it is returning the data that the module expects. I am going to update the module to add some debug capabilities so that we can get all the data written out that we receive back from Growatt. I am currently only supporting a single Power Plant in the module but am looking at extending it to multiple Power Plant support. I only have a single Power Plant myself and may ask for some data from you so I can set it up for multiple plant support if that is ok with you. I will drop a note on here to advise when I have made updates.

Hi Paul. Can you make the following changes to the node_helper.js file?

At the top of the node_helper.js add the following to match the screenshot below

var fs = require('fs')
var os = require('os')

image

In the function deconstrucPlantData I need you to add the below lines to match the screenshot below:

        var growattlog = `${__dirname}/growatt.log`

        if(fs.existsSync(growattlog)) {
                console.log("File Exists")
        } else {
                fs.writeFile(growattlog, "Growatt Log File" + os.EOL, function (err) {
                if (err) throw err;
                console.log("File created")
                });
        }
        var plantidData = `Plant Id: ${plantId}`
        var loggeridData = `Logger ID: ${loggerId}`
        fs.appendFile(growattlog, plantidData + os.EOL, function (err) {
                if (err) throw err;
                })
        fs.appendFile(growattlog, loggeridData + os.EOL, function (err) {
                if (err) throw err;
                })
        fs.appendFile(growattlog, JSON.stringify(d, null, 2) + os.EOL, function (err) {
                if (err) throw err;
                })

image

The above will create new file called growattlog.log in the MMM-Growatt folder. I need you to send me the details as logged in that file. You can send it to me at bernard.mumble@gmail.com or post it here.

Hi Paul

I received the data. Thanks for that. What I have noticed from the data that you sent me is that your logger, same as the other issue, does not send statusData. The statusData is what is used to construct the module data.

This is what my logger sends to the server and I am able to obtain the data from the server.

     ```
   "statusData": {
          "vPv2": "0",
          "deviceType": "3",
          "gridPower": "0",
          "loadPower": "10",
          "vPv1": "312.8",
          "fAcOutput": "49.8",
          "invStatus": "-10",
          "ppv2": "0",
          "vBat": "50.8",
          "loadPrecent": "0.2",
          "panelPower": "3",
          "batPower": "10",
          "vAcOutput": "230.1",
          "capacity": "99",
          "ppv1": "3",
          "iPv1": "0",
          "iPv2": "0",
          "vAcInput": "233.5",
          "fAcInput": "49.7",
          "iTotal": "0",
          "rateVA": "25",
          "status": "12"
        },

From the statusData, ppv1+ppv2 is what the solar panels are pushing at that point in time. capacity is the state of the batteries, their current SOC. batPower is what the batteries are currently pushing to the house. None of these values are available in the historyLast data other than the ppv1 and ppv2 values. I cannot build a meaningful display with only the ppv1 and ppv2 data.

I am not sure why these loggers are not supplying statusData to your server. As a matter of interest, my logger model is ShineWIFI-S and I have noticed yours and the other user both have the ShineWIFI-X.

Out of Interest, can you logon to https://server.growatt.com and send me a screenshot of the dashboard. The other had a completely different Dashboard than what I had.

This is what mines look like.
image

I am working on a minimal version that would look like the following:
image

This is provided I can obtain all the information from what is returned for your setup.

I am not sure why I am getting the statusData returned and you are not. Not sure if it is related to how your account has been setup on Growatt or if there is something else. Can you also check in node_helper.js that the following value is set to true?
statusData: true

Hi Paul. I have one last request so I can double check the figures returned before creating the new module. Can you set the following option to true totalData: true,

Please email me the extracted information.

please run the following command prior to making the changes:

rm ~/MagicMirror/modules/MMM-Growatt/growat.log.

A new log file will be created. Please email me the new log file data. I want to see if totalData is created for each of the devices or if they are combined into a single set.

Hi Paul. I have created a new module. Can you please clone this one and see if it works for you?
https://github.com/mumblebaj/MMM-Growatt-Stats.git

Let me know if it does or if you have any issues.

HI Paul. I tried creds you posted but I get an error. Please double check and email them direct to me at bernardmumble@gmail.com. I am deleting the post above with your creds, don't want them lying around in the open.

I managed to get in. I can see the dashboard and it has live data feed but the api is not returning that data. I am investigating that now.

Hi Paul. Thanks for letting me use your creds, it has been very helpful in investigating why we are not seeing the data that we require. From the tests that I have done thus far I have found the following.

{
  timezone: '1',
  id: '2080826',
  plantName: 'House',
  plantData: {
    country: 'UnitedKingdom',
    formulaCo2: '0.0',
    accountName: 'RogerTheCat',
    city: 'Gloucester',
    timezone: '1',
    co2: '5490.2',
    creatDate: '2023-06-27',
    formulaCoal: '0.0',
    designCompany: '0',
    fixedPowerPrice: '1.2',
    id: '2080826',
    lat: '51.843',
    valleyPeriodPrice: '1.0',
    lng: '-2.24',
    locationImg: 'null',
    tree: '303',
    peakPeriodPrice: '1.3',
    plantType: '0',
    nominalPower: '4000',
    formulaMoney: '0.0',
    formulaTree: '0.0',
    flatPeriodPrice: '1.1',
    eTotal: '5506.7',
    plantImg: '2080826_1images1690380944.jpg',
    isShare: 'false',
    coal: '2202.7',
    moneyUnit: 'dollar',
    plantName: 'House',
    moneyUnitText: '$'
  },
  devices: {
    CYE3A2502X: {
      totalData: [Object],
      historyLast: [Object],
      deviceData: [Object]
    },
    RNK2CA901X: { deviceData: [Object] }
  }
}

The data that we require the growatt node module does not seem to be calling.
When I manually run the method that it is supposed to call I get the relevant data but no matter how I try and call the module it does not seem to be working.

This is the results from the manual run which is the data that my module requires to build the views. This is valid for both.

{
    "result": 1,
    "obj": {
        "ptoStatus": "592",
        "pdisCharge1": "0",
        "pactouser": "0",
        "vBat": "209.7",
        "SOC1": "0",
        "SOC2": "0",
        "chargePower1": "0",
        "vAc1": "240.8",
        "chargePower2": "0",
        "bdcStatus": "1",
        "pdisCharge": "50",
        "lost": "tlx.status.checking",
        "pactogrid": "53.8",
        "pLocalLoad": "538.3",
        "vPv2": "153.5",
        "vPv3": "0",
        "vPv1": "153.3",
        "chargePower": "0",
        "operatingMode": "0",
        "upsVac1": "0",
        "SOC": "15",
        "pPv2": "267.8",
        "pPv3": "0",
        "fAc": "50",
        "pPv4": "0",
        "vac1": "240.8",
        "vPv4": "0",
        "pPv1": "274.3",
        "upsFac": "0",
        "ppv": "542.1",
        "pdisCharge2": "0",
        "status": "1"
    }
}

If it is ok with you for me to use your creds for a wee while longer I can build a manual call to get the data that we require and populate the module with the correct data.

Hi Paul. I have some progress. This is what I have thus far with your creds.

image

I am still testing all the combinations to ensure that the changes are working fine. Once I have completed that I will release an update.

Hi Paul. I have just pushed an update for this module. It should work for you now.

Moving the icons around is not much of an option. It becomes very difficult to move them as there are so many other things that would need to change along with it, direction of arrows and classes that build the arrows etc.

Hi. Can you please confirm if you have tested the latest updates for this module and the other? I have pushed some updates last night that allows to run both the modules together. If you can please let me know if it works for you so we can either close this issue or if there is any other issues we can have a look at them.

Hi Paul. Not understanding "rage" mirror? The latest updates I made yesterday allows you to run both MMM-Growatt and MMM-Growatt-Stats together. Both modules has to be installed and both added to the config.js file. The new changes let's MMM-Growatt get the data and share it with the MMM-Growatt-Stats module to use to update. If you only run one of the two then it is fine. Modules should work the same but you may need to add the following to the config.js

        {
                module: "MMM-Growatt",
                position: "middle_center",
                disabled: false,
                config: {
                        username: "username",
                        password: "password",
                        mode: "dual",
                        updateInterval: 1000*60*15,
                }
        },

You would need to add the mode and set it to either "single" if you are running only one of the modules or "dual" if you are running both the modules.

No worries. Let me know if you are ok with the module/s and if they are running fine etc.