Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example code for ZigBee implementation #23

Open
zachfi opened this issue Feb 10, 2023 · 3 comments
Open

Example code for ZigBee implementation #23

zachfi opened this issue Feb 10, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@zachfi
Copy link

zachfi commented Feb 10, 2023

Hello,

I came across this project because I've been considering trying to use golang to connect to a ZigBee network. Several items in this project look interesting, like the bibliotek and zcl packages. If you would be so kind as to help me understand their use. Perhaps I know one of your contributors from Puppet back in the day, but perhaps I misremembered. In any case, greetings!

For context, I've been keeping gitHub.com/zachfi/znet which I would like to rewrite/replace, perhaps with a kubernetes controller. The project basically listens for messages on mqtt sent by zigbee2mqtt, which is a node project, but I am a go developer. There is no protocol spec that is machine consumable for zigbee2mqtt, so I manually instrument the message API in go to respond to events. This is somewhat tedious.

Now Ive been thinking of trying to use Go to connect directly to the USB ZigBee adapter. Is this something you are doing in Go with this project? If so, could you point out or explain how that works?

I've looked over the documents, but have a hard time seeing where the hemtjanst protocol ends and where the ZigBee protocol begins. Perhaps for my use the hemtjanst protocol is what I'm looking for to manage a couple dozen ZigBee devices in a personal environment.

Anyway, thank you for the interesting project and any discussion.

@bonan
Copy link
Member

bonan commented Feb 14, 2023

  • hemtjanst is a MQTT-based protocol for smart home controls, heavily influenced by homekit conventions
  • hemtjanst/hemtjanst (this repo) is a homekit bridge for the protocol
  • hemtjanst/bibliotek is a library for implementing hemtjanst endpoints
  • hemtjanst/zcl is a generic ZigBee library generated from hemtjanst/zyaml - it doesn't actually make use of anything hemtjanst specific, it only maps ZigBee commands and attributes into golang structs and funcs

I guess what you're looking for is the zcl library. Unfortunately there's not really any documentation or examples on how to use it.
I'm currently working on an unreleased project that bridges hemtjanst and ZigBee by using the library. Once that's done you could probably use it for inspiration.

@zachfi
Copy link
Author

zachfi commented May 7, 2023

Hello, it's been a little while and thought I'd check. The example implementation of the Zcl library you mention sounds interesting. Do you have that posted anywhere that I could look at?

@bonan bonan transferred this issue from hemtjanst/hemtjanst Jul 10, 2023
@bonan bonan changed the title Questions on usage, potentially in other projects Example code for ZigBee implementation Jul 10, 2023
@bonan bonan added the enhancement New feature or request label Jul 10, 2023
@bonan
Copy link
Member

bonan commented Jul 10, 2023

It is not posted anywhere yet as it's in need of some refactoring before it's useful outside my use case.

I will try to publish something as soon as I have the ability to sit down with the project for a few hours. I can't promise anything though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants