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

    Posts

    Recent Best Controversial
    • Need Help with Receiving Notifications

      I’m trying to add some new features to my magic mirror, which involve listening for notifications from other modules. I tried adding code to:

      socketNotificationReceived(notification, payload) {
      }
      in node_helper.js
      but the log messages that I am putting there are not appearing in the logs. Is there another step that I have to do to make my module receive notifications?

      I’ve had this problem with a couple of totally different features I have been trying to add, but if you want more context, for this one, I am trying to make MMM-Buttons allow you to specify what a long press does and what a short press does, but make it depend on which page you are on. So you can define a longpress action and a shortpress action for each of your pages.

      In order to do this, I need MMM-Buttons to listen for the PAGE_CHANGED notification and store the page number, but it doesn’t seem to listen to the broadcast of notifications. I thought that if any module sends a notification, it gets broadcast to all of the other modules and each of their socketNotificationReceived should execute. Is that not correct?

      Thanks so much for your help.

      posted in Development
      R
      raspberrypi9
    • RE: Help Implementing Custom Feature w/Calendar

      @sdetweil I am familiar with using debuggers in general programming and in embedded system, but this is my first time working on a web app. Where do I ge a debugger from and how do I attach/insert it into this process?

      posted in Development
      R
      raspberrypi9
    • Help Implementing Custom Feature w/Calendar

      I am using the default clock module and the MMM-GoogleCalendar module. I use 3 instances of the MMM-GoogleCalendar modules–one for my personal calendar, one for a holiday calendar, and one for a birthday calendar. I recently coded a feature which makes a birthday appear in green if it is a week away, yellow if it is a day away, and red if it is that day.

      Now, I want to made a custom feature which plays a song (in a .wav file) when there is at least one birthday on the current day. I would like the song to get played only when the user first uses the mirror on the day of the birthday.

      To do this, I created a new notification that gets put out by the default clock module at midnight every day and it is called CLOCK_NEW_DAY. When the MMM-GoogleCalendar module sees that notification, it resets a flag that tells it that the song has already been played that day. My mirror blanks the screen when it is idle and sends a SCREEN_ON notification when the user is present. So, I added code to MMM-GoogleCalendar to look for a SCREEN_ON notification and when it sees it to set a boolean called screenOn and call this.updateDom()

      I think I have all the code that I need in place, but for some reason, when I see a SCREEN_ON get generated, I can see it with MMM-ViewNotifications, but I don’t see the MMM-GoogleCalendar code receiving/responding to the notification. I’m not sure how to debug this, and I’d really appreciate any help you can offer. Thanks.

      posted in Development
      R
      raspberrypi9
    • How to make compliments word wrap?

      I have some longish custom compliments and they just overwrite the modules that are in the left and right sides of the screen. How can I get the default compliments module to stick to just the center of the screen and word wrap the compliments without having them overwrite/overlap the other content that is on the right and left side of the screen?

      Thanks so much for your help.

      posted in Development
      R
      raspberrypi9
    • RE: Send Notifications from Linux/RPi Command Line

      Sam, I love this! It is exactly what I was looking for and very useful. Thanks so much for making it!

      posted in Development
      R
      raspberrypi9
    • Send Notifications from Linux/RPi Command Line

      Is there a module that will allow you to type a notifcation and payload into the linux command line and broadcast it to all of the mirror modules?

      If not, I would like to write one. What would be the architecture that I would need on the mirror side? Can I write a new module that listens on an external socket and connect to that socket with some command line program that I would code?

      posted in Development
      R
      raspberrypi9
    • Changing Visibility of Newsfeed Article

      When I open the article from the current headline of the newsfeed by sending the notification ARTICLE_MORE_DETAILS, the full text of the article shows on the screen, but it is not displayed in a foreground/background color combination that is very visible on the mirror. Is it possible to change this so that the article renders in a more visible color combination?

      posted in Development
      R
      raspberrypi9
    • RE: Attribution Tag for Default Compliments Model

      @sdetweil I think I know what I want to do for the visual/presentation aspect. I’m going to just print the attribution name in smaller font at the end of the compliment.

      I’d like to change the config schema from:

      compliments: {
      anytime: [ “compliment 1”,
      “compliment 2”]
      }

      to

      compliments: {
      anytime: [ {“compliment from Bob”, “Bob”},
      {“compliment from Lucy”, “Lucy”}]
      }

      but when I just make that change in the config file, it tells me that I have syntax errors. How can I change things so that my new scheme for compliments will be accepted and I can access both the compliment and name field in the compliments.js file where I assume I can modify how it is rendered?

      Thanks so much for your help.

      posted in Development
      R
      raspberrypi9
    • RE: Attribution Tag for Default Compliments Model

      @sdetweil Thanks so much for replying to my post. Just want to confirm that I understand the approach…

      So what you are saying is that I should make an .html file and google what html tags to put in it so that I can load it with File…Open in my browser and once it displays correctly, I can take those tags and google how to write javascript code in the getDom function in MagicMirror/modules/default/compliments that will implement those same html tags. Is the correct? Thanks.

      posted in Development
      R
      raspberrypi9
    • RE: Attribution Tag for Default Compliments Model

      Sorry, the title should say “Default Compliments Module”

      posted in Development
      R
      raspberrypi9
    • 1 / 1