Skip to content

linuxtuxie/MMM-SunnyPortal

Repository files navigation

MagicMirror Module: SunnyPortal

Display your SunnyPortal Solar Panel Inverter output

Status Version Date
Working 1.4.0 2021-01-03

What is this module doing?

MMM-SunnyPortal is a MagicMirror module for displaying the current, monthly, yearly and total power output of your SunnyPortal Solar Panels.

Example Screenshots

Module Screenshot:

Full

The displayed data shown above is fetched through the SunnyPortal website SunnyPortal

Full


Dependencies

This module depends on the following npm packages:

  • request - Simplified HTTP client
  • flow - Makes it easy to express multi-step asynchronous logic in Node or the browser
  • chartjs - Simple yet flexible JavaScript charting for designers & developers.
  • sslkeylog - sslkeylog is a module for easy generation of SSLKEYLOG files, which can be used later by Wireshark to decrypt SSL connections.

These are also listed in the package.json file and should be installed automatically when using npm. However, those may require other packages.


Installation

Manual Installation:

cd ~/MagicMirror/modules
git clone https://github.com/linuxtuxie/MMM-SunnyPortal.git
cd MMM-SunnyPortal

Next install the dependencies: request, flow and chartjs, by running:

npm install request --save
npm install flow --save
npm install chart.js --save

Alternatively, on a unix based distribution, you can try to install all the above mentioned dependencies with the Bash script:

chmod 755 install_deps.sh
./install_deps.sh

Configuration

To configure the SunnyPortal module, you need to do the following:

  1. Add the Module to the global MagicMirror config.js
  2. Edit the global config to add the username and password values for your SunnyPortal installation
  3. [optional] Modify MMM-SunnyPortal.css to your own CSS taste
  4. [optional] Add your own language translation file in the translations folder (currently english, dutch, french and german are provided)

Add this module to the modules array in the config/config.js file by adding the following example section.
You must include your SunnyPortal username and password, you can edit the config to include any of the configuration options described below.

{
    module: 'MMM-SunnyPortal',
    position: 'bottom_left',
    header: 'Solar Panels',
    config: {
    	url: 'https://www.sunnyportal.com',
        updateInterval: 900,
        username: '',             //Required: Your Sunnyportal Username
        password: '',             //Required: Your Sunnyportal Password
        width: 500,
        height: 400,
        chartcolor1: '#121212',
        chartcolor2: '#909090',
        convertUnits: true,
        includeGraphs: ['all'],
    }
},

Configuration Options

Option Description
url An alternative URL to the SunnyPortal website.
Optional
Default value: https://www.sunnyportal.com
updateInterval Module data update rate. [in seconds]
Optional
Default and minimum value: 900 (a lower value is ignored)
username Your Sunnyportal 'Username'
Required
password Your SunnyPortal 'Password'
Required
width The width of the module.
Optional
Default value: 500
height The height of the module.
Optional
Default value: 400
chartcolor1
chartcolor2
The graphs have a gradient color. You can set chartcolor1 and chartcolor2 to any HEX code, HTML name or RGB code.
Set both to the same color code to have a solid graph without a gradient.
Optional, example values: 'red', '#FF00FF', 'rgb(255,255,255)'
Default values: chartcolor1: '#121212', chartcolor2: '#909090'
convertUnits Convert kwH to MWh if needed
Optional, possible values: true, false
Default value: true
includeGraphs Takes an array with the graphs to include.
The array can have 1, 2, 3 or 4 elements.
Using ['All'] is equal to ['Day', 'Month', 'Year', 'Total']
Example: ['Month', 'Day'] displays the 2 graphs in that order
Possible values: ['all'] or any combination of ['day', 'month', 'year', 'total'] (case insensitive)
Default ['All']

⚠️ Please do not edit the module files to use an updateInterval shorter than 15 minutes (900 seconds). A lower setting can lockout your account on the SunnyPortal URL. The power output on SMA SunnyPortal is always calculated in a time interval of 15 minutes...so there is no need to update in a shorter time interval! There is a check to have a minimum value of 900 seconds. Any lower value is ignored.

Contribution

Feel free to post issues or remarks related to this module.
For all other or general questions, please refer to the MagicMirror Forum.

Credits

I based the code on mkorthuis's sunnyportal-api

License

MIT License

About

MMM-SunnyPortal is a [MagicMirror] module for displaying the current, monthly and yearly power output of your SunnyPortal Solar Panels

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published