Hi all,
I’ve created a Tado module. Check it out here: https://github.com/WouterEekhout/MMM-Tado/ .
Let me know what you guys think!
Hi all,
I’ve created a Tado module. Check it out here: https://github.com/WouterEekhout/MMM-Tado/ .
Let me know what you guys think!
@Stoffbeuteluwe I’m assuming self.config.units
is undefined on line 26. If that is the case then MagicMirror is having trouble reading in your global units configuration. Are you experiencing the same problem with other modules?
For your information, I am from the Netherlands and I also use the metric units. I tried your configurations settings from the following and it works for me.
@Stoffbeuteluwe said in MMM-Tado wrong units:
@sdetweil Hello, after module update same problem
and your fix don’t work anymore…can you help me again?
If you just want to get the module running and forget about problem replace line 26 to the following:
this.config.units = 'metric';
Be sure you are on the master branch before replacing.
@Stoffbeuteluwe I’ve updated the code with the suggestions of @sdetweil . For now I put it into a separate branch. If this solutions works for you, I will push it to the master branch.
Execute the following:
git pull
git checkout incorrect_pointer_in_getdom
Will you let us know if this solved your problem?
@sdetweil I disagree, it is unclear if the current config is not working or if he wanted a custom units setting for the app. @Stoffbeuteluwe Can you clarify if you wanted to set a different unit for the app?
@sdetweil Thank you for the clarification. Now it is clear why there is miscommunication. I use the units
from the general config settings: https://docs.magicmirror.builders/getting-started/configuration.html#general .
To clarify my config looks like this:
var config = {
address: "localhost",
port: 8080,
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
language: "en",
timeFormat: 24,
units: "metric",
modules: [
{
module: 'MMM-Tado',
position: 'top_right',
header: 'My Home',
config: {
username: 'x',
password: 'x',
updateInterval: 300000,
}
},
]
};
Notice that the units
-config is outside modules
-config. And not in the module-config. I think this makes more sense. Because of this self.config.units
does contain the correct value. I will update the readme about the units
-config, so it will be more clear.
@Wrangler It looks like you’ve made some changes to the MMM-Tado.js
file.
Try:
git checkout MMM-Tado.js
git pull
@sdetweil I don’t think we are on the same page. Your solution is not working for me, therefor I cannot reproduce it.
I tested it by setting my units
in the config.js as following:
var config = {
...
units: 'lipsum',
...
}
I add your recommendation and debug it:
As you can see, the self.config.units
is not ‘lipsum’.
If I keep my code like it is now:
As you can see now self.config.units
contains ‘lipsum’. Also the output on the screen is correct (It shows the temp in fahrenheit, because it is not equal to ‘metric’).
I might be overlooking something. But as far as I am seeing, it works correctly.
I cannot reproduce the problem. In my case the self.config.units
reads out the units from the config.js correctly. If I add var self = this
, then it will read out the defaults set in the MMM-Tado.js and not from the config.js.
My config.js looks like the following:
var config = {
...
units: "metric",
...
modules: [
...
{
module: 'MMM-Tado',
position: 'top_right',
header: 'My Home',
config: {
username: 'X',
password: 'X',
updateInterval: 300000,
}
},
...
]
};
Thanks for the feedback. The master-branch has been updated. After git pull
, do a npm install
.
Hi all,
I’ve created a Tado module. Check it out here: https://github.com/WouterEekhout/MMM-Tado/ .
Let me know what you guys think!