LowPowerLab Forum

Software support => Pi Gateway => Topic started by: DrEmil on May 26, 2016, 09:18:47 PM

Title: Two CS-50 Thermostats [solution]
Post by: DrEmil on May 26, 2016, 09:18:47 PM
Big house with two separate HVAC systems. How to add a second CS-50 to the PI Gateway? Tried just adding a second false node and and additional IP address in settings but didn't seem to work. I'm sure it is something simple. Thoughts?
Title: Re: Two CS-50 Thermostats
Post by: Felix on May 26, 2016, 09:49:35 PM
Hmm, why didnt i think of this.
The problem is that at the bottom of metrics.js there are 2 functions which always point to the same ip that is in settings.

exports.tstatPoll
exports.tstatRequest

So even if you add another setting, it is not used.

To make this work ... you'd need to either duplicate the entire set of event functions (including these 2 above) to make them point to your new setting. Or the setting to become a node setting, which is not supported at the moment, but it's on my feature list. Having node settings would be very useful in cases like this. Then the function would be generic, but it would point to a node setting which can vary from node to node. To support something like that, major changes are needed. I think your best bet is the first variant I mentioned.
Title: Re: Two CS-50 Thermostats
Post by: DrEmil on June 03, 2016, 05:31:31 PM
Thanks for the quick response. I've been busy at work but will work your solution tonight. Great product support and forum.
Best,
Eric
Title: Re: Two CS-50 Thermostats
Post by: Felix on June 04, 2016, 11:45:51 AM
If you end up duplicating the TSTAT functions, you will also need new events that call those functions. Just search for where the functions are used and then duplicate those events also (+ assign new names for events), I would just prepend everything with a "2" or whatever to distinguish. Although it's a duct tape solution I think this should work until i come up with a better solution.
Title: Re: Two CS-50 Thermostats
Post by: DrEmil on June 07, 2016, 01:35:44 PM
Works great just adding a 2 to everything thermostat related in both metrics.js and in settings.json (for the 2nd IP)

In metrics.js, the functions exports.tstatRequest2 and exports.tstatPoll2 call the thermostat API via URL/HTTP. In those two places be sure to leave the last part fo the URL '/tstat';   and NOT '/tstat2';. Since this is an API function, it is independent of other moteino-based definitions.

Many thanks!
Title: Re: Two CS-50 Thermostats
Post by: Felix on June 07, 2016, 01:44:04 PM
Awesome, glad to hear this worked!