GithubHelp home page GithubHelp logo

spitzlbergerj / mmm-currentweather-mqtt Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 181 KB

The module MMM-Currentweather-MQTT is based on the standard module currentweather and also processes MQTT telegrams of an own weather station.

License: MIT License

CSS 2.15% JavaScript 97.85%
currentweather weather mqtt mqtt-smarthome smarthome weather-station

mmm-currentweather-mqtt's Introduction

MMM-Currentweather-MQTT

The MMM-Currentweather-MQTT is based an the standard module currentweather and the module MMM-MQTT.

The currentweather module is one of the default modules of the MagicMirror. This module displays the current weather, including the windspeed, the sunset or sunrise time, the temperature and an icon to display the current conditions.

If the values originate from MQTT telegrams, the values are displayed in white. If the values are from Openweather, they are displayed in yellow.

For configuration options, please check the MagicMirror² documentation.

Screenshot

Screenshot

with minimum and maximum temperature as supplied via MQTT

Screenshot

Installation

Go to MagicMirror/modules and write

    git clone https://github.com/spitzlbergerj/MMM-Currentweather-MQTT
    cd MMM-Currentweather-MQTT
    npm install

Configuration

Attention - first version with rigid processing of my MQTT telegrams

Here is an example configuration with description. Put it in the MagicMirror/config/config.js file:

{
	module: "MMM-Currentweather-MQTT",
	position: "top_right",
	config: {
		location: "XYZ",
		locationID: "1234567",
		appid: "<yourAppID>",
		roundTemp: true,
		degreeLabel: true,
		showWindDirection: true,
		showWindDirectionAsArrow: true,
		showHumidity: true,
		showFeelsLike: false,
		useBeaufort: false,
		useKMPHwind: true,
		logging: true,
		useWildcards: false,
		showTempMax: true,
		showTempMin: true,
		mqttServers: [
			{
				address: 'xxx.xxx.xxx.xxx',  // Server address or IP address
				port: '1883',                // Port number if other than default
				subscriptions: [             // for now, all seven values must be 
				                             // specified in the config, 
							     // even if they are not delivered and not displayed.
					{
						topic: 'wetter/act-temp', // Topic to look for
						suffix: '°C',             // Displayed after the value
						decimals: 0,              // Round numbers to this number of decimals
						sortOrder: 10,            // sortOrder 10 has to contain the temperature 
						maxAgeSeconds: 18000,     // take Openweather value if older than 5 hours
					},
					{
						topic: 'wetter/act-hum',
						suffix: '%',
						decimals: 0,
						sortOrder: 20,            // sortOrder 210 has to contain the humidity
						maxAgeSeconds: 18000,
					},
					{
						topic: 'wetter/act-illum',
						sortOrder: 30,            // sortOrder 30 has to contain the illumination
						maxAgeSeconds: 18000,
					},
					{
						topic: 'wetter/act-wind-speed',
						suffix: 'km/h',
						decimals: 0,
						sortOrder: 40,            // sortOrder 40 has to contain the wind speed
						maxAgeSeconds: 18000,
					},
					{
						topic: 'wetter/act-wind-dir',
						suffix: '°',
						decimals: 0,
						sortOrder: 50,            // sortOrder 50 has to contain the wind direction
						maxAgeSeconds: 18000,
					},
					{
						topic: 'wetter/raining',
						suffix: '',
						decimals: 0,
						sortOrder: 60,            // sortOrder 60 has to contain the boolean if its just raining
						maxAgeSeconds: 18000,
						conversions: [
							{ from: "true", to: "ja" },
							{ from: "false", to: "nein" }
						]
					},
					{
						topic: 'wetter/rain-today',
						suffix: '',
						decimals: 1,
						sortOrder: 70,            // sortOrder 70 has to contain the amount of rain today
						maxAgeSeconds: 18000,
					},
					{
						topic: 'wetter/max-temp',
						label: 'Temperatur max',
						suffix: '',
						decimals: 0,
						sortOrder: 80,
						maxAgeSeconds: 180000,
					},
					{
						topic: 'wetter/min-temp',
						label: 'Temperatur min',
						suffix: '',
						decimals: 0,
						sortOrder: 90,
						maxAgeSeconds: 180000,
					},
				]
			}
        ],
	}
},

