Skip to content

spitzlbergerj/MMM-CaravanPiGasWeight

Repository files navigation

MMM-CaravanPiGasWeight - a MagicMirror2 Module

This MagicMirror2 module is used in the CaravanPi project to display data of a HX711 weight 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-CaravanPiGasWeight

install the node dependencies:

cd MMM-CaravanPiGasWeight/ && 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-CaravanPiGasWeight',
	header: 'Füllstand Gasflasche',
	position: 'top_left', // This can be any of the regions.
	config: {
        	valueDir: "/home/pi/CaravanPi/values",
        	updateInterval: 100000, // milliseconds
        	weightUnit: " Gramm",
        	weightPrecision: 2,
            levelUnit: " %",
        	levelPrecision: 2,
        	showDate: true,
        	sensors: [
            	{
                	name: "Alu 6 kg",
                	file: "gasScale",
            	},
        	],
        	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)
weightUnit Optional - Unit in which the weight are indicated. Default is Gramm
weightPrecision Optional - Decimal places for weight values. Default is 2
levelUnit Optional - Unit in which the filling level are indicated. Default is %
levelPrecision Optional - Decimal places for filling level 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published