Giter Site home page Giter Site logo

Comments (7)

pwood avatar pwood commented on June 19, 2024

Hello! Thanks for taking a look at this project - fair warning it's still not stable. I've had to take a short break from this - but I'll be back soon. But for now...

A couple of things:

  • You've managed to successfully join a device to your network? Did you get the node object from zigbee.NodeJoinEvent?
  • You are constantly reading events with z.ReadEvent()?
  • What is device you're trying to query? Does it act as a router or an end-device? I still have problems with the behaviour of some simplier end devices, like temperature sensors.

If you want to attach your test code, I'm happy to look over it.

from zstack.

MrEhbr avatar MrEhbr commented on June 19, 2024

Code was taken from example in README.

  1. Devices joined and Node object were looking normal
  2. z.ReadEvent() was always reading and there were regular NodeUpdateEvent events
  3. Devices were Xiaomi button and motion sensor
    I tried to look at frames that was send back after QueryNodeDescription but I don't found needed frames. But I don't sure that I was looking in right place.

If you don't have much time to deeply look at my problem it would be great if you show me from what place I can go to detect problem

from zstack.

pwood avatar pwood commented on June 19, 2024

Assuming the zstack is sending the ZdoNodeDescReq to the adapter (which given you've initialised, seen a join message, etc), I suspect your problem is actually the end devices. Sent at:

resp, err := z.nodeRequest(ctx, &request, &ZdoNodeDescReqReply{}, &ZdoNodeDescRsp{}, func(i interface{}) bool {

I have a pretty large array of the Xiaomi stuff (buttons, temp sensors, motion sensors), and they can all be a bit touchy about joining to networks. They quite aggressively sleep, so as soon as they've joined they sleep.

The "work around"/only way to make them queryable, is to do the pairing process, and as soon as they join, tap the reset button so the LED on the front of them flashes. This wakes them up, which allows the node that's routing for them to send the query packets.

See this page, basic pairing instructions, step 4:
https://community.hubitat.com/t/xiaomi-aqara-zigbee-device-drivers-possibly-may-no-longer-be-maintained/631

I swear that zigbee2mqtt used to have this in more detail on their pages, but it seems to have disappeared, so I don't know if there is some work around.

An example of shimmeringbee/zda - which uses shimmeringbee/zstack and shimmeringbee/zcl - but abstracts away zigbee... but it doesn't actually support temp/humidity yet.

https://imgur.com/a/kqycs0N <- Note the one long press to start pairing, and then continued clicking after the blue light has come on (couldn't actually see it because of the camera so guessed).
https://gist.github.com/pwood/70726f8a0f3bd5f61efc5dd7757c40fc <- output of zda enumeration

from zstack.

MrEhbr avatar MrEhbr commented on June 19, 2024

Thx for help, I managed to enumerate endpoints. For now I have failed to read product information: ZCL communicator waiting for reply, context expired error, and I also don't resave any messages from devices is it ok?
Code example: https://gist.github.com/MrEhbr/c77e606eb732c150a2ce48bcf95061a1

from zstack.

pwood avatar pwood commented on June 19, 2024

Ahh, moved to zda... you're enumerating every device every sixty seconds, so you would need keep pressing the reset button.

zda will automatically start an enumeration of a device when a new one joins, and enumerate the capabilities... a EnumerateDeviceSuccess would then be sent.

The idea of zda and da is to hide zigbee from a piece of controller software - hence standardised capabilities... as the da layer you wont be able to send custom ZCL messages, that's hidden.

da/zda is still in a state of flux, I need to drop the Device struct and move it to interfaces for behaviour. The API will be changing.

This is my own test driver for zda: https://gist.github.com/pwood/cd95044873a1f35ca0a76d9f185a6758 - looks somewhat similar.

The Xaiomi sensors just send ZCL messages to the controller (they dont even advertise the clusters on their endpoints) - which at the moment zda will be ignoring because I haven't got to supporting temp/humidity/pressure. The only capability I've completed is basic On/Off which I was using to prove all parts of the stack.

You've basically reached the end of what I've implemented so far. As I say - I've been taking a break from zigbee, mostly due to DIY work on the house that the wife needed doing ;) - but I'm going to come back to it soon. Probably this weekend.

from zstack.

MrEhbr avatar MrEhbr commented on June 19, 2024

One more time thx for your help. Now I'll know what to do next, first I'll try to add support for the devices I have

from zstack.

pwood avatar pwood commented on June 19, 2024

Good luck @MrEhbr, any follow up please feel free to raise a query in the zda project. I have just completed a semi large refactor in da and zda to do with da.Device now being an interface, rather than a struct. Also I see you are on the Discord, so feel free to grab me there too. Just @ me.

from zstack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.