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.

    icon + compliments_plus + How to communicate with default weather module ?

    Scheduled Pinned Locked Moved Troubleshooting
    10 Posts 3 Posters 1.4k Views 2 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.
    • ? Offline
      A Former User
      last edited by A Former User

      This post is deleted!
      S 1 Reply Last reply Reply Quote 1
      • S Do not disturb
        sdetweil @Guest
        last edited by

        @hango the answer to your question in the issue

        I see these code , but unable to undesrtand who is sending notification.
        
        notificationReceived: function(notification, payload, sender) { if (notification === "Weather data") { this.setCurrentWeatherType(payload.data); } },
        

        any module can send this notification. IF the weather module RECEIVES this notification, it expects an object in the payload with an element called ‘data’

        { data:some-value}

        where I guess some_value would be the compliments tags, ‘sunny’, … etc

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        ? 1 Reply Last reply Reply Quote 1
        • ? Offline
          A Former User @sdetweil
          last edited by A Former User

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • E Offline
            emrah_asl
            last edited by emrah_asl

            Guys, thanks for assisting me but I think the problem in my weather.js, because I guess it is not sending any notification to client side.

            love that module, but unable to find node_helper.js inside of default/weather directory.

            I would like to send notification to client side into this compliment in order to listen and put appropriate text for current weather.

            this compliment module have this

            notificationReceived: function(notification, payload, sender) {
            if (notification === “CURRENTWEATHER_DATA”) {
            console.log(“251”, payload.data);
            this.setCurrentWeatherType(payload.data);
            }

            But I dont get how to send data from my weather module.

            Sorry for mixed up

            S ? 2 Replies Last reply Reply Quote 0
            • S Do not disturb
              sdetweil @emrah_asl
              last edited by sdetweil

              @emrah_asl don’t need node_helper, and can’t use node_helper. it can only handle socketNotifcations

              this.sendNotification(type, data)
              from modulename.js

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • ? Offline
                A Former User @emrah_asl
                last edited by A Former User

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • E Offline
                  emrah_asl
                  last edited by

                  Hi, thanks for assisting me.

                  The problem is I’M not using original weather module, so unable to send notification .

                  I’m using this one :

                  https://github.com/MatthiPi/MMM-DefaultWeatherAnimated

                  {
                  module: "weather", //change to weather
                  position: "top_right",
                  config: {
                  // See 'Configuration options' for more information.
                  type: 'current',
                  weatherEndpoint: '/weather',
                  units: 'metric',
                  apiKey: 'X',
                  locationID: Y
                  }
                  },
                  
                  But unable to figure out how to send notification to current weather objects into this compliment_modules.
                  
                  (where should I write , this code in this module ?) when I try in provider.js, console says "sender should be module"
                  
                  this.sendNotification("CURRENTWEATHER_DATA", {foo: "bar"});
                  
                  MY COMPLIMENT_PLUS Modul compliment_plus.js
                  
                  notificationReceived: function(notification, payload, sender) {
                  if (notification === "CURRENTWEATHER_DATA") {
                  console.log("251", payload.data);
                  this.setCurrentWeatherType(payload.data);
                  }
                  },
                  
                  1 Reply Last reply Reply Quote 0
                  • ? Offline
                    A Former User
                    last edited by A Former User

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • 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