schris88 / MMM-Hoymiles-Wifi

GNU General Public License v3.0
1 stars 1 forks source link

MMM-Hoymiles

MagicMirror module for Hoymiles Wifi inverter info

Project Status

This module is still under development.
It might not work, can show incorrect results, will lack some counters, etc.

Test environment:

TODO:

Installation

Installation can be done using the original repository or the develop repository.

Main master repository:

cd ~/MagicMirror/modules/
git clone https://github.com/schris88/MMM-Hoymiles-Wifi

Main develop repository:

cd ~/MagicMirror/modules/
git clone https://github.com/evroom/MMM-Hoymiles-Wifi

Config Example

Edit the file ~/MagicMirror/config/config.js to add or modify the module.

{
  module: "MMM-Hoymiles-Wifi",
  position: "top_left",
  config: {
    width: "300px",
    height: "320px",
    updateInterval: 60000, // in milli seconds
    frames : [
      { src: 'http://127.0.0.1:5000' },
    ]
  },
},

Hoymiles Example

mmm-hoymiles

Python Requirements

Install all Python requirements:

pip install -r requirements.txt

If you see this error:

error: externally-managed-environment

then try this:

python -m pip install -r requirements.txt --break-system-packages

Enter DTU IP address of DTU

Use you favorite editor to make the change (here nano).

nano HoymilesWifi.sh

Line to edit:

python hoymiles_data.py --dtu_ip_address <DTU_HOST_IP>

Where <DTU_HOST_IP> is the IP address of the DTU.

To turn on debugging:

python hoymiles_data.py --dtu_ip_address <DTU_HOST_IP> --debug

Start Flask server by running HoymilesWifi.sh or add it to pm2

To start HoymilesWifi.sh manually:

./HoymilesWifi.sh

To add HoymilesWifi.sh to pm2:

pm2 start HoymilesWifi.sh
pm2 save

Various checks

Verify hoymiles-wifi command:

hoymiles-wifi --host <DTU_HOST_IP> identify-inverters

Where <DTU_HOST_IP> is the IP address of the DTU.

When this message is printed, it means that the inverter is turned off (mostly after sunset):

No response or unable to retrieve response for identify-inverters

Check the HoymilesWifi status:

pm2 status
pm2 info HoymilesWifi

Check the HoymilesWifi log:

pm2 logs HoymilesWifi --lines 100

Make a test run, using a test dataset

Use you favorite editor to make the change (here nano).

nano HoymilesWifi.sh

Line to edit (add --debug --test):

python hoymiles_data.py --dtu_ip_address <DTU_HOST_IP> --debug --test

Where <DTU_HOST_IP> is the IP address of the DTU.

The test dataset is taken from response_test_data.json. Do not forget to remove --test after testing.