mirko3000 / MMM-xiaomi

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

how to add the two gateway in config.js file? #13

Closed xuepgao closed 5 years ago

xuepgao commented 5 years ago

Hi guys,

I have two temperature sensors. Each sensor registers with a gateway. Could anyone tell me how to add the two gateway in config.js file?

I try to add the following codes in config.js:


{
module: ‘MMM-xiaomi’,
position: ‘top_right’,
header: ‘Temperature / Humidity’,
config: {
gatewayIP: ‘192.168.186.181’,
gatewayToken: ‘xxxxxxxx-ceec093b30b1775dc741a7’,
showWindow: true,
showVentilation: true,
showLights: false,
audioNotifications: true,
rooms: [
{
name: ‘Bedroom’,
sortOrder: 20,
devices : [‘158d000xxxx9f’]
}
],
gatewayIP: ‘192.168.186.166’,
gatewayToken: ‘xxxxxxxx–927e2d20b22c22b007194c’,
rooms: [
{
name: ‘Childroom’,
sortOrder: 30,
devices : [‘158d000xxxx4f6’]
}
]
}
}

but MagicMirror always display the last sensor, which registers with the secondary gateway in config.js file.

![image](https://user-images.githubusercontent.com/48181152/53735589-4db81d00-3ec2-11e9-90ad-e894dc952560.png)

Could anyone give me some suggestions? Thanks in advance!
mirko3000 commented 5 years ago

Hello, currently only one gateway is supported, I guess this must be the issue here with your configuration. I honestly don't know how the system works with multiple gateways, I guess you currently will need two instances on the MMM-xiaomi module.

xuepgao commented 5 years ago

Ok, only one gateway is supported, I got it. Thank you for your suggestion.

xuepgao commented 5 years ago

@mirko3000 I'm a freshman about programing, could you tell me how to run two instances on the MMM-xiaomi module? Thanks again!

xuepgao commented 5 years ago

OK. I got it. I can add two instances in config.js file at the same time.

Thanks!