/MMM-CaravanPiClimate

Display values from climate sensor BME280 through CaravanPi

Primary LanguageJavaScriptGNU Affero General Public License v3.0AGPL-3.0

MMM-CaravanPiClimate - a MagicMirror2 Module

This MagicMirror2 module is used in the CaravanPi project to display data of a BME280 climate sensor. CaravanPi is a project based on a Raspberry Pi for a smart caravan.

In the CaravanPi project Magic Mirror is used as a display module. The screen is usually not mounted behind a mirror, but can also be used as a TV in the caravan. For the Caravan Pi project there are further modules for Magic Mirror:

MMM-CaravanPiPosition - Module for displaying level information MMM-CaravanPiGasWeight - Module for indicating the filling of a gas bottle via a scale MMM-CaravanPiTemperature - Module for displaying temperature values e.g. in the refrigerator MMM-CaravanPiClimate - Module for displaying climate values

Screendumps

modus: Boxlines

Installation

In your terminal, go to your MagicMirror's Module folder:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/spitzlbergerj/MMM-CaravanPiClimate

install the node dependencies:

cd MMM-CaravanPiClimate/ && npm install

install a nesessary npm modul:

npm install async

Using the module

To use this module, add it to the modules array in the config/config.js file:

modules: [
{
	module: 'MMM-CaravanPiClimate',
	header: 'Klimawerte',
	position: 'top_left', // This can be any of the regions.
	config: {
        	valueDir: "/home/pi/CaravanPi/values",
        	updateInterval: 100000, // milliseconds
        	tempUnit: " °C",
        	humUnit: " %",
        	pressUnit: " hPa",
        	tempPrecision: 2,
        	humPrecision: 2,
        	pressPrecision: 2,
        	showDate: true,
        	sensors: [
            	{
                	name: "Innenraum",
                	file: "BME280-96-118",
            	},
            	{
                	name: "Außenbereich",
                	file: "BME280-96-119",
            	},
        	],
        	localeStr: 'de-DE',
        	style: "lines",
    	}
},

]

Configuration options

The following properties can be configured:

Option Description
valueDir Optional - The directory in which the values read by the sensors are stored.
If not set, the default is: /home/pi/CaravanPi/values
updateInterval Optional - The update interval in milliseconds.
If not set, the default is: 300000 (5 minutes)
tempUnit Optional - Unit in which the temperature are indicated. Default is °C
humUnit Optional - Unit in which the humidity are indicated. Default is %
pressUnit Optional - Unit in which the air pressure is indicated. Default is hPa/code>
tempPrecision Optional - Decimal places for temperature values. Default is 2
humPrecision Optional - Decimal places for humidity values. Default is 2
pressPrecision Optional - Decimal places for air pressure values. Default is 2
showDate Optional - Decides whether the date/time at which the values were determined is displayed. Possible values: true or false Default is true
localeStr Optional - String for country-specific formatting of numbers. Possible values: see Tags for Identifying Languages Default is 'de-DE'
style Optional - Decides in which style the values are displayed. Possible values: lines, boxes or boxlinesDefault is 'lines'
sensors Required - Add all your sensors that should appear in the MagicMirror. Each sensor must include the following properties:
Option Description
name Name that is to be displayed for this sensor.
file File name from which the values are to be read