Individual Room Control ELV the MAX!

Forum about the home automation suites by ELV etc

Moderator: jrkalf

Re: Individual Room Control ELV the MAX!

Postby blb » Sun Sep 04, 2011 10:29 pm

* 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
Bernard
blb
Member
Member
 
Posts: 140
Joined: November 2010

Re: Individual Room Control ELV the MAX!

Postby Digit » Sun Sep 04, 2011 10:42 pm

Great, I'll add this to the protocol topic, this is very useful information for a lot of members I guess! :)
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Re: Individual Room Control ELV the MAX!

Postby blb » Sun Sep 04, 2011 11:26 pm

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.
Bernard
blb
Member
Member
 
Posts: 140
Joined: November 2010

Re: Individual Room Control ELV the MAX!

Postby Digit » Sun Sep 04, 2011 11:40 pm

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.
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Re: Individual Room Control ELV the MAX!

Postby Digit » Mon Sep 05, 2011 9:13 pm

Protocol has been updated.
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Re: Individual Room Control ELV the MAX!

Postby blb » Tue Sep 06, 2011 10:20 pm

Hi all,

to avoid double work: I'm working on a VB script to integrate the Max! stuff in homeseer
Bernard
blb
Member
Member
 
Posts: 140
Joined: November 2010

Re: Individual Room Control ELV the MAX!

Postby Digit » Tue Sep 06, 2011 10:37 pm

Cool!
BTW Bernard, I changed the Date&Time decoding a bit; now dates in september are OK too :wink:
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Re: Individual Room Control ELV the MAX!

Postby Bwired » Wed Sep 07, 2011 6:13 pm

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 :)
User avatar
Bwired
Administrator
Administrator
 
Posts: 5308
Joined: March 2006
Location: Netherlands

Re: Individual Room Control ELV the MAX!

Postby blb » Wed Sep 07, 2011 9:02 pm

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 viewtopic.php?f=47&t=6634&start=0
Bernard
blb
Member
Member
 
Posts: 140
Joined: November 2010

Re: Individual Room Control ELV the MAX!

Postby Digit » Sun Sep 11, 2011 9:50 pm

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:
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Homeseer Script to monitor & Control ELV MAX! Thermostats

Postby blb » Sun Sep 11, 2011 9:53 pm

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
Last edited by blb on Fri Nov 04, 2011 11:46 pm, edited 2 times in total.
Bernard
blb
Member
Member
 
Posts: 140
Joined: November 2010

Re: Individual Room Control ELV the MAX!

Postby Rene » Sun Sep 11, 2011 9:58 pm

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.
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1689
Joined: October 2008
Location: Netherlands

Re: ELV MAX! protocol description

Postby blb » Tue Sep 20, 2011 12:22 pm

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: --
Bernard
blb
Member
Member
 
Posts: 140
Joined: November 2010

Re: Individual Room Control ELV the MAX!

Postby Rene » Tue Sep 20, 2011 1:11 pm

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?
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1689
Joined: October 2008
Location: Netherlands

Re: Individual Room Control ELV the MAX!

Postby blb » Fri Sep 30, 2011 11:13 pm

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 viewtopic.php?t=6654&p=50589#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 viewtopic.php?t=6654&p=50589#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)
Attachments
hs_max_02.zip
contains 3 files in 3 directories, it should be possible to extract the archive in the hs directory
(7.3 KiB) Downloaded 208 times
Bernard
blb
Member
Member
 
Posts: 140
Joined: November 2010

PreviousNext

Return to Homematic, FS20, FHT, ESA and ELV

Who is online

Users browsing this forum: No registered users and 1 guest