Hello ReX, I just read your post. I would be interested too !!! Is there now a possibility of integration? For the official components “Terma” is not listed, but maybe there is a “custom_component” or a way about “NodeRED” or another possibility?
Apparently there is no way to integrate as they don’t want to expose the API (I’ve asked). Eventually I decided to manage the heating element with an external wifi switch (Shelly 1).
Apologies for reviving this very old topic. We are considering buying multiple heaters with Therma Moa blue heating elements, and I am very much interested in this solution of using a Shelley 1 to manage the heater. My question is how the power setting of the heater works. I can imagine that it always starts in the lowest setting whenever it is turned on, or does it remember the setting from when it turned off? Thanks!
6: Manual operation, based on heating element temperature
7: Schedule, based on room temperature
8: Schedule, based on heating element temperature
Schedule
No idea, use the app or set your schedule in HA.
Timer
No idea, use the app or manually set a timer on HA.
Temperature encoding
That’s where it gets interesting. Temperatures are encoded on 4 bytes.
First and second byte are the current temp.
Third and forth byte are the target temp.
To calculate the current temp in ºC = ((firstByteToInt * 255) + secondByeToInt) / 10
To calculate the target temp in ºC = ((thirdByteToInt * 255) + fourthByteToInt) / 10
Examples (I’m representing the value in Hex, so it is readable):
30º 012d
35º 015F
40º 0191
45º 01c2
50º 01f5
55º 0232
60º 0264
Setting target temperature
You have to write the appropriate characteristic.
If you’re running in mode 5 (room temp) use “D97352B1-D19E-11E2-9E96-0800200C9A66” (temp range: 15-30 ºC).
If you’re running in mode 6 (heating element temp) use “D97352B2-D19E-11E2-9E96-0800200C9A66” (temp range: 30-60 ºC).
You’ll first have to convert your target temp to hex. I have no time right now to write the exact formula but you have to reverse the other formulas I’ve posted.
Let’s say you want to set the unit to 30ºC, that’s 012d
You have to send to set the characteristics to [current temp][target temp]; current temp can be 0000 because you don’t care about that.
Example: 0000012d will set the heating element to heat to 30º (either room temp or heating element temp, depending on the characteristic you write).
Thank you for your contribution. I am trying to reverse engineer a generic unbranded radiator that has Bluetooth control but the app was discontinued a long time ago and so am struggling to reverse engineer this.
I am currently using gatttools on linux but am not sure how to decode the values. I tried to work out what you did by using one of your values for example “012d”. I’ve tried different online tools for example:
Hi Toby.
As ptuk says, you have to convert from hex to decimal as you are doing, but them you need to divide the result by 10:
To calculate the current temp in ºC = ((firstByteToInt * 255) + secondByeToInt) / 10
To calculate the target temp in ºC = ((thirdByteToInt * 255) + fourthByteToInt) / 10
That’s why the second link gives you 012d → 301. Divide that by 10 and you get the value 30.
@ptuk I’d also love to know how you run this code. I’ve been trying to figure if it should be put into node.js or node red, but not had any success with either
I’ve managed to run the code from command line by adding an init(); line to the end and running it from node.js, however, it fails to read the services/capabilities from the device.
Not sure if mine is just a slightly different model, or if something has changed on them, but using one of the ‘noble’ examples to do a barebones connection, also seems to return empty arrays for them
"cc:22:xx:xx:xx:xx":{"address":"cc:xx:xx:xx:xx:xx","addressType":"public","connectable":true,"advertisement":{"localName":"MOA Blue TERMA","txPowerLevel":8,"serviceData":[],"serviceUuids":[],"solicitationServiceUuids":[],"serviceSolicitationUuids":[]},"rssi":-85,"count":2,"hasScanResponse":false},
Hi there. there’s no easy way to run it. Noble has proven very unreliable on this device.
What I do is having a node server that runs gatttool in interactive mode, reading the Bluetooth characteristics and publishing updates via websocket. It also accepts post requests to set the state of the unit.
I could open source it if you think that would help.
Thanks for the offer @ptuk , I’m not sure it would though.
I can’t see that I can get anything working while the device isn’t sending services or capabilities.
It’s not just this way with the noble / javascript code, I’m also not getting them when using gatttools or bluetoothctl
Did you have to pair the device to the connecting computer or did it work for you without?