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

    Scheduled Pinned Locked Moved Utilities
    9 Posts 4 Posters 2.9k Views 4 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.
    • wishmaster270W Offline
      wishmaster270 Module Developer
      last edited by wishmaster270

      Description:

      This is a simple module which uses external scripts as data source to display the temperature and humidity of different sensors.
      As i use an HTU21 sensor a script to read the values is included already. There scripts to read data of DHT11, DHT22, BME280, DS18B20 included as of version 0.0.2.

      Download:

      MMM-Temperature
      [card:Tom-Hirschberger/MMM-Temperature]


      Version 0.0.10

      • added a wrapper script to call the Python scripts within a virtual environment
      • updated the instructions and default values to use the new wrapper script

      Version 0.0.9

      • added support for SHTC3 sensors

      Version 0.0.8

      • use spawnSync instead of execSync to call the scripts now. execSync caused “Error: write EFAULT” exceptions so this change was necessary

      Version 0.0.7

      • The values send via notification now can be parsed if they are in JSON version 5 format, too

      Version 0.0.6

      • the bme280 scripts now supports setting the I2C address via command line

      Version 0.0.5

      • additional values like wind speed, uv and rain can be displayed now
        
      • modified some of the examples to get a more reliable wifi connection on the esp32 boards and added a new example
        

      Version 0.0.4

      This new version 0.0.4 provides the following features:

      • the values of sensors no can be updated in a single notification which has an json structure as payload. if the keys “temperature_c”, “temperature_f” or “humidity” are present the values get updated. if either “temperature_c” or “temperature_f” is missing but the other one is present the missing value is calculated automatically.

      Version 0.0.3

      This new version 0.0.3 provides the following features:

      • it is now possible to specify a useValueCnt for each sensor. If the sensor provides data less periodically than the updateInterval (i.e. because the sensor sends the data via MQTT less frequently) the data can be used multiple intervals before it gets invalidated and “na” will be displayed.
      • added an example of howto provide data of an DHT11 (or DHT21, DHT22) sensor connected to an ESP8266 board which uses MQTT and deep sleep.
      • added an example of howto provide data of an DHT11 (or DHT21, DHT22) sensor connected to an ESP8266 board which uses plain tcp

      Version 0.0.2

      This new version provides the following improvements:

      • The values of sensors now can be updated via notification now.
      • It is possible to hide the temperature and humidity section for either all sensors or specific ones.
      • There are now scripts included to read values of DHT11, DHT22, BME280, HTU21 or DS18B20 connected to the Raspberry Pi.
      • There are different examples of howto read values of sensors connected to micro controllers via plain TCP or MQTT (with help of the MMM-MQTTbridge module).
      • As every wrapper now gets specific css classes assign you can customize the colors more easy

      Version 0.0.1

      The initial release provides the following features

      • read temperature of sensors by calling scripts with arguments
      • multiple sensors with different data scripts can be added
      • sensors can be displayed with or without name
      • an example script to read the data of an HTU21 sensor attached to the I2C bus of the raspberry is included and will be used as default data source
      • an example of how to connect an HTU21 sensor to an ESP32 micro controller with build-in wifi is included also

      Screenshots

      Mykle1M 1 Reply Last reply Reply Quote 1
      • Mykle1M Offline
        Mykle1 Project Sponsor Module Developer @wishmaster270
        last edited by Mykle1

        @wishmaster270

        Nice! I don’t have/use sensors but cool just the same!

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • H Offline
          Hadr1en Project Sponsor
          last edited by

          Hello !

          Nice script but can you tell us what information you need to execute scripts ? Maybe I should open a troubleshooting thread but I tried with the examples with AdafruitDHT.py script and have this config :

          {
              module: 'MMM-Temperature',
              position: 'top_right',
              config: {
          sensors: [				
          name: "Test",
          script: "/home/pi/Adafruit_Python_DHT/examples/AdafruitDHT.py",
          args: "11 2"
          	] 
              }
          },
          

          And get an error (but if I use the script alone, i get the temperature and humidity)

          Thanks !

          wishmaster270W 1 Reply Last reply Reply Quote 0
          • wishmaster270W Offline
            wishmaster270 Module Developer @Hadr1en
            last edited by

            @Hadr1en Hi, the module expects an json string as output of the script it executes. There is a section in the readme which shows an example:

            {
               "humidity": 32.61236572265625,
               "temperature_c": 25.50150878906249, //Temperature in °C
               "temperature_f": 77.9027158203125, //Temperature in °F
               "error": false
            }
            

            What kind of error do you get?

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              snakestang @wishmaster270
              last edited by

              @wishmaster270

              I know this is an old thread but maybe someone can help. I have everything installed but for the life of me can’t get it to change to fahrenheit. No matter where I put the change line in config it always reads celsius.

              I am using a DS18b20 if it matters.

              Tha ks in advance.

              wishmaster270W 2 Replies Last reply Reply Quote 0
              • wishmaster270W Offline
                wishmaster270 Module Developer @snakestang
                last edited by

                @snakestang Hi, I currently do not use the module (and only used the Fahrenheit option during development) in my setup but I will try to setup a simple development environment to check your problem.

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  snakestang @wishmaster270
                  last edited by

                  @wishmaster270

                  No worries. Thanks for your time. Not the end of the world by any means.

                  1 Reply Last reply Reply Quote 0
                  • wishmaster270W Offline
                    wishmaster270 Module Developer @snakestang
                    last edited by

                    @snakestang
                    Hi,

                    i tried the following configuration

                        {
                          module: "MMM-Temperature",
                          position: "bottom_right",
                          config: {
                            useCelsius: false,
                            sensors: [
                              {
                                  name: "Sensor One",
                                  script: "ds18b20",
                                  args: "123456"
                              }
                            ]
                          },
                        },
                    

                    and everything works as expected.
                    The unit is changed to “°F” and the “temperature_f” value is chosen.

                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      snakestang @wishmaster270
                      last edited by

                      @wishmaster270

                      I will try again! Thanks for checking!

                      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