Develloping questiong

Hi all!

For a while I’ve been looking for a professional home automation system which allowed interfacing with costum diy code.
An important feature for me is that the system is wired through cat cables (= ethernet cables). After an extensive search I found HomeMatic Wired and Homegear.

Before buying anything I’ve got a few question about how the HomeMatic Wired system and Homegear works. I hope i can get some answers over here.

  1. Does the communcation between the HomeGear wired modules through ethernet pass through the HomeGear module (= single point of failure) or do they communicate to each other using IP-routing and is HomeGear more of a observer in this process that can send commands to the modules as well?

  2. Is the ethernet communication encrypted of is it plain text with keys or something else? I’m unable to find any protocol information on the internet. Can it be wiresharked?

  3. What piece of the code on github is responsible for the communication with HomeGear wired modules? (a link would be great here :slight_smile: )

  4. My goal is to develop a costum application that can interface with the HomeMatic modules. I’d prefere C#, any advice?

HomeGaer and HomeMatic seems like the only system that have the features i’m looking for (wired, professional gear and with the ability to interface with a costum application). So some help to get started would really be appreciated!

Thank you!

Hey @Michvw,

I think @sathya should answer. I sadly don’t have any experience with homematic-wired. Some homeatic radio devices are AES encrypted though.

Could you find anything in the given module? https://github.com/Homegear/Homegear-HomeMaticWired

Also there is a C# example application available under https://github.com/Homegear/HomegearLib.NET

Cheers,
p

Hi @pmayer,

Thanks for the answer.

The C# example is what i would need for my application. Thank you. In the meantime i found out that CCU is only used to setup HomeMatic wired, the modules communicate with each other without the use of the center.

I’ve got some new questions however;

  1. Is there a function in the .NET library that gets called every time an input or output from a module changes? Or is polling required? And if so how does the polling impacts trafic to the modules (latency?)

  2. In the example there’s:
    homegear.Devices[myActorId].Channels[1].Variables[“STATE”].BooleanValue = true
    This is documented as the way to set an output of a module (to switch a light for example). Is is possible to perform a read with it (in the scenario polling is needed). code to read out would be;
    bool lightState = homegear.Devices[myActorId].Channels[1].Variables[“STATE”].BooleanValue;

Goal is to build a costum web application (with low latency :wink: )

Thanks!

…paging @sathya :slight_smile:

Hi @Michvw,

Yes.

Yes, it can be wireshared. But you need to decrypt the recorded communication afterwards for example with: https://homegear.eu/downloads/HM-LGW%20Packet%20Analyzer.exe

Yes. No polling is required. You can use the event “homegear.DeviceVariableUpdated”. It is raised on any device variable changes.

Yes, you can read the value. It always contains the current value and is updated when the value is changed.

Cheers,

Sathya

Thanks for the answers @sathya!
I hope you don’t mind but i have few follow up questions.
I’m really interested in the communication between the homematic wired modules and how you communicate with them.

  1. Where do you get the security key? it’s probably not the same for all homematic wired devices?
    EDIT: it’s on the lan gateway
  2. I’d like to write a C# class myself to communicate with the modules, do you have any documentation somewhere of the structure of the tcp/ip packets?
  3. howmany commands does a wired module have? (set value, read value, etc…)

I’m having trouble with finding information on how to set up the wired modules to communicate with each other using homegear. Is this possible? Or do i need a homematic CCU2 for that?

EDIT: if the answer to question 2 and 3 is a bit to much to ask: i don’t mind. Unfortunatly al the documentation about homegear and homematic is in german which makes mu use allot of google translate :slight_smile:

I have a buying list for my first setup, its a lan gateway, rs485 io module and a bus terminator module.
Can I use homegear to configure the io module (ex: switch actuator X on input Y) or do I need to buy the CCU2? I’m planning on using homegear on a raspberry pi and not using the CCU2 so naturaly i’m not a fan of buying one… (by the way: does the CCU2 WebUI have an english mode?)

After getting the setup to work with homegear I might try to build a C# library to communicate with the modules (reason: I’m a windows guy :slight_smile: :slight_smile: ) I have a good knowledge about routing and tcp/ip packets so I’m up for it.

Reading about homematic wired I’ve made some assumptions, can someone verify them?
1)As the central unit can be removed the units communicate directly with each other this is very nice advantage. Does the gateway send out a broadcast if an input changes? (even when the actuator that has to change is on the same module?). I’m assuming a broadcast because that would allow the CCU2 and the other modules to pick it up and it would make te system simple and less prone to error.
2)The lan gateways all have the same security key

I know i’m asking quite allot of question, I’m willing to return the favor by documenting my progress (in English) for other people.

@sathya: I saw your homematic hacking session on youtube: impressive!! You showed the exactly why I like a wired system!

thanks!

No. You would need to find out by reading source code or by sniffing.

I don’t know, maybe 50 different message types? I would need to read into it myself again. It’s been some time ;-).

Yes, that’s possible. Either by using the RPC method “addLink” or by using the HomeMatic Configurator. It should also be possible to use the HomeMatic Manager.

Yes. Use the tools mentioned above. You can also use the test program of “HomegearLib.NET”.

Yes.

Yes.

No.

Thanks ;-).

Cheers,

Sathya