Coder Social home page Coder Social logo

mmm-tado's Introduction

MagicMirror Module: MMM-Tado

A MagicMirror Module for your Tado Smart Thermostat.

The module displays the following information:

  • A symbol to show if the heater is currently active.
  • The current temperature
  • The target temperature
  • The humidity
  • The hot water temperature, if not available; the current power state

Screenshot

screenshot

Installation

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

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/WouterEekhout/MMM-Tado

Install NPM dependencies from inside the MMM-Tado folder:

cd MMM-Tado/
npm install

Configure the module in your config.js file.

Using the module

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

units: 'metric',

modules: [
    {
        module: 'MMM-Tado',
        position: 'top_right', // This can be any of the regions.
        config: {
            username: 'your_tado_username', 
            password: 'your_tado_password', 
            updateInterval: 300000
        }
    }
]

Configuration options

The following properties can be configured:

Option Description
username Required - Your Tado username.
password Required - Your Tado password.
updateInterval Optional - In milliseconds the update interval. Default: 300000 (5 minutes). This value cannot be lower than 300000. Otherwise users get a Tado block.
units What units to use. This property can be set in the general configuration settings. See the MagicMirror Documentation for more information.

This module is powered by the Tado API.

Credits

This module is highly inspired by the MMM-Toon module: https://github.com/MichMich/MMM-Toon.

Using the NPM package node-tado-client: https://github.com/mattdavis90/node-tado-client

mmm-tado's People

Contributors

woutereekhout avatar lordvalium avatar

Stargazers

Tobias Stadler avatar  avatar  avatar  avatar Rico avatar Taco Oldenburger avatar

Watchers

 avatar  avatar

mmm-tado's Issues

Ability to hide humidity

Hi - more of a enhancement than bug - It would be great if one of the config options was to hide Humidity. I dont really refer or look at this data.

I realise that this is quite personal - so feel free to ignore - ha!

Still a great module by the way!

doesnt display any data

Hi, this isnt working for me - the module doesnt show any data.

Any ideas why?

The following output is present in the console.

Load script: modules/MMM-Tado//MMM-Tado.js
module.js:415 Module registered: MMM-Tado
loader.js:152 Bootstrapping module: MMM-Tado
loader.js:182 Load script: modules/MMM-Tado//js/lib/jquery.min.js
loader.js:182 Load script: modules/MMM-Tado//js/lib/lodash.min.js
loader.js:182 Load script: modules/MMM-Tado//js/tado-client.js
loader.js:157 Scripts loaded for: MMM-Tado
loader.js:192 Load stylesheet: modules/MMM-Tado//css/MMM-Tado.css
loader.js:192 Load stylesheet: modules/MMM-Tado//css/font-awesome-4.7.0/css/font-awesome.min.css
loader.js:159 Styles loaded for: MMM-Tado
loader.js:161 Translations loaded for: MMM-Tado
module.js:117 MMM-Tado received a system notification: ALL_MODULES_STARTED
module.js:117 MMM-Tado received a system notification: DOM_OBJECTS_CREATED
MMM-Tado.js:95 Uncaught TypeError: Cannot read property 'celsius' of null
at MMM-Tado.js:95
at u (lodash.min.js:1)
at Function.gf (lodash.min.js:2)
at MMM-Tado.js:76
at u (lodash.min.js:1)
at Function.gf (lodash.min.js:2)
at Class.getDom (MMM-Tado.js:60)
at updateDom (main.js:99)
at Object.updateDom (main.js:472)
at Class.updateDom (module.js:296)
tado-client.js:16 Uncaught TypeError: callback is not a function
at Object.success (tado-client.js:16)
at fire (jquery.js:3187)
at Object.fireWith [as resolveWith] (jquery.js:3317)
at done (jquery.js:8785)
at XMLHttpRequest. (jquery.js:9151)
tado-client.js:16 Uncaught TypeError: callback is not a function
at Object.success (tado-client.js:16)
at fire (jquery.js:3187)
at Object.fireWith [as resolveWith] (jquery.js:3317)
at done (jquery.js:8785)
at XMLHttpRequest. (jquery.js:9151)

this pointer used incorrectly in forEach

in the forEach() (line 47 of MMM-Tado.js) loop thru the zone info, one of the this.config.units uses self (line 69) (set on line 32) , the rest (4) use this.config.units, (lines 98, 121, 161, and 190)

but... unless you specifically pass the second parm (after the function) in the forEach invocation 'this' is undefined inside the foreach , so the test fails, and the result is Fahrenheit display is selected

see 22.1.3.12 Array.prototype.forEach
https://tc39.es/ecma262/#sec-ecmascript-language-statements-and-declarations

the 4 statements should be changed to self.config.units

node_modules without actual node module

Hey there,

just checked your changes using the node_helper. Everything works fine, except that you should not be using the node_modules folder for modules which are not actual node modules. Instead, try using e.g. this npm module:
https://github.com/mattdavis90/node-tado-client

Works almost the same as the tado-client.js you are using, but you can simply install it via
npm install node-tado-client

Best regards,
Mirko

Heating symbol

Hi and thank you for this. It shows current temp and target temp, but it doesn't show the heating symbol and the Home name. This is my config:
module: 'MMM-Tado', position: 'bottom_left', // This can be any of the regions. config: { username: 'username', password: 'password', updateInterval: 300000

Target temperature - shown after current temperature

Not so much of a bug but more of a feature request - so not sure this belongs here. Happy to close and raise somewhere else.

Great module by the way - it would be awesome if it should show the target temperature after the current temperature. (maybe in a smaller size)

Data is held here as 'celcius'

"setting": {
"type": "HEATING",
"power": "ON",
"temperature": {
"celsius": 21,
"fahrenheit": 69.8
}

It would be useful as this replicates the data shown in the tado app.

Blank screen on Magic Mirror

Hi all,

I would love to use this module, but I just can't get it working. It just blanks the entire MM. If i comment out the config lines, then everything else on the MM comes back. I don't even get the config error screen. I can get all the Tado website API info manually using the links provided in the previous issue.

Any help would be greatly appreciated, I am quite new to this....

          `{
                    module: "MMM-Tado",
                    position: "bottom_right",
                    config: {
                            username: "MY TADO USERNAME (EMAIL)",
                            password: "MY TADO PASSWORD",
                            updateInterval: 300000
                            }
            },`

Support for air conditioning control

here's my output:

{ "tadoMode": "AWAY", "geolocationOverride": false, "geolocationOverrideDisableTime": null, "preparation": null, "setting": { "type": "AIR_CONDITIONING", "power": "OFF" }, "overlayType": null, "overlay": null, "openWindow": null, "nextScheduleChange": null, "nextTimeBlock": { "start": "2019-04-17T20:00:00.000Z" }, "link": { "state": "ONLINE" }, "activityDataPoints": { "acPower": { "timestamp": "2019-04-16T17:02:37.895Z", "type": "POWER", "value": "OFF" } }, "sensorDataPoints": { "insideTemperature": { "celsius": 18.45, "fahrenheit": 65.21, "timestamp": "2019-04-17T09:03:11.316Z", "type": "TEMPERATURE", "precision": { "celsius": 0.1, "fahrenheit": 0.1 } }, "humidity": { "type": "PERCENTAGE", "percentage": 76.90, "timestamp": "2019-04-17T09:03:11.316Z" } } }

Module displays in Fahrenheit even when unit is explicitly called out

The module displays in Fahrenheit despite being configured in metric

Config:

var config = {
	address: "Redacted", // Address to listen on, can be:
	                      // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
	                      // - another specific IPv4/6 to listen on a specific interface
	                      // - "0.0.0.0", "::" to listen on any interface
	                      // Default, when address config is left out or empty, is "localhost"
	port: 8080,
	ipWhitelist: [], // Set [] to allow all IP addresses
	                                                       // or add a specific IPv4 of 192.168.1.5 :
	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
	                                                       // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],

	useHttps: false, 		// Support HTTPS or not, default "false" will use HTTP
	httpsPrivateKey: "", 	// HTTPS private key path, only require when useHttps is true
	httpsCertificate: "", 	// HTTPS Certificate path, only require when useHttps is true

	language: "en",
	timeFormat: 24,
	units: "metric",     // Called out in base config
       {
            module: 'MMM-Tado',
            position: 'top_right', // This can be any of the regions.
            config: {
                username: 'RED@CTED', 
                password: 'REDACTED', 
                updateInterval: 300000,
                units: 'metric'.       // Called out in Module
            }
        },

Screenshot 2020-07-24 at 08 32 00

Lot of warnings

Hi,

Thanks for the nice module. I receive a lot of warnings at the npm install command.

npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated [email protected]: simple-oauth2 v2 is no longer supported. Please upgrade to v3 for further support
npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/wreck. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/bourne. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/boom. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

install errors

Hey there,

did i need the Tado-abo to use these modul?
if i want to install MMM-Tado, i get this issues
i used the Version of MagicMirror 2.18.0

pi@raspberrypi:~/MagicMirror/modules/MMM-Tado $ sudo npm install

up to date, audited 107 packages in 5s

18 packages are looking for funding
  run `npm fund` for details

3 moderate severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.


pi@raspberrypi:~/MagicMirror/modules/MMM-Tado $ npm fund
[email protected]
├─┬ https://opencollective.com/mochajs
│ │ └── [email protected]
│ ├── https://github.com/sponsors/sindresorhus
│ │   └── [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
│ ├── https://github.com/sponsors/isaacs
│ │   └── [email protected]
│ ├── https://github.com/chalk/supports-color?sponsor=1
│ │   └── [email protected]
│ ├── https://github.com/sponsors/jonschlinkert
│ │   └── [email protected]
│ ├─┬ https://github.com/chalk/chalk?sponsor=1
│ │ │ └── [email protected]
│ │ └── https://github.com/chalk/ansi-styles?sponsor=1
│ │     └── [email protected]
│ ├── https://github.com/sponsors/feross
│ │   └── [email protected]
│ └── https://github.com/chalk/wrap-ansi?sponsor=1
│     └── [email protected]
└── https://github.com/sponsors/RubenVerborgh
    └── [email protected]


pi@raspberrypi:~/MagicMirror/modules/MMM-Tado $ sudo npm audit fix

up to date, audited 107 packages in 4s

18 packages are looking for funding
  run `npm fund` for details

# npm audit report

ansi-regex  >2.1.1 <5.0.1
Severity: moderate
 Inefficient Regular Expression Complexity in chalk/ansi-regex - https://github.com/advisories/GHSA-93q8-gq69-wqmw
fix available via `npm audit fix`
node_modules/ansi-regex
  strip-ansi  4.0.0 - 5.2.0
  Depends on vulnerable versions of ansi-regex
  node_modules/strip-ansi
    string-width  2.1.0 - 4.1.0
    Depends on vulnerable versions of strip-ansi
    node_modules/string-width

3 moderate severity vulnerabilities

To address all issues, run:
  npm audit fix



any ideas how to fix this?

my MagicMirror shows always black!

this is my config.js


let config = {
	...
	language: "de",
	locale: "de-de",
	logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
	timeFormat: 24,
	units: "metric",
	...
	modules: [
		{
			module: "alert",
		},
		...
		{
			module: "MMM-Tado",
			position: "bottom_right", // This can be any of the regions.
			header: "Tado",
			config: {
				username: "MyE-mail", 
				password: "myPW", 
				updateInterval: 30000
			}
		},
		...
	]
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}

Module doesnt show - No hot water temp error

Hi -

Ive realised that the module errors when my hot water is on -

The error in the console is:
Uncaught TypeError: Cannot read property 'celsius' of null
at MMM-Tado.js:100
at u (lodash.min.js:1)
at Function.gf (lodash.min.js:2)
at MMM-Tado.js:77
at u (lodash.min.js:1)
at Function.gf (lodash.min.js:2)
at Class.getDom (MMM-Tado.js:61)
at updateDom (main.js:99)
at Object.updateDom (main.js:472)
at Class.updateDom (module.js:296)

I think this is because of my Tado system - it heats my hot water but it doesnt measure the temperature of the water - my boiler does that itself.

As such when my water is being heated, the module disappears. Can it be altered to show Water is being heated, when you have a system that doesnt have a hot water temperature variable?

My output is:

{
"tadoMode": "HOME",
"geolocationOverride": true,
"geolocationOverrideDisableTime": "2017-01-13T06:00:00Z",
"preparation": null,
"setting": {
"type": "HOT_WATER",
"power": "ON",
"temperature": null
},
"overlayType": "MANUAL",
"overlay": {
"type": "MANUAL",
"setting": {
"type": "HOT_WATER",
"power": "ON",
"temperature": null
},
"termination": {
"type": "TIMER",
"durationInSeconds": 1800,
"expiry": "2017-01-12T20:03:08Z",
"remainingTimeInSeconds": 1388,
"projectedExpiry": "2017-01-12T20:03:08Z"
}
},
"link": {
"state": "ONLINE"
},
"activityDataPoints": {},
"sensorDataPoints": {}
}

Error - when heating manually turned off

Hi - me again (sorry). Still figured you would want want issues and bugs logged - so here goes.

Noticed the module errors when the heating manually turned off.

error in console is :

Uncaught TypeError: Cannot read property 'celsius' of null
at MMM-Tado.js:149
at u (lodash.min.js:1)
at Function.gf (lodash.min.js:2)
at MMM-Tado.js:77
at u (lodash.min.js:1)
at Function.gf (lodash.min.js:2)
at Class.getDom (MMM-Tado.js:61)
at updateDom (main.js:99)
at Object.updateDom (main.js:472)
at Class.updateDom (module.js:296)

output of api is:

{
"tadoMode": "HOME",
"geolocationOverride": false,
"geolocationOverrideDisableTime": null,
"preparation": null,
"setting": {
"type": "HEATING",
"power": "OFF",
"temperature": null
},
"overlayType": "MANUAL",
"overlay": {
"type": "MANUAL",
"setting": {
"type": "HEATING",
"power": "OFF",
"temperature": null
},
"termination": {
"type": "MANUAL",
"projectedExpiry": null
}
},
"link": {
"state": "ONLINE"
},
"activityDataPoints": {
"heatingPower": {
"type": "PERCENTAGE",
"percentage": 0,
"timestamp": "2017-01-15T12:54:54.476Z"
}
},
"sensorDataPoints": {
"insideTemperature": {
"celsius": 21.47,
"fahrenheit": 70.65,
"timestamp": "2017-01-15T12:54:50.882Z",
"type": "TEMPERATURE",
"precision": {
"celsius": 0.1,
"fahrenheit": 0.1
}
},
"humidity": {
"type": "PERCENTAGE",
"percentage": 42.4,
"timestamp": "2017-01-15T12:54:50.882Z"
}
}
}

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.