MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. htilburgs
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 0
    • Followers 2
    • Topics 17
    • Posts 162
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: I am looking for a working PIR Modul/function

      @Klinge
      I had the same issue with MMM-Universal-Pir.
      The maker had made a comment ABOUT It in the readme, with the correct commands after mine e-mail.
      Read the readme and you are How to do.

      posted in Troubleshooting
      htilburgsH
      htilburgs
    • RE: MMM-MyHomeWizard

      @sdetweil In the netherlands, we do have that!
      Fortunately, otherwise I would not have been able to write this MagicMirror module ;-)

      posted in Productivity
      htilburgsH
      htilburgs
    • MMM-MyHomeWizard

      MMM-MyHomeWizard is a MagicMirror module that shows the information from the HomeWizard P1 meter and/or the HomeWizard WaterMeter.
      The HomeWizard P1 Meter gives you detailed insight into your gas consumption, electricity consumption and solar surplus.
      The HomeWizard Watermeter gives you live insight into your water consumption.

      Homepage: MMM-MyHomeWizard

      aee9f9cb-1285-4eea-a266-af54a0e06b66-image.png

      834e222c-910a-4639-91e7-ef53675a5c52-image.png

      posted in Productivity
      htilburgsH
      htilburgs
    • RE: Switch URL based on value

      @sdetweil
      Meanwhile I was doing this, and I found the error (stupid me)

      	start: function () {
      		Log.info("Starting module: " + this.name);
      		requiresVersion: "2.9.0";	
      			
      		// Set locales
      
      		if (this.config.P1_IP != null) {
      			this.urlP1 = "http://" + this.config.P1_IP + "/api/v1/data/";
      		} else {
      			this.urlP1 = "https://dummyjson.com/c/7e24-36ab-48e0-a96d";
      		}
      
      		if (this.config.WM_IP != null) {
      			this.urlWM = "http://" + this.config.WM_IP + "/api/v1/data/";
      		} else {
      			this.urlWM = "https://dummyjson.com/c/704a-9a96-4845-bc72";
      		}
      //		this.urlP1 = "http://" + this.config.P1_IP + "/api/v1/data/";
      //		this.urlWM = "http://" + this.config.WM_IP + "/api/v1/data/";
      		
          		this.MHW_P1 = [];	        // <-- Create empty MHW_P1 array
      		this.MHW_WM = [];		// <-- Create empty MHW_WM array
      		this.scheduleUpdate();       	// <-- When the module updates (see below)
      	},
      

      The line with "requiresVersion: “2.9.0”; " was ending with an “,” instead of “;”

      without the “if” statement, I don’t get a failure with a “,”
      So changed it now into “;” and everythins seems to work.
      I continue testing.

      @MMRIZE Thanks for the alternative way. I’m going to look into it.
      So with the “promise” statement, it looks like I can eleminate the node_helper.js

      posted in Troubleshooting
      htilburgsH
      htilburgs
    • RE: Switch URL based on value

      @sdetweil
      In the console - sources it says:

      Uncaught SyntaxError: Unexpected token 'if'
      
      posted in Troubleshooting
      htilburgsH
      htilburgs
    • RE: Switch URL based on value

      @sdetweil

      
      	// Default values
      	defaults: {
      		P1_IP: null,				// IP Address P1 Meter
      		WM_IP: null,				// IP Address Water Meter
      		maxWidth: "500px",			// Max width wrapper
      		extraInfo: false,			// Show extra information
      		showFooter: false,			// Show footer (name Power Meter)
      		currentPower: true,			// Show current power usage
      		initialLoadDelay: 1000,
      		updateInterval: 10000			// Every 10 seconds
      	},
      
      
      posted in Troubleshooting
      htilburgsH
      htilburgs
    • Switch URL based on value

      In the script it will assume you have 2 different IP addresses to query an URL.
      1 IP for the HomeWizard P1 meter
      1 IP for the HomeWizard Water Meter
      This is because I like to show the information of both in 1 script. Everything works fine if both are used, but when someone only has the P1 meter, the IP for the Water Meter is not used and results in a console fetch error (normal behavior)

      [ERROR] Error: TypeError: fetch failed
          at node:internal/deps/undici/undici:13178:13
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
        [cause]: Error: getaddrinfo ENOTFOUND null
            at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26) {
          errno: -3008,
          code: 'ENOTFOUND',
          syscall: 'getaddrinfo',
          hostname: 'null'
        }
      } 
      

      Is there a way to switch URL in case one of both URL are NULL? I’ve tried, but it doesn’t work with if-else

      	start: function () {
      		Log.info("Starting module: " + this.name);
      		requiresVersion: "2.9.0",	
      			
      		// Set locales
      		if (this.config.P1_IP != null) {
      			this.urlP1 = "http://" + this.config.P1_IP + "/api/v1/data/";
      		} else {
      			this.urlP1 = "https://dummyjson.com/c/7e24-36ab-48e0-a96d";
      		}
      
      		if (this.config.WM_IP != null) {
      			this.urlWM = "http://" + this.config.WM_IP + "/api/v1/data/";
      		} else {
      			this.urlWM = "https://dummyjson.com/c/704a-9a96-4845-bc72";
      		}
      		
          		this.MHW_P1 = [];	        // <-- Create empty MHW_P1 array
      		this.MHW_WM = [];		// <-- Create empty MHW_WM array
      		this.scheduleUpdate();       	// <-- When the module updates (see below)
      	},
      
      
      posted in Troubleshooting
      htilburgsH
      htilburgs
    • RE: Multiple URL Querys to fill JSON

      @MMRIZE Thanks for your reaction.

      posted in Troubleshooting
      htilburgsH
      htilburgs
    • RE: Multiple URL Querys to fill JSON

      @sdetweil Thnx, you helped me a lot!!

      posted in Troubleshooting
      htilburgsH
      htilburgs
    • RE: Multiple URL Querys to fill JSON

      @sdetweil Wow, it works!
      Just checking, it has to be done in node_helper and the MMM-Module?

      posted in Troubleshooting
      htilburgsH
      htilburgs
    • 1
    • 2
    • 3
    • 4
    • 5
    • 16
    • 17
    • 3 / 17