Configuration options

Option Description
address IP address of the MQTT Broker
port Port of MQTT Broker
user User to access the MQTT Broker (optional)
password Password of user to access the MQTT Broker (optional)

mmm-currentweather-mqtt's People

Contributors

spitzlbergerj avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

piridasi

mmm-currentweather-mqtt's Issues

I cannot connect to the broker

I can't connect to my mosquito broker where I have login and password. What should the configuration look like? Can you help me?

`{
module: "MMM-Currentweather-MQTT",
position: "top_right",
config: {
location: "XYZ",
locationID: "1234567",
appid: "",
roundTemp: true,
degreeLabel: true,
showWindDirection: true,
showWindDirectionAsArrow: true,
showHumidity: true,
showFeelsLike: false,
useBeaufort: false,
useKMPHwind: true,
logging: true,
useWildcards: false,
mqttServerAddress: '192.168.2.98', ???????????
mqttServerPort : '1883', ???????
mqttServerUser : 'user',
mqttServerPassword : 'password',

mqttServers: [
{
address: 'xxx.xxx.xxx.xxx', // Server address or IP address ???????????
port: '1883', // Port number if other than default ?????????
subscriptions: [ // for now, all seven values must be
// specified in the config,
// even if they are not delivered and not displayed.
{

The module MMM-Currentweather-MQTT is not displayed on the Smart

Hello!
Maybe you can help me, I think I have everything correctly installed, but I can't see the module appear on the Smart.

My config
{
module: "MMM-Currentweather-MQTT",
position: "top_right",
config: {
location: "Haedo",
locationID: "3430545", //ID from http://bulk.openweathermap.org/sample/; unzip the gz file and find your city
appid: "7679f84b5f444",
roundTemp: true,
degreeLabel: true,
showWindDirection: true,
showWindDirectionAsArrow: true,
showHumidity: true,
showFeelsLike: false,
useBeaufort: false,
useKMPHwind: true,
logging: true,
useWildcards: false,
mqttServers: [
{
address: '192.168.100.154', // Server address or IP address
port: '1883', // Port number if other than default
subscriptions: [
{
topic: 'ESPURNA-FA874C/temperature', // Topic to look for
label: 'Temperature', // Displayed in front of value
suffix: 'C', // Displayed after the value
decimals: 0, // Round numbers to this number of decimals
sortOrder: 10, // Can be used to sort entries in the same table
maxAgeSeconds: 6000, // Reduce intensity if value is older
},

		{
					topic: 'ESPURNA-FA874C/humidity',  // Topic to look for
					label: 'Humidity',       // Displayed in front of value
					suffix: 'C',              // Displayed after the value
					decimals: 1,               // Round numbers to this number of decimals
					sortOrder: 10,             // Can be used to sort entries in the same table
					maxAgeSeconds: 6000,        // Reduce intensity if value is older
				},	

DOS window log
MM-Currentweather-MQTT: Adding server: { address: '192.168.100.154',
port: '1883',
subscriptions:
[ { topic: 'ESPURNA-FA874C/temperature',
label: 'Temperature',
suffix: 'C',
decimals: 0,
sortOrder: 10,
maxAgeSeconds: 6000 },
{ topic: 'ESPURNA-FA874C/humidity',
label: 'Humidity',
suffix: 'C',
decimals: 1,
sortOrder: 10,
maxAgeSeconds: 6000 } ] }
MMM-Currentweather-MQTT: Starting client for: { serverKey: '192.168.100.154:1883',
address: '192.168.100.154',
port: '1883',
options: {},
topics: [ 'ESPURNA-FA874C/temperature', 'ESPURNA-FA874C/humidity' ] }
MMM-Currentweather-MQTT: Connecting to mqtt://192.168.100.154:1883
Creating new MQTT client for url: mqtt://192.168.100.154:1883

I can only see the classic weather module!
Any ideas?
Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.