Zigbee Modul: Wo ist der Source Code?

Hallo zusammen,

ich habe ein CC2538 Modul am Pi laufen und testweise eine erste RGB Lampe gekoppelt.

Ein-/ausschalten hat funktioniert, aber ändern von Helligkeit und Farbe habe ich nicht hinbekommen.

Bspw. folgender Befehl

rc $hg->setValue(15,11, "LEVEL_CONTROL.MOVE_TO_LEVEL.LEVEL", 10)

führt nur zu folgender Fehlermeldung:
12/27/20 18:54:09.706 Module Zigbee: Info: Entering SetValue…
12/27/20 18:54:09.706 Module Zigbee: Info: SetValue, dynamic packets…
12/27/20 18:54:09.706 Module Zigbee: getValuesFromPacket, packet type: 0x800
12/27/20 18:54:09.706 Module Zigbee: Info: sendPackets true but operation type is not command, so not sending

Jetzt wollte ich im Source Code schauen, woran denn “sendPackets” erkennt, was ein “command” ist und was nicht - aber scheinbar bin ich zu blöd. Im Github konnte ich kein Zigbee Modul finden, die Debian Installationsdateien enthalten auch nur Binaries.

Hat jemand einen Link zu den Quellen?

Danke und Gruß,
Florian

Das Zigbee-Modul ist soweit ich weiß (noch) nicht open-source, da es sich noch in der Entwicklung befindet.

@Adrian, maybe you can help out here?

1 Like

I really doubt that you would want to look into the sources, because with zigbee things are not that simple, the code is quite complex. Anyway, the code is closed source.

In fact, zigbee has ‘set’ and ‘get’ and ‘report’ packets (also variables that typically are read only, but some can be written) that have the habit of having more than one variable in them. In consequence, you might have to set more than one value in order to send a packet. The packet is sent when you set the last value in the packet.

Please print the config of the device and I’ll tell you what you’ll need to set. I’ll provide tomorrow also some info on where to look to figure out what those items correspond to.

In principle, things can get simpler with device xml files, maybe there is already one available for your device, maybe not yet. With a config print I could tell…

Thanks for your answer - does that mean the code will stay closed? That would make me switch to Z2M unfortunately, although I really dislike to have this npm stuff running in parallel to homegear…

I don’t know, I’m not the one to answer that question. All I can tell is that for now, several homegear modules are closed source.

If you still want to figure out what those items are, the proper places to start are ‘Zigbee Cluster Library Specification’ and the zigbee-clusters.xml file from /etc/homegear/families.

For example, LEVEL_CONTROL.MOVE_TO_LEVEL.LEVEL means Level Control zigbee cluster, Move To Level command. It has two fields in the payload, one is Level, one is Transition Time.

After one sets LEVEL_CONTROL.MOVE_TO_LEVEL.LEVEL, setting LEVEL_CONTROL.MOVE_TO_LEVEL.TRANSITION_TIME (to zero, for example) should send the command to the device.

If you still want to use the zigbee module I could help you find if there is an easier way for getting/setting those values. I could probably make an xml file for that device, if there isn’t one already available.

2 Likes