linuxtuxie / MMM-SunnyPortal

MMM-SunnyPortal is a [MagicMirror] module for displaying the current, monthly and yearly power output of your SunnyPortal Solar Panels
MIT License
4 stars 4 forks source link

Only show "Loading" #3

Closed solbadguy2010 closed 3 years ago

solbadguy2010 commented 4 years ago

No Data is shown. Only "Loading..." Depencies are installed, double checked my login. Any Idea whats wrong?

Thank you!

linuxtuxie commented 4 years ago

Hi,

Can you provide the out & error log of your MagicMirror installation? The MMM-SunnyPortal module writes detailed info in these files, in this way we can try to figure out where it goes wrong

Both logfiles can be found at the /home/pi/.pm2/logs and will probably be named MagicMirror-error.log & MagicMirror-out.log

The following page can help in gathering the debug info https://github.com/MichMich/MagicMirror/wiki/Module-Debugging

Regards, LinuxTuxie

solbadguy2010 commented 4 years ago

Hi, i checked both log files. The error log repeats this error:

[2020-08-29 23:03:09.761] [ERROR]  TypeError: Cannot read property '1' of null
    at Request._callback (/home/pi/MagicMirror/modules/MMM-SunnyPortal/node_helper.js:134:121)
    at Request.self.callback (/home/pi/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:185:22)
    at Request.emit (events.js:200:13)
    at Request.<anonymous> (/home/pi/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:200:13)
    at IncomingMessage.<anonymous> (/home/pi/MagicMirror/modules/MMM-SunnyPortal/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:288:20)
    at IncomingMessage.emit (events.js:205:15)
    at endReadableNT (_stream_readable.js:1154:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:9)

I deleted the logs, restarted Magic Mirror and attach the new logs without clutter. I also attach a Screenshot. Bildschirmfoto 2020-08-30 um 20 42 00 MagicMirror-out.log MagicMirror-error.log

linuxtuxie commented 4 years ago

Hi,

It seems that your installation is redirecting you to a page which is not yet known by our module. Currently we have figured out the mentioned redirect pages as listed in the MagicMirror-out.log

[2020-08-30 20:39:51.580] [LOG]    Login Failed, no redirect to any of the known url's /FixedPages/Dashboard.aspx, /Templates/UserProfile.aspx, /FixedPages/HoManEnergyRedesign.aspx
[2020-08-30 20:39:51.582] [LOG]    You are being redirected to the yet unkown url: /FixedPages/HoManLive.aspx

Can you change line 19 in the node_helper.js from

var NEXT_URL = ['/FixedPages/Dashboard.aspx', '/Templates/UserProfile.aspx', '/FixedPages/HoManEnergyRedesign.aspx'];

to

var NEXT_URL = ['/FixedPages/Dashboard.aspx', '/Templates/UserProfile.aspx', '/FixedPages/HoManEnergyRedesign.aspx', '/FixedPages/HoManLive.aspx'];

And let us know the results?

Regards, LinuxTuxie

solbadguy2010 commented 4 years ago

I changed the node_helper.js. Now it shows "No Data" instead of "Loading".

By the way, did you know that you can change the redirect page in the Sunny Portal? I also tried to change my "System home page" to "/FixedPages/Dashboard.aspx". Same result: "No Data".

I attach Screenshots of everything and the new logs. Bildschirmfoto 2020-08-30 um 22 05 04 Bildschirmfoto 2020-08-30 um 22 04 51 Bildschirmfoto 2020-08-30 um 22 06 39 MagicMirror-out.log MagicMirror-error.log

solbadguy2010 commented 4 years ago

Correcting myself. It simply needed some time. Now it Bildschirmfoto 2020-08-30 um 22 13 46 seems to work.

linuxtuxie commented 4 years ago

By the way, did you know that you can change the redirect page in the Sunny Portal?

That's nice to know, however my installation does not allow me to change these settings; I do not have a 'Configuration' section. I suspect that the type of installation determines what features are visible to the end user. Probably the installer will have access to those settings...but that's just a guess of mine.

Below you can see the output of the installation where I have access to

image

Would it be possible to provide me a list of all the url's listed in the below screenshot? In this way we can update the NEXT_URL variable with these url's so that future users do not bump into the redirect issue

image

I also see that you are using the german language in your MMM-SunnyPortal setup, could you also provide me your json language translation file?

Regards, LinuxTuxie

solbadguy2010 commented 4 years ago

I think you can't see these settings because you are not the "Plant Administrator". Here a Screenshot from my usermanagement. The Upmost is my wife. Second the company that installed the PV and the last is my user. You should talk to your installer to elevate you.

Bildschirmfoto 2020-08-30 um 23 21 12

Here are the URLs in order of my Screenshot: https://www.sunnyportal.com/FixedPages/Dashboard.aspx https://www.sunnyportal.com/FixedPages/PlantProfile.aspx https://www.sunnyportal.com/FixedPages/HoManLive.aspx https://www.sunnyportal.com/FixedPages/HoManEnergyRedesign.aspx

https://www.sunnyportal.com/Homan/ConsumerBalance#/day/1598745600000 -> If i delete "/day/1598745600000" from this url it brings me back to the current day, so i think you only need: https://www.sunnyportal.com/Homan/ConsumerBalance#

https://www.sunnyportal.com/FixedPages/YearComparison.aspx https://www.sunnyportal.com/Templates/PlantMonitoring.aspx https://www.sunnyportal.com/FixedPages/AnalysisTool.aspx

The Last three all use: https://www.sunnyportal.com/Templates/DefaultPage.aspx

You should also be able to see all these URLs by clicking the menu options available to you in your menu and copy them from the browser.

solbadguy2010 commented 4 years ago

Oh, and regarding the language file: I did not change any file. I simply changed the Language parameter in my Magic Mirror config to "de". All stock. Should i still send you the german language file?

linuxtuxie commented 4 years ago

Oh, and regarding the language file: I did not change any file. I simply changed the Language parameter in my Magic Mirror config to "de". All stock. Should i still send you the german language file?

It would be great if you could translate the following entries. These entries are used in the module and are mainly shown below the graphs.

{
  "LOADING": "Loading....",
  "NODATA": "No data!",
  "DAYOUTPUT": "Day output: ",
  "MONTHOUTPUT": "Month output: ",
  "YEAROUTPUT": "Year output: ",
  "TOTALOUTPUT": "Total output: "
}

Thanks, LinuxTuxie

solbadguy2010 commented 4 years ago

No Problem. Here you go:

{ "LOADING": "Lade....", "NODATA": "Keine Daten!", "DAYOUTPUT": "Tagesertrag: ", "MONTHOUTPUT": "Monatsertrag: ", "YEAROUTPUT": "Jahresertrag: ", "TOTALOUTPUT": "Gesamtertrag: " }