开云体育

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Anyone willing to write a Mr. cool Module?


 

I am looking to see if someone who can write a module to control Mr. Cool/SmartCielo would be willing to do so.

I found info here:

and


I reached out to our very own Jay Basen and he believes this may require adding a Raspberry Pi in the chain to translate some commands and make it work.?
This is way beyond my skill level, but I am willing to pay some for help getting a working module. I do have a Raspberry pi to test with as well.

Thank you,
Jon


 

开云体育

I'm not sure about the need for a Raspberry Pi but I'm no expert in javascript and when the code relies on javascript crypto libraries I know it isn't something I'm going to try and tackle.

Jay

On 2/19/2021 4:01 PM, j5races wrote:

I am looking to see if someone who can write a module to control Mr. Cool/SmartCielo would be willing to do so.

I found info here:

and


I reached out to our very own Jay Basen and he believes this may require adding a Raspberry Pi in the chain to translate some commands and make it work.?
This is way beyond my skill level, but I am willing to pay some for help getting a working module. I do have a Raspberry pi to test with as well.

Thank you,
Jon


 

Jason is correct. It is not essential to use a pi.? Almost computer could likely do it.? But a Pi would make sense because of it's low cost.

Not sure if it is exactly the same javascript crypto libraries, but node.js does supply javascript crypto libraries,? You might want to look at

In that document, they say you can test if your version of Node can execute the crypto libraries be running this test:

let crypto;
try {
? crypto = require('crypto');
} catch (err) {
? console.log('crypto support is disabled!');
}

I just ran this an one of my Pi's running node.js and yes crypto support is available.

I suspect Crestron is using node.js in their new series 4 processor for CH5.? So it may even be possible to do this on a series 4 assuming Crestron gives you the ability to run node javascript files yourself.? Although that is probably not the case because it would give you the ability to bypass CH5 and make your own webserver.

Really, javascript is not that hard to learn.? I am not really a? programmer type and I was able to learn it within the last year.? And I am sure I am a lot older then any of you guys. It would be a good idea to learn JavaScript if you plan to do any HTML5 projects.? Javascript is the language of the web browser.? All node is is a program that runs javascript outside of a browser -- usually has the backend for a web server.? And node has excellent documentation.


 

Seems like this might fix the Cryptojs encryption issue.



It's been a few years since I studied that in college but the math looks right to me, and rjndaelmanaged?is doing the lifting, which is a microsoft released class.

Might just be a bit of copy and pasting, but I don't have the thermostat around to check if it works.

On Fri, Feb 19, 2021 at 5:38 PM jbasen <jay.m.basen@...> wrote:

I'm not sure about the need for a Raspberry Pi but I'm no expert in javascript and when the code relies on javascript crypto libraries I know it isn't something I'm going to try and tackle.

Jay

On 2/19/2021 4:01 PM, j5races wrote:
I am looking to see if someone who can write a module to control Mr. Cool/SmartCielo would be willing to do so.

I found info here:

and


I reached out to our very own Jay Basen and he believes this may require adding a Raspberry Pi in the chain to translate some commands and make it work.?
This is way beyond my skill level, but I am willing to pay some for help getting a working module. I do have a Raspberry pi to test with as well.

Thank you,
Jon


 

开云体育

Yes I could spend the time to learn javascript but at this point it is a matter of time, focus, and return on investment.? Right now I'd rather figure out how to create a driver for Crestron Home than learn another programming language.

P.S. I don't think you have a chance of being the oldest guy here unless you're also on Medicare?

Jay

On 2/19/2021 9:20 PM, Steve Kuehn wrote:

Jason is correct. It is not essential to use a pi.? Almost computer could likely do it.? But a Pi would make sense because of it's low cost.

Not sure if it is exactly the same javascript crypto libraries, but node.js does supply javascript crypto libraries,? You might want to look at

In that document, they say you can test if your version of Node can execute the crypto libraries be running this test:

let crypto;
try {
? crypto = require('crypto');
} catch (err) {
? console.log('crypto support is disabled!');
}

I just ran this an one of my Pi's running node.js and yes crypto support is available.

I suspect Crestron is using node.js in their new series 4 processor for CH5.? So it may even be possible to do this on a series 4 assuming Crestron gives you the ability to run node javascript files yourself.? Although that is probably not the case because it would give you the ability to bypass CH5 and make your own webserver.

Really, javascript is not that hard to learn.? I am not really a? programmer type and I was able to learn it within the last year.? And I am sure I am a lot older then any of you guys. It would be a good idea to learn JavaScript if you plan to do any HTML5 projects.? Javascript is the language of the web browser.? All node is is a program that runs javascript outside of a browser -- usually has the backend for a web server.? And node has excellent documentation.


 

JB. I have no idea what to do for this stuff. If you would put something together I will test.

Jon


 
Edited

I'm not sure why a PC or Node.js is a requirement at all..? :/ The only reason why that is being used is to serve as a web-based solution within an easy to use npm package, although you should be able to do this entirely in C#.

Just because an open source library intended for web-based communication relies on node.js doesn't necessarily mean that this is the only option. If you can do without the node.js dependency and any required hardware, you effectively eliminate a layer of complexity (along with a point of failure) that you never needed from the start..

There's curl examples right here:?

I would personally avoid the unnecessary components and hardware for a better standalone solution.
--
?
Crestron Service Provider - TBD Enterprises Inc.


 

Troy,

I agree 100% with you -- it is best to keep it all confined in the Crestron processor.? But I gathered from the original poster that that for some reason, SIMPL# could not handle it.

But I think there is an even bigger? question here.? Does Mr Cool have an open API?? From the blog post, it appears the Mr Cool has a closed API.? If that is really case, do you want to spin your wheels writing a program only to find it breaks if Mr Cool has a firmware update or if someone replaces the controller board in Mr Cool that has a different protocol or if there are several different version of Mr. Cool.? I myself would never even consider telling a client that I can integrate Mr. Cool into Crestron because of that.

Now, if it was for my own system, I would have no issues intermixing technologies to get the job done.

Steve


 

开云体育

What I was able to figure out when I first looked at this was that Mr. Cool doesn't have an API.? However, what Jon's links in his original email point to is the javascript driver by Nicholas Robinson that communicates with a Cielo smart thermostat that is compatible with a Mr. Cool system.? I couldn't even find a published API for the Cielo smart thermostat so I'm not sure whether Nicholas Robinson figured it all out by sniffing the network or developed a relationship with Cielo and they provided him with one.?

The reason I passed on this was simply because I wasn't going to be effective at trying to reverse engineer something written in javascrip, especially something that appeared, to me, to be fairly complex.? Someone who is fluent in javascript might be able to knock this out in no time.? I just know that isn't me.

Jay

On 2/21/2021 6:23 PM, Steve Kuehn wrote:

Troy,

I agree 100% with you -- it is best to keep it all confined in the Crestron processor.? But I gathered from the original poster that that for some reason, SIMPL# could not handle it.

But I think there is an even bigger? question here.? Does Mr Cool have an open API?? From the blog post, it appears the Mr Cool has a closed API.? If that is really case, do you want to spin your wheels writing a program only to find it breaks if Mr Cool has a firmware update or if someone replaces the controller board in Mr Cool that has a different protocol or if there are several different version of Mr. Cool.? I myself would never even consider telling a client that I can integrate Mr. Cool into Crestron because of that.

Now, if it was for my own system, I would have no issues intermixing technologies to get the job done.

Steve


 

Troy,

I don't know any Sharp. I am willing to pay someone for help with this. Its for my own home as I have a home gym and a Mr. Cool unit in there.
I believe there were at a least a few of use Group members that had these units. so it would help more than just myself.

I wouldn't even know what to do with that curl example to try it from my PRO3.

Thank you


 

开云体育

I thought that the curl statements worked not directly against the Mr. Cool or the Cielo Smart Home Thermostat but through Node.js interface built by nicholas robinson that then talks to the Cielo thermostat.

To try and get to the bottom of what it would take to write a driver I've written an email to Cielo to see if I can get a copy of the API.

Thanks

Jay

On 2/22/2021 11:02 AM, j5races wrote:

Troy,

I don't know any Sharp. I am willing to pay someone for help with this. Its for my own home as I have a home gym and a Mr. Cool unit in there.
I believe there were at a least a few of use Group members that had these units. so it would help more than just myself.

I wouldn't even know what to do with that curl example to try it from my PRO3.

Thank you


 

The Curl statements work against the cielo smarthome api endpoint.

This is the API behind the UI you see in your browser when you use their website to control the thermostat.
It is a websocket based api (which curl supports), rather than polling, so i expect it's fairly responsive.? ?More to the point, it's a signalR based API () using websockets.

So the curl statements (and then websocket messages) can control/get data from the thermostats without a node.js interface or anything else.

The crypto/etc here is pretty easy to convert to C#.

To your question of how this was figured out, it's not usually that hard, sometimes you just look at the .js files that the UI uses, etc, and it's obvious.

Reading this code, ironically most of it is not needed, either for javascript, or C#.

What the author doesn't seem to have noticed is that, as mentioned, it is clearly a signalR based app (i can't tell what version, but if i had a login/thermostat, i could).?
Most of the code in the javascript here is sort of a by-hand hack-up of trying to emulate the signalr protocols, like the negotiate protocol and such.
This is not needed - microsoft provides a javascript client for signalr that can do all of this for you:


There is like 100 lines (maybe) of code needed here.
You just need the names of stuff in 273->329. Those are the method and message names that you use with the signalR client.
You also need the auth token grabbing, but that can be done pretty easily.

More to our speed, they also provide a C# .net client for SignalR. The latest is here:?
I haven't checked if this is compatible with the framework versions on Crestron.
But for sure, the older one (which should still work with the Cielo app) here will:?

(and there is lots of signalR client sample code)

Hopefully this helps - given there is a ready made library for working with this sort of API, it really should not be a hassle to deal with.


 

(In case anyone tries this).
For sure, you need the old client.? I poked at the endpoint and what it's running is compatible with the old client but not the new.


 
Edited

I'm a bit late to respond back on this thread, but DannyB had eloquently summarized a lot of what my initial thoughts were. This should be relatively easy to do, it just depends on having access to the endpoint to test code with, and budget I'd say. With websockets, there's also an increasing number of Crestron dealers and CSP's who have invested their time into developing such infrastructure and code bases. This is especially true, now that HTML5 and Javascript have essentially become part of the overall Crestron ecosystem moving forward.

If I was developing this, device access would be paramount (at least for initial testing, and to ensure reliability, but also to speed up the development time). Budget would be a factor too since things are reasonably busy for me for at least the next couple of weeks; I'd likely need to allocate some time on weekends to complete this if there's a sense of urgency here. In that case, if there's anyone else who has a bit more free time and would like to develop this, I'd be happy to let them have it if cost is a concern.

I try to limit the number of projects that I take on in order to maintain appropriate output in terms of quality.

Cheers!

--
?
Crestron Service Provider - TBD Enterprises Inc.