MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    1. Home
    2. Jose Walsh
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 4
    • Best 1
    • Controversial 0
    • Groups 0

    Jose Walsh

    @Jose Walsh

    1
    Reputation
    3
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Jose Walsh Unfollow Follow

    Best posts made by Jose Walsh

    • RE: MMM-Fritz-Box-Callmonitor: Notification formatting

      @Jan-0 said in MMM-Fritz-Box-Callmonitor: Notification formatting:

      Hi,
      I’m referring to this module (https://github.com/paviro/MMM-FRITZ-Box-Callmonitor). Although it is quite outdated, I still like it and I was able to transfer it to an python3 environment. However, since some update (don’t know which one), the notification (“alert”) is not formatted properly.
      The reason seems to be in line 85 of the file MMM-FRITZ-Box-Callmonitor.js:
      // Override socket notification handler.
      socketNotificationReceived: function(notification, payload) {
      if (notification === “call”) {
      //Show alert on UI
      this.sendNotification(“SHOW_ALERT”, {
      title: this.translate(“title”),
      message: “” + payload + “”,
      imageFA: “phone”
      });

        	//Set active Alert to current call
        	this.activeAlert = payload;
        }
      

      There are two problems: 1) the title is not translated but printed, 2) the message is not formatted but the formatting information is printed verbosely.
      Unfortunately, I’m neither an expert in the MagicMirror syntax nor in javascript. Could somebody give me a hint how I need to adopt the code?

      To fix this, you can remove the quotes and use template literals instead. Template literals allow you to include variables and formatting within a string using backticks () instead of quotes. Here's how you can modify the code to use template literals: socketNotificationReceived: function(notification, payload) { if (notification === "call") { //Show alert on UI this.sendNotification("SHOW_ALERT", { title: this.translate("title"), message: ${payload}`,
      imageFA: “phone”
      });

      //Set active Alert to current call
      this.activeAlert = payload;
      

      }
      }
      As for the translation issue, you need to make sure that the translate function is correctly configured in your module. The translate function should be defined in the getTranslations function in the module’s node_helper.js file. Here’s an example of how to define the translate function:
      getTranslations: function() {
      return {
      en: “translations/en.json”,
      de: “translations/de.json”
      };
      },

      translate: function(key) {
      return this.translate(key);
      }
      This assumes that you have translation files for English and German located in the translations folder of your module. You may need to modify this code to match the structure of your module.

      I hope this helps! Let me know if you have any other questions.

      posted in Troubleshooting
      J
      Jose Walsh

    Latest posts made by Jose Walsh

    • RE: MMM-Fritz-Box-Callmonitor: Notification formatting

      @Jan-0 said in MMM-Fritz-Box-Callmonitor: Notification formatting:

      Hi,
      I’m referring to this module (https://github.com/paviro/MMM-FRITZ-Box-Callmonitor). Although it is quite outdated, I still like it and I was able to transfer it to an python3 environment. However, since some update (don’t know which one), the notification (“alert”) is not formatted properly.
      The reason seems to be in line 85 of the file MMM-FRITZ-Box-Callmonitor.js:
      // Override socket notification handler.
      socketNotificationReceived: function(notification, payload) {
      if (notification === “call”) {
      //Show alert on UI
      this.sendNotification(“SHOW_ALERT”, {
      title: this.translate(“title”),
      message: “” + payload + “”,
      imageFA: “phone”
      });

        	//Set active Alert to current call
        	this.activeAlert = payload;
        }
      

      There are two problems: 1) the title is not translated but printed, 2) the message is not formatted but the formatting information is printed verbosely.
      Unfortunately, I’m neither an expert in the MagicMirror syntax nor in javascript. Could somebody give me a hint how I need to adopt the code?

      To fix this, you can remove the quotes and use template literals instead. Template literals allow you to include variables and formatting within a string using backticks () instead of quotes. Here's how you can modify the code to use template literals: socketNotificationReceived: function(notification, payload) { if (notification === "call") { //Show alert on UI this.sendNotification("SHOW_ALERT", { title: this.translate("title"), message: ${payload}`,
      imageFA: “phone”
      });

      //Set active Alert to current call
      this.activeAlert = payload;
      

      }
      }
      As for the translation issue, you need to make sure that the translate function is correctly configured in your module. The translate function should be defined in the getTranslations function in the module’s node_helper.js file. Here’s an example of how to define the translate function:
      getTranslations: function() {
      return {
      en: “translations/en.json”,
      de: “translations/de.json”
      };
      },

      translate: function(key) {
      return this.translate(key);
      }
      This assumes that you have translation files for English and German located in the translations folder of your module. You may need to modify this code to match the structure of your module.

      I hope this helps! Let me know if you have any other questions.

      posted in Troubleshooting
      J
      Jose Walsh
    • RE: Best monitor or TV

      @benscammell said in Best monitor or TV:

      Can someone tell me a good monitor / TV to base a MM on?

      The choice of monitor or TV for a multimedia setup depends on several factors, including your budget, the intended use, and the available space. Some popular options for multimedia setups include the LG 27UK850-W, the Dell Ultrasharp U2718Q, and the BenQ EL2870U. However, it’s important to consider the specific features you require, such as resolution, refresh rate, color accuracy, and connectivity options, before making a decision.

      posted in Hardware
      J
      Jose Walsh
    • RE: door and proximity sensors

      @ectovito said in door and proximity sensors:

      I was finally able to retrieve the Device IDs via the Aqara gateway, and the tokens from the gateway and vacuum in the Miio Mac application.
      I can correctly display the temperature and humidity of my different rooms in the house. The same for my vaccum via the Xiaomi-vaccum module.
      The only thing I can’t do is to declare the door sensors and the sensory sensors.
      What should I declare in the configuration file?
      Thank you in advance for your help.

      To declare the door sensors and sensory sensors in your configuration file, you will need to specify the device type, device ID, and token for each sensor. You can typically find this information in the Miio Mac application or from the Aqara gateway.

      Here’s an example of what a door sensor declaration in your configuration file might look like:
      switch:

      • platform: xiaomi_aqara
        name: Door Sensor
        type: magnet
        sid: <device_id>
        token:
        And here’s an example of what a sensory sensor declaration might look like:
        sensor:
      • platform: xiaomi_aqara
        name: Sensory Sensor
        type: sensor_ht
        sid: <device_id>
        token:

      Note that the <device_id> and values should be replaced with.

      posted in Utilities
      J
      Jose Walsh
    • RE: Magic mirror using the IKEA Hogbo glass door

      @Thedoomguy6312 said in Magic mirror using the IKEA Hogbo glass door:

      Hi all. My plan is to use the billy bookcase with the Ikea Hogbo glass with one way film applied as a magicmirror. I know film is not the best but one way mirror is far too expensive for this DIY project. The Hogbo door uses aluminium extrusion border and I was wondering if anyone has ideas of how to attach the screen to the door. I was thinking of using aluminium extrusions but not sure how to go about doing that.

      One option for attaching the screen to the door could be to use a frame made of aluminum extrusions. You could cut the extrusions to the correct size and use screws or brackets to attach them to the door, creating a frame around the screen. To secure the screen to the frame, you could use double-sided tape or Velcro strips. If you have access to tools such as a drill or saw, you may be able to customize the frame to fit the screen and door perfectly.

      posted in Hardware
      J
      Jose Walsh