This module displays the current temperature and humidity form DHT11, DHT22 and AM2302 sensors. It's a global rewrite of https://github.com/ryck/MMM-DHT-Sensor
In your terminal, go to your MagicMirror's Module folder:
cd ~/MagicMirror/modules
Clone this repository:
git clone https://github.com/grenagit/MMM-DHT-Sensor
Go to your MMM-DHT-Sensor's Module folder:
cd ~/MagicMirror/modules/MMM-DHT-Sensor
Install dependencies:
npm install
Configure the module in your config.js file.
In your terminal, go to your MMM-DHT-Sensor's Module folder:
cd ~/MagicMirror/modules/MMM-DHT-Sensor
Incorporate changes from this repository:
git pull
Install dependencies:
npm install
To use this module, add it to the modules array in the config/config.js
file:
modules: [
{
module: "MMM-DHT-Sensor",
position: "top_left",
config: {
sensorPin: 2,
sensorType: 11, // 11 for DHT11 or 22 for DHT22 / AM2302
}
}
]
The following properties can be configured:
Option | Description |
---|---|
sensorPin |
The GPIO pin of the sensor. This value is REQUIRED |
sensorType |
The sensor type (DHT11, DHT22 or AM2302). This value is REQUIRED |
units |
What units to use. Specified by config.js Possible values: config.units = Specified by config.js, metric = Celsius, imperial = Fahrenheit Default value: config.units |
updateInterval |
How often does the content needs to be fetched? (Milliseconds) Possible values: 1000 - 86400000 Default value: 1 * 60 * 60 * 1000 (1 hour) |
animationSpeed |
Speed of the update animation. (Milliseconds) Possible values: 0 - 5000 Default value: 1000 (1 second) |
relativeScale |
Relative scale to choose the temparature icon. Possible values: true (round to integer) or false (display exact value with decimal point) Default value: false |
roundTemp |
Round temperature value to nearest integer. Possible values: 1 - 100 Default value: 30 |
initialLoadDelay |
The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds) Possible values: 1000 - 5000 Default value: 0 |
retryDelay |
The delay before retrying after a request failure. (Milliseconds) Possible values: 1000 - 60000 Default value: 2500 (2,5 seconds) |
This module implements the following notifications:
- INDOOR_TEMPERATURE (int) Temperature in Celsius
- INDOOR_HUMIDITY (int) Humidity in relative humidity (%)
This module is licensed under the MIT License