• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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-Temperature/Humidity Module (DHT11, DHT22 and AM2302 sensors.)

Scheduled Pinned Locked Moved Utilities
34 Posts 11 Posters 31.0k Views 10 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.
  • P Offline
    psk @jsyzthz
    last edited by paviro Oct 3, 2016, 12:26 PM Sep 29, 2016, 2:35 PM

    @jsyzthz
    I’m not sure whether to rebuild in MMM-Temperature-humidity directory or the Magic Mirror directory.
    Try executing in the MagicMirror directory first.

    npm rebuild --runtime=electron --target=1.4.0 --disturl=https://atom.io/download/atom-shell --build-from-source

    Also you can find the electron version by : npm list

    Just in case, i had this in my commands history :D
    npm rebuild --runtime=electron --target=1.3.4 --disturl=https://atom.io/download/atom-shell --abi=49 -d

    P.S.K

    J 1 Reply Last reply Sep 30, 2016, 9:32 AM Reply Quote 0
    • J Offline
      jsyzthz @psk
      last edited by Sep 30, 2016, 9:32 AM

      @psk i use the first command. it woks now.thx!

      P 1 Reply Last reply Sep 30, 2016, 5:39 PM Reply Quote 1
      • P Offline
        psk @jsyzthz
        last edited by Sep 30, 2016, 5:39 PM

        @jsyzthz Glad I could help :D :D

        P.S.K

        1 Reply Last reply Reply Quote 0
        • H Offline
          H3L1o150
          last edited by Oct 2, 2016, 7:33 PM

          Hi, i am really new on this, someone can help me, with the code on config.js file?

               {
                          module: 'MMM-Temperature-Humidity',
                          position: 'bottom_bar',
                          config: {
                            var dht = new rpiDhtSensor.DHT11(21);
          	    }
                },
          

          thanks

          Y 1 Reply Last reply Oct 2, 2016, 7:40 PM Reply Quote 0
          • Y Offline
            yawns Moderator @H3L1o150
            last edited by Oct 2, 2016, 7:40 PM

            @H3L1o150
            No, you need to edit the file node_helper.js in the modules folder
            Currently you cannot define the pin and the sensor type in the config section. But I think this should be improved in a future release

            1 Reply Last reply Reply Quote 1
            • H Offline
              H3L1o150
              last edited by paviro Oct 3, 2016, 12:26 PM Oct 2, 2016, 7:43 PM

              @yawns so i left the config.js file like that?

                {
                       module: 'MMM-Temperature-Humidity',
                        position: 'top_right',
                        config: {
                             ...
                    }
                }
              

              Note from admin: Please use Markdown on code snippets for easier reading!

              Y 1 Reply Last reply Oct 2, 2016, 7:50 PM Reply Quote 0
              • Y Offline
                yawns Moderator @H3L1o150
                last edited by yawns Oct 2, 2016, 7:50 PM Oct 2, 2016, 7:50 PM

                I never played around with this module. But I would use this:

                { module: 'MMM-Temperature-Humidity', position: 'top_right' }

                And then you edit node_helper.js to set for DHT11 or DHT22 and the correct pin in ( )

                1 Reply Last reply Reply Quote 1
                • H Offline
                  H3L1o150
                  last edited by Oct 2, 2016, 8:12 PM

                  @yawns Tanks for the help

                  maybe i’m wrong in code. with me show a white screen

                  P 1 Reply Last reply Oct 2, 2016, 8:58 PM Reply Quote 0
                  • P Offline
                    psk @H3L1o150
                    last edited by paviro Oct 3, 2016, 12:26 PM Oct 2, 2016, 8:58 PM

                    @H3L1o150 currently, to define the pin to which sensor is connected, you need to edit the node_helper.js file ind MMM-Temperature-Humidity directory and edit line number 12.
                    var dht = new rpiDhtSensor.DHT11(2); to var dht = new rpiDhtSensor.DHT11(21);

                    you can leave the config as

                                {
                    			module: 'MMM-Temperature-Humidity',
                    			position: 'bottom_right',
                    			config: {
                    				refreshInterval: 10000,
                    				temperaturePrefix: "Room temperature: ",
                    				temperatureSuffix: "°C",
                    				humidityPrefix: "Humidity: ",
                    				humiditySuffix: "%"
                    			}
                    		},
                    

                    guess this needs to be improved in future release… :D


                    Note from admin: Please use Markdown on code snippets for easier reading!

                    P.S.K

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      H3L1o150
                      last edited by Oct 2, 2016, 9:30 PM

                      Tanks @psk

                      1 Reply Last reply Reply Quote 1
                      • 1
                      • 2
                      • 3
                      • 4
                      • 2 / 4
                      2 / 4
                      • First post
                        18/34
                        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