MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-Hoymiles-Wifi

    Scheduled Pinned Locked Moved Development
    58 Posts 6 Posters 5.4k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      Jose1701 @evroom
      last edited by

      @evroom

      * master
      origin  https://github.com/schris88/MMM-Hoymiles-Wifi (fetch)
      origin  https://github.com/schris88/MMM-Hoymiles-Wifi (push)
      
      

      I used the ~ symbol.

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jose1701 @evroom
        last edited by

        @evroom

        Well I tried that but I’m to silly to install it.

        florian@raspberrypi:~/MagicMirror/modules/MMM-Hoymiles-Wifi $ pip3 install hoymiles-wifi
        error: externally-managed-environment
        
        × This environment is externally managed
        ╰─> To install Python packages system-wide, try apt install
            python3-xyz, where xyz is the package you are trying to
            install.
        
            If you wish to install a non-Debian-packaged Python package,
            create a virtual environment using python3 -m venv path/to/venv.
            Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
            sure you have python3-full installed.
        
            For more information visit http://rptl.io/venv
        
        note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
        hint: See PEP 668 for the detailed specification.
        
        
        florian@raspberrypi:~/MagicMirror/modules/MMM-Hoymiles-Wifi $ sudo apt install python3 hoymiles-wifi
        Error: Unable to locate package hoymiles-wifi
        florian@raspberrypi:~/MagicMirror/modules/MMM-Hoymiles-Wifi $
        
        
        
        evroomE 1 Reply Last reply Reply Quote 0
        • evroomE Offline
          evroom @Jose1701
          last edited by

          @Jose1701

          You installed that already, so no need to install it again.
          Probably using:

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

          The schris88 requirements.txt contains the hoymiles-wifi package.

          MagicMirror version: 2.33.0
          Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
          Raspbian GNU/Linux 12 (bookworm)

          Test environment:
          MagicMirror version: v2.31.0
          Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
          Raspbian GNU/Linux 12 (bookworm)

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            Jose1701 @evroom
            last edited by

            @evroom

            By unsing this, I get the following error:

            python -m pip install -r requirements.txt --break-system-packages
            
            Defaulting to user installation because normal site-packages is not writeable
            ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
            
            
            evroomE 1 Reply Last reply Reply Quote 0
            • evroomE Offline
              evroom @Jose1701
              last edited by evroom

              @Jose1701

              >> You installed that already, so no need to install it again.
              >>The schris88 requirements.txt contains the hoymiles-wifi package.
              

              If you want to repeat it under the new module name, then you will need to copy the requirements.txt file from the previous module.
              But again, since you already did this, no need to repeat.

              MagicMirror version: 2.33.0
              Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
              Raspbian GNU/Linux 12 (bookworm)

              Test environment:
              MagicMirror version: v2.31.0
              Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
              Raspbian GNU/Linux 12 (bookworm)

              J 1 Reply Last reply Reply Quote 0
              • J Offline
                Jose1701 @evroom
                last edited by

                @evroom

                Okay. But in the end I can’t get it to work. Don’t know whats wrong …

                Does this has to do with that:

                florian@raspberrypi:~ $ pm2 restart MagicMirror
                Use --update-env to update environment variables
                [PM2] Applying action restartProcessId on app [MagicMirror](ids: [ 0 ])
                [PM2] [MagicMirror](0) ✓
                ┌────┬─────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
                │ id │ name            │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
                ├────┼─────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
                │ 1  │ HoymilesWifi    │ default     │ 2.33.0  │ fork    │ 3691100  │ 0      │ 367… │ stopped   │ 0%       │ 0b       │ florian  │ disabled │
                │ 0  │ MagicMirror     │ default     │ 2.33.0  │ fork    │ 3691094  │ 0s     │ 3    │ online    │ 0%       │ 3.0mb    │ florian  │ enabled  │
                └────┴─────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
                florian@raspberrypi:~ $
                
                
                
                
                evroomE 1 Reply Last reply Reply Quote 0
                • evroomE Offline
                  evroom @Jose1701
                  last edited by

                  @Jose1701

                  Yeah, stopped is not good.
                  I will need to get it working myself before I can give more useful information on what to check.
                  Will keep you posted.

                  MagicMirror version: 2.33.0
                  Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
                  Raspbian GNU/Linux 12 (bookworm)

                  Test environment:
                  MagicMirror version: v2.31.0
                  Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
                  Raspbian GNU/Linux 12 (bookworm)

                  evroomE 1 Reply Last reply Reply Quote 0
                  • evroomE Offline
                    evroom @evroom
                    last edited by

                    @Jose1701

                    Remove the old module from the config:

                    $ vi ~/MagicMirror/config/config.js
                    
                    Remove the "MMM-Hoymiles-Wifi" config, or set:
                    
                        module: "MMM-Hoymiles-Wifi"
                        disabled: true,
                    
                    Delete HoymilesWifi from pm2:
                    
                    $ pm2 stop HoymilesWifi
                    $ pm2 delete HoymilesWifi
                    $ pm2 save
                    
                    If desired, completely remove the old module:
                    
                    $ cd ~/MagicMirror/modules/
                    $ rm -rf MMM-Hoymiles-Wifi
                    

                    Install MMM-HoymilesPVMonitor:

                    $ cd ~/MagicMirror/modules
                    
                    $ git clone https://github.com/CuddlyCow/MMM-HoymilesPVMonitor.git
                    
                    $ cd MMM-HoymilesPVMonitor
                    
                    $ git branch
                    * main
                    
                    $ git remote -v
                    origin	https://github.com/CuddlyCow/MMM-HoymilesPVMonitor.git (fetch)
                    origin	https://github.com/CuddlyCow/MMM-HoymilesPVMonitor.git (push)
                    
                    $ which hoymiles-wifi
                    /home/admin/.local/bin/hoymiles-wifi
                    
                    $ echo $PATH
                    /home/admin/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
                    
                    $ vi ~/MagicMirror/config/config.js
                    
                      {
                        module: "MMM-HoymilesPVMonitor",
                        disabled: false,
                        header: "PV Monitor",
                        position: "top_left",
                        config: {
                          dtuIp: "192.168.178.50",        // IP address of your Hoymiles DTU
                          maxPower: 800,                  // Maximum system power in watts
                          updateInterval: 5 * 60 * 1000   // Update interval in milliseconds (default: 5 minutes)
                        }
                      }
                    
                    
                    $ grep 'dtuIp' ~/MagicMirror/config/config.js
                          dtuIp: "192.168.178.50",        // IP address of your Hoymiles DTU
                    
                    
                    $ ls -als public/history_daily.json
                    4 -rw-r--r-- 1 admin admin 115 Nov  6 08:47 public/history_daily.json
                    
                    $ cat public/history_daily.json
                    [
                      {
                        "timestamp": "2025-11-06 08:47",
                        "power": 40,
                        "energy_daily": 0.03,
                        "energy_total": 0.8
                      }
                    
                    $ pm2 flush
                    
                    $ pm2 restart MagicMirror
                    
                    $ pm2 status MagicMirror
                    ┌────┬────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
                    │ id │ name           │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
                    ├────┼────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
                    │ 0  │ MagicMirror    │ default     │ 2.33.0  │ fork    │ 26202    │ 4m     │ 3    │ online    │ 0%       │ 2.1mb    │ admin    │ enabled  │
                    └────┴────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
                    
                    $ pm2 logs MagicMirror --lines 100
                    
                    0|MagicMir | [2025-11-06 08:47:43.474] [INFO]  [MMM-HoymilesPVMonitor.js:17:9] MMM-HoymilesPVMonitor started with DTU-IP: 192.168.178.50
                    :
                    :
                    0|MagicMir | [2025-11-06 08:47:49.226] [LOG]   [MMM-HoymilesPVMonitor] Running Python script: python3 /home/admin/MagicMirror/modules/MMM-HoymilesPVMonitor/dtu_data.py --ip 192.168.178.50 --max 800 --out /home/admin/MagicMirror/modules/MMM-HoymilesPVMonitor/public/history_daily.json
                    0|MagicMir | [2025-11-06 08:47:51.682] [LOG]   [MMM-HoymilesPVMonitor] Python script output: [WARNING] Could not load history: Expecting value: line 2 column 1 (char 1)
                    0|MagicMir | [2025-11-06 08:47] [INFO] Live DTU data appended: {'timestamp': '2025-11-06 08:47', 'power': 40, 'energy_daily': 0.03, 'energy_total': 0.8}
                    :
                    :
                    0|MagicMir | [2025-11-06 08:52:42.141] [LOG]   [MMM-HoymilesPVMonitor] Running Python script: python3 /home/admin/MagicMirror/modules/MMM-HoymilesPVMonitor/dtu_data.py --ip 192.168.178.50 --max 800 --out /home/admin/MagicMirror/modules/MMM-HoymilesPVMonitor/public/history_daily.json
                    0|MagicMir | [2025-11-06 08:52:43.287] [LOG]   [MMM-HoymilesPVMonitor] Python script output: [2025-11-06 08:52] [INFO] Live DTU data appended: {'timestamp': '2025-11-06 08:52', 'power': 41, 'energy_daily': 0.03, 'energy_total': 0.8}
                    
                    $ cat public/history_daily.json
                    [
                      {
                        "timestamp": "2025-11-06 08:47",
                        "power": 40,
                        "energy_daily": 0.03,
                        "energy_total": 0.8
                      },
                      {
                        "timestamp": "2025-11-06 08:52",
                        "power": 41,
                        "energy_daily": 0.03,
                        "energy_total": 0.8
                      }
                    

                    Tested on:

                    $ cat /proc/device-tree/model; echo
                    Raspberry Pi 3 Model B Plus Rev 1.3
                    
                    $ vcgencmd get_config total_mem
                    total_mem=1024
                    
                    $ grep version ~/MagicMirror/package.json
                    	"version": "2.33.0",
                    

                    MagicMirror version: 2.33.0
                    Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
                    Raspbian GNU/Linux 12 (bookworm)

                    Test environment:
                    MagicMirror version: v2.31.0
                    Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
                    Raspbian GNU/Linux 12 (bookworm)

                    J 1 Reply Last reply Reply Quote 0
                    • J Offline
                      Jose1701 @evroom
                      last edited by

                      @evroom

                      Great job! It could work for me. Unfortunately it’s dark outside but I can see the gauge on my mirror.

                      I don’t even dare to ask, but do you have a hint how about resizing it? I tried it with width and height but it won’t work.

                       {
                          module: "MMM-HoymilesPVMonitor",
                          disabled: false,
                          header: "PV Monitor",
                          position: "top_left",
                          width: "100px",
                          height: "105px",
                          config: {
                            dtuIp: "192.168.178.150",        // IP address of your Hoymiles DTU
                            maxPower: 800,                  // Maximum system power in watts
                            updateInterval: 5 * 60 * 1000   // Update interval in milliseconds (default: 5 minutes)
                          }
                        },
                      
                      

                      Many thanks and kind regards

                      Florian

                      S evroomE 2 Replies Last reply Reply Quote 0
                      • S Offline
                        sdetweil @Jose1701
                        last edited by

                        @Jose1701 said in MMM-Hoymiles-Wifi:

                        width: "100px",
                        height: "105px",
                        

                        those are outside the config:{} section, that means they are for the MM runtime…
                        but we don’t process width/height

                        if you want to do this you need to learn to use css(cascading style sheet) to customize the html presentation
                        ALL updated css goes in css/custom.css

                        a css entry in custom.css is

                        selector_clause {
                           styles to apply to elements selected by the selector clause
                        }
                        

                        we add the modulename as a class to the web content so that one can ‘select’ only for that module

                        key selector clause elements
                        starts with . means element has classname=xxx
                        starts with # means element has id=xxxx
                        does not start with either, means html element name, div, span, p, h1, img…

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        J 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 6
                        • 5 / 6
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Sam, technical setup by Karsten.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy