Page 5 of 9

Re: Individual Room Control ELV the MAX!

Posted: Sun Sep 04, 2011 11:29 pm
by blb
* slightly off-topic as well*

Due to the fact all data to/from the Max! Gateway (Cube) is Base64 coded, a proper functioning HexToBase64 and Base64ToHex function looks very necessary to me. It took me a long time to get a HexToBase64 and Base64ToHex function in vb for Homeseer, but it seems to work properly now:

Code: Select all

Sub Main(parm as object)

'b64 is a string containing base-64 encoded data
Dim b64  As String = "CwA6FwASGUAqAAAACwA13QASGQoqAAAA"

'convert base64 string to hex string
Dim hx   As String = Base64ToHex(b64)

'convert hex string to base64 string
Dim b64b As String = HexToBase64(hx)

'Display the converted strings
hs.WriteLog("Info", b64 & " " & hx & " " & b64b)


End Sub

Private Function Base64ToHex(base64string As String) As String
    Dim ret As String
    Dim b64bytes() As Byte = System.Convert.FromBase64String(base64string)
    For Each b As Byte In b64bytes
        ret &= Hex(b).PadLeft(2, "0"c)
    Next
    Return ret
End Function

Private Function HexToBase64(ByVal HexText As String) As String
    Dim HexTextBytes As Integer = HexText.Length \ 2 -1
    Dim result(HexTextBytes) As Byte
    Dim i As Integer
    For i = 0 To HexTextBytes
        result(i) = Convert.ToByte(HexText.Substring(i * 2, 2), 16)
    Next
    Return Convert.ToBase64String(result)
End Function

Re: Individual Room Control ELV the MAX!

Posted: Sun Sep 04, 2011 11:42 pm
by Digit
Great, I'll add this to the protocol topic, this is very useful information for a lot of members I guess! :)

Re: Individual Room Control ELV the MAX!

Posted: Mon Sep 05, 2011 12:26 am
by blb
Hi Digit,

something to add to the protocol topic:

L response:
the last 3 bytes (00 00 00) in your example is the end date and time if any specified. 00 00 00 means no end date/time, so current setpoint will be maintained as long as no other command received, overruling the default week program.

Re: Individual Room Control ELV the MAX!

Posted: Mon Sep 05, 2011 12:40 am
by Digit
Thanks,
I've discovered some more interesting bits & bytes regarding the L response this evening (like battery status; it's complete now, at least for Radiator Thermostats) so I will update all the information on the L response with what I discovered and add your information too.

Re: Individual Room Control ELV the MAX!

Posted: Mon Sep 05, 2011 10:13 pm
by Digit
Protocol has been updated.

Re: Individual Room Control ELV the MAX!

Posted: Tue Sep 06, 2011 11:20 pm
by blb
Hi all,

to avoid double work: I'm working on a VB script to integrate the Max! stuff in homeseer

Re: Individual Room Control ELV the MAX!

Posted: Tue Sep 06, 2011 11:37 pm
by Digit
Cool!
BTW Bernard, I changed the Date&Time decoding a bit; now dates in september are OK too :wink:

Re: Individual Room Control ELV the MAX!

Posted: Wed Sep 07, 2011 7:13 pm
by Bwired
blb wrote:Hi all,

to avoid double work: I'm working on a VB script to integrate the Max! stuff in homeseer
A script or a plugin, this needs a plugin :)

Re: Individual Room Control ELV the MAX!

Posted: Wed Sep 07, 2011 10:02 pm
by blb
It would be great to have a plugin, but that's beyond my capabilities I'm afraid. Until now I have integrated my OpenTherm CV and my PV inverter into Homeseer via vb scripts....
see http://www.domoticaforum.eu/viewtopic.p ... 34&start=0

Re: Individual Room Control ELV the MAX!

Posted: Sun Sep 11, 2011 10:50 pm
by Digit
Bernard,
Don't be afraid, it's a challenge! VB.Net is not that hard to understand.
When I started with my 1st plugin I hadn't worked with "a" Basic since years: Quick Basic & GFA Basic (on an Atari) in the mid 80's were the last things I did in Basic; so I had some catching-up to do.
If you know how to work with scripts and you're having fun doing it, I would certainly give it a try.
If the upcoming winter is long & dark enough,I can try to get you started with a plugin if you like to. :wink:

Homeseer Script to monitor & Control ELV MAX! Thermostats

Posted: Sun Sep 11, 2011 10:53 pm
by blb
Hi Digit,

thanks for this hard work!!

As mentioned, I'm busy writing a script for homeseer based on my own, but mainly your hard work to discover this protocol. Currently I'm outputting to logfile. Current status (I have 1 Cube and 2 Thermostats):

Code: Select all

11-9-2011 22:43:01  	debugL 	address: 0035DD tvalid: 1 Terror: 0 Tanswer: 0 mode: 00 Temp: 17 date: 31-12-2005
11-9-2011 22:43:01  	debugL 	address: 003A17 tvalid: 1 Terror: 0 Tanswer: 0 mode: 00 Temp: 16 date: 31-12-2010
11-9-2011 22:43:01  	debugC 	ComT: 21 EcoT: 17 MaxT: 30,5 MinT: 4,5 OffT: 3,5 WinT: 12
11-9-2011 22:43:01  	debugC 	address: 0035dd type: 01 SerialNR: IEQ0108836
11-9-2011 22:43:01  	debugC 	ComT: 21 EcoT: 17 MaxT: 30,5 MinT: 4,5 OffT: 3,5 WinT: 12
11-9-2011 22:43:01  	debugC 	address: 003a17 type: 01 SerialNR: IEQ0109618
11-9-2011 22:43:01  	debugC 	ComT: 0 EcoT: 5,5 MaxT: 0 MinT: 2 OffT: 32 WinT: 0
11-9-2011 22:43:01  	debugC 	address: 00bbfa type: 00 SerialNR: IEQ0112015
11-9-2011 22:43:01  	debugM 	00 01 56020201084261646B616D6572003A17020F5A6F6C646572206F7665726C6F6F700035DD0201003A17494551303130393631380D546865726D6F7374616174203101010035DD494551303130383833360D546865726D6F737461617420320201
11-9-2011 22:43:01  	debugH 	Cube Serial number: IEQ0112015 Cube Address: 00bbfa Cube Firmware: 0102

Re: Individual Room Control ELV the MAX!

Posted: Sun Sep 11, 2011 10:58 pm
by Rene
I can second that, when I started my Plugwise plugin I never programmed in basic, .net or anything else on Windows. I was a C and Unix guy. Just download the SDK and the example plugin written in vbnet and start from there.

Re: ELV MAX! protocol description

Posted: Tue Sep 20, 2011 1:22 pm
by blb
Hi all,

Status of my HS script (output only to log file):

Code: Select all

infoH 	Cube Serial number: IEQ0112015 Cube Address: 00BBFA Cube Firmware: 0102
infoM 	#rooms: 2 RoomNumber: 1 RoomName: Badkamer 1stAddressInRoom: 003A17
infoM 	#rooms: 2 RoomNumber: 2 RoomName: Zolder overloop 1stAddressInRoom: 0035DD
infoM 	#Devices: 2 DeviceType: 01 DeviceAddress: 003A17 SN: IEQ0109618 DeviceName: Thermostaat 1 DeviceRoom: 1
infoM 	#Devices: 2 DeviceType: 01 DeviceAddress: 0035DD SN: IEQ0108836 DeviceName: Thermostaat 2 DeviceRoom: 2
infoC1	address: 00BBFA type: 00 SerialNR: IEQ0112015
infoC2	address: 003A17 type: 01 SerialNR: IEQ0109618
infoC2	ComT: 21 EcoT: 17 MaxT: 30,5 MinT: 4,5 OffT: 0 WinT: 12 WinDur: 03 Boostdur: 5 min BoostVal: 80% datetime_decal: za 23:00uValve_Max: 100Valve_off: 0
infoC2	za Temp/Time: (1) 17/06:00 (2) 21/22:00 (3) 17/00:00
infoC2	zo Temp/Time: (1) 17/06:00 (2) 21/22:00 (3) 17/00:00
infoC2	ma Temp/Time: (1) 17/06:00 (2) 21/09:00 (3) 17/17:00 (4) 21/23:00 (5) 17/00:00
infoC2	di Temp/Time: (1) 17/06:00 (2) 21/09:00 (3) 17/17:00 (4) 21/23:00 (5) 17/00:00
infoC2	wo Temp/Time: (1) 17/06:00 (2) 21/09:00 (3) 17/17:00 (4) 21/23:00 (5) 17/00:00
infoC2	do Temp/Time: (1) 17/06:00 (2) 21/09:00 (3) 17/17:00 (4) 21/23:00 (5) 17/00:00
infoC2	vr Temp/Time: (1) 17/06:00 (2) 21/09:00 (3) 17/17:00 (4) 21/23:00 (5) 17/00:00
infoC3	address: 0035DD type: 01 SerialNR: IEQ0108836
infoC3	ComT: 21 EcoT: 17 MaxT: 30,5 MinT: 4,5 OffT: 0 WinT: 12 WinDur: 03 Boostdur: 5 min BoostVal: 80% datetime_decal: za 12:00uValve_Max: 100Valve_off: 0
infoC3	za Temp/Time: (1) 17/06:00 (2) 21/22:00 (3) 17/00:00
infoC3	zo Temp/Time: (1) 17/06:00 (2) 21/22:00 (3) 17/00:00
infoC3	ma Temp/Time: (1) 17/06:00 (2) 21/09:00 (3) 17/17:00 (4) 21/23:00 (5) 17/00:00
infoC3	di Temp/Time: (1) 17/06:00 (2) 21/09:00 (3) 17/17:00 (4) 21/23:00 (5) 17/00:00
infoC3	wo Temp/Time: (1) 17/06:00 (2) 21/09:00 (3) 17/17:00 (4) 21/23:00 (5) 17/00:00
infoC3	do Temp/Time: (1) 17/06:00 (2) 21/09:00 (3) 17/17:00 (4) 21/23:00 (5) 17/00:00
infoC3	vr Temp/Time: (1) 17/06:00 (2) 21/09:00 (3) 17/17:00 (4) 21/23:00 (5) 17/00:00
infoL 	address: 003A17 tvalid: 1 Terror: 0 Tanswer: 0 mode: Auto Temp: 17 date: --
infoL 	address: 0035DD tvalid: 1 Terror: 0 Tanswer: 0 mode: Auto Temp: 17 date: --

Re: Individual Room Control ELV the MAX!

Posted: Tue Sep 20, 2011 2:11 pm
by Rene
This sounds like an interesting solution, however I need something to control my kettle. The pump should be running and the kettle must be heating whenever a room thermostate indicates the set point is not reached yet. I could control the kettle using the outside temperature but this would mean running the pump all day long. Does anybody have a solution to signal the kettle without being dependent on software running on a server?

Re: Individual Room Control ELV the MAX!

Posted: Sat Oct 01, 2011 12:13 am
by blb
Hi All,

My first version of the Homeseer vb script for the Max Cube and Thermostat is ready. From the Readme file:

-- Thank you
Big thanks to Digit for the majority of the decoding work (see http://www.domoticaforum.eu/viewtopic.p ... 589#p50589)

-- Purpose:
Script to integrate Max Cube and Max Thermostats in Homeseer. After Initial setup via the ELV installation manual,
communication can be setup between Homeseer and the Max Cube.

-- Functionality current version (02):
establisch connection with Cube
Capture initial response from Cube after connection is establisched
Decoding all response as far as known per 20110930 (see http://www.domoticaforum.eu/viewtopic.p ... 589#p50589)
Create Homeseer Devices if they don't exist yet
Update Homeseer Devices

-- to do (03):
Send s: command (Send Device Command) in script and via webpage
Only decode l: Response (Device List)