mirko3000 / MMM-xiaomi

Xiaomi smarthome plugin for the magic mirror
26 stars 3 forks source link

Problem refreshed data temperature humidity #17

Closed jim21700 closed 4 years ago

jim21700 commented 4 years ago

Hello,

Can you help me please ? I managed to install this module on my mirror. The data from my temperature sensors is displayed but the data is not refreshed. I know there are "updateInterval: 30," and "animationSpeed: 1000," but I don't know how it works. And I don't know anything about it in javascript ...

I would appreciate it if someone could explain to me how to automatically refresh the temperature data.

Thank you very much for your help.

mirko3000 commented 4 years ago

Hello Jim, is the issue resolved for you now?

jim21700 commented 4 years ago

Hello mirko3000,

Indeed it works. But, if you set the parameter to 5 min, this does not mean that the gateway sends information every 5 min. Sometimes there may be a time lag when looking with the app on the phone.

On the other hand, another thing which works less well and which I would have to clarify. when we modify the .CSS. The layout of rooms, temperature and humidity does not change. Even by creating a custom.css. The main.css file applies formatting by default and therefore impossible to modify just with classes. What is written in the code MMM-xiaomi.js on line 100. It is necessary to write in the custom.css ".MMM-xiaomi .light" for example to change the formatting. ".xm-room-temp" it won't work.

You know what I mean?

mirko3000 commented 4 years ago

The "updateInterval" is not meant to set the update interval of your sensor, but a reconnect to the gateway. This is required as it gets disconnected after 30 minutes. Sensor updates should get published immediately by events, if this does not work there seems to be another issue on your configuration.

For customization I would recommend editing the MMM-xiaomi.css file, here you should find all formatting and design. You might have to introduce new classes and set those in MMM-xiaomi.js, starting at line 100.

jim21700 commented 4 years ago

Ok impeccable, creating classes to change formatting.

However, updating the data no longer works. and there I don't understand why. When starting npm start, it will look for the right information and after that it remains in the state ...

mirko3000 commented 4 years ago

You can try uncommenting line 110 in node_helper.js: console.log(new Date() + ": " + event.id + " updated property '" + event.property + "' (" + event.oldValue + " --> " + event.value + ")");

This is the part where the devices send updates on changed properties. If you don't get any logs here, means there is something wrong with your setup - not related to the plugin here.

jim21700 commented 4 years ago

Thank you very much for the information.

I allow myself to ask too. How is it possible that with just a js code you can retrieve information from a xiaomi gateway?

I say that because it's been months since I try with jeedom and domoticz to bring back the information of my gateway and that it does not work. The developer mode is however activated but I have a bug at the opening of the port 9898. Without the unlocking of this port, impossible to access my gateway and my temperature probes.

Whereas you, just with a script by writing the token and the ip. it works. How is it possible ? (it's amazing ^^)