Zigbee binding

zigbee
beginners
Tags: #<Tag:0x00007fe05783bdc0> #<Tag:0x00007fe05783bc80>

(Morten Vinding) #1867

Strange thing when looking for the binding in karaf:
openhab> bundle:list | grep -i zig
268 │ Active │ 80 │ 1.1.6 │ com.zsmartsystems.zigbee
269 │ Active │ 80 │ 1.1.6 │ com.zsmartsystems.zigbee.dongle.cc2531
270 │ Active │ 80 │ 1.1.6 │ com.zsmartsystems.zigbee.dongle.ember
271 │ Active │ 80 │ 1.1.6 │ com.zsmartsystems.zigbee.dongle.telegesis
272 │ Active │ 80 │ 1.1.6 │ com.zsmartsystems.zigbee.dongle.xbee
273 │ Active │ 80 │ 2.4.0 │ ZigBee Binding
274 │ Active │ 80 │ 2.4.0 │ ZigBee CC2531 Binding
275 │ Active │ 80 │ 2.4.0 │ ZigBee Ember Binding
276 │ Active │ 80 │ 2.4.0 │ ZigBee Telegesis Binding
277 │ Active │ 80 │ 2.4.0 │ ZigBee XBee Binding

Is that normal to both the 1.1.6 and the 2.4.0 binding?
If I remove the binding in PaperUI, both bindings disappear in karaf…


(Chris Jackson) #1868

Yes, but note that not all these bundles are part of the binding. The binding is version 2.4 - the other bundles are the main ZigBee libraries that the binding is using. This is quite normal in OSGi.


(Morten Vinding) #1869

Ok. Thanks.

Progress! Did get the first pairing working, using a 3 meter USB cable to keep the CC2531 dongle away from the RPi.
Not sure if that did the difference, but I’m soo glad I finally have a pairing working.
Next step would be to try to get the dimmer paired.

Thank you Chris, it is truly a magnificent job you are doing here!


(Morten Vinding) #1870

So I did get the dimmer paired now also.
Tip: What worked for me was: put the binding in discovery mode and reset the dimmer clicking the button 4 times. It was discovered right after that.

The dimmer shows up in OH as 3 channels:
Switch (not dimmer nor number)?
Battery voltage and
Battery alarm

But none of them seems to change…
In the logs I can read:
2019-01-14 01:29:48.354 [DEBUG] [tsystems.zigbee.ZigBeeNetworkManager] - RX CMD: MoveToLevelWithOnOffCommand [Level Control: 49609/1 -> 0/1, cluster=0008, TID=71, level=0, transitionTime=1]
and
2019-01-14 01:30:13.684 [DEBUG] [tsystems.zigbee.ZigBeeNetworkManager] - RX CMD: MoveToLevelWithOnOffCommand [Level Control: 49609/1 -> 0/1, cluster=0008, TID=72, level=255, transitionTime=1]

Turning down and up respectively.
I was not able to make it report anything in between 0 and 255, and it did not seem to have any influence on the channel status.

Chris: is the dimmer really supported yet?


(Chris Jackson) #1871

I’m not sure what is happening. You say that the dimmer isn’t showing up, but the command that you have provided in the log comes from the dimmer converter. :confused:


(Morten Vinding) #1872

No the dimmer is showing up as 3 channels.
It’s just that the channel is a switch, and it does not seem to change when I turn the dimmer.
But the log lines indicates that the binding is receiving something.


(Chris Jackson) #1873

What is the device? The binding works by detecting the clusters that devices report so it should provide a dimmer if the level control cluster is supported.
Can you post either a log from the startup or the network xml file in the userdata/ZigBee folder.


(Morten Vinding) #1874

Sure.
Don’t know what you mean by “log from the startup” but here is my network.xml file (it only contains the dimmer and a simple white bulb).
It is just the simple little dimmer with the acceleration sensor to detect turning.zigbee-network–zigbee_coordinator_cc2531_1d070427.xml (150.3 KB)


(Chris Jackson) #1875

Thanks. By log from startup I mean a log that shows the startup. Normally starting logging and restarting the binding or oh will achieve this.

Can you provide a link to the manual?

I’ll take a look at the xml later - thanks.


(Morten Vinding) #1876

https://www.ikea.com/ca/en/manuals/tradfri-dimming-kit__AA-1954744-1_pub.pdf

One more thing I noticed is this in the network xml:

    <powerDescriptor>
      <currentPowerMode>RECEIVER_ON_IDLE</currentPowerMode>
      <availablePowerSources>
        <PowerSourceType>MAINS</PowerSourceType>
      </availablePowerSources>
      <currentPowerSource>MAINS</currentPowerSource>
      <powerLevel>FULL</powerLevel>
    </powerDescriptor>

So it is reporting as a MAINS powered device, but it is in-fact powered by a CR2032 battery.


(Arno) #1877

I restarted OH one or two days ago. Today I lost 4 zigbee devices. They show their supposed states in the events log, but in real life nothing happens. No errors are logged.
I have posted a log to the following issue:


(Chris Jackson) #1878

I really need further information - sorry, but it’s hard to know what to make of your report as I don’t understand the german, and it doesn’t provide much information about your setup -:

  • What version of the library do you use?
  • What settings do you have?
  • What devices do you have?
  • Can you provide a sniffer log?

At the moment, all I can really say is the same thing I’ve said before - these sorts of issues are likely to be related to devices rejoining, but without concrete information, it’s really difficult for me to comment on - sorry.


(Jonathan Christison) #1879

Hi everyone,

Long time lurker, I’ve been using the Zigbee binding for about 6 months now and for the most part its been great, I suspect some of the issues I’ve encountered with tradfri builds not responding, always after multiple days uptime, could be related to the telegesis dongle I’ve been using, its now almost impossible to debug with 30 or so devices on the network, the log fills up very quickly and even with grep its hard to spot what I’m looking for.

My plan is to use the CC2531 which can be bought as little as £5 now + £12 for the smartRF04EB (you can use an Arduino for flashing at a pinch) vs the £60 i paid for the telegesis and hopefully help out with adding devices, once i get eclipse set up with remote debugging, this means i can now play with devices without not having to worry about not having lighting or heating when I inevitably screw up :grin:

My first two devices I’d like to try and help add/improve are the Tradfri motion sensor, which although can be added and appears to have all the right channels but never triggers on a motion event, the second device is the xiaomi lumi motion sensor(great deal at ~£10 each), this again is discovered correctly after a little bit of persuasion pressing the reset button on the motion sensor every second until the binding can do a full discovery, however it has the same issue as the tradfri motion sensor in that it never toggles the switch for motion, I can verify its functioning as the log is updated whenever i wave my hand in front of it -

    22:11:18.886 [DEBUG] [531.network.impl.CommandInterfaceImpl] - <-- AF_INCOMING_MSG (FE 1B 44 81 00 00 06 04 F5 49 01 01 00 61 00 2E 8A C2 00 00 07 18 26 0A 00 00 18 01 F5 49 1D EC)
    22:11:18.886 [DEBUG] [531.network.impl.CommandInterfaceImpl] - Received Async Cmd: Packet: subsystem=null, length=27, apiId=44 81, data=FE 1B 44 81 00 00 06 04 F5 49 01 01 00 61 00 2E 8A C2 00 00 07 18 26 0A 00 00 18 01 F5 49 1D EC, checksum=EC, error=false
    22:11:18.887 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - RX APS: ZigBeeApsFrame [sourceAddress=18933/1, destinationAddress=0/1, profile=0104, cluster=1030, addressMode=null, radius=0, apsSecurity=false, apsCounter=0, payload=18 26 0A 00 00 18 01]
    22:11:18.887 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - RX ZCL: ZclHeader [frameType=ENTIRE_PROFILE_COMMAND, manufacturerSpecific=false, direction=SERVER_TO_CLIENT, disableDefaultResponse=true, manufacturerCode=0, sequenceNumber=38, commandId=10]
    22:11:18.887 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - RX CMD: ReportAttributesCommand [Occupancy sensing: 18933/1 -> 0/1, cluster=0406, TID=26, reports=[Attribute Report: attributeDataType=BITMAP_8_BIT, attributeIdentifier=0, attributeValue=1]]
    22:11:18.888 [DEBUG] [m.zsmartsystems.zigbee.ZigBeeEndpoint] - 18933/1: Cluster 1030 not found for attribute response

The fact it at least triggers something each time is very promising, i presume the cluster hasn’t been defined in the binding yet.

Is there any tips for a noob who would like to contribute? I’m familiar with Java, know of karaf and OSGI concepts but i’ve never attempted to debug something as complex as a runtime loaded binding which ultimately uses a serial device, which i don’t think respond kindly to large delays introduced while debugging.

What i’ve done so far -

  • Set up eclipse with openhab packages
  • Set up openhab snapshot in a docker container with ttyACM0 pass through
  • Added devices (coordinator and both motion sensors)

What i’ll try next -

  • Build snapshot of the binding and reload binding/bundle in karaf within docker
  • Connect eclipse remote debugging <- I suspect this might be more complicated than i presume

(Chris Jackson) #1880

The cluster is just the temperature cluster - it’s supported. The error means that the binding doesn’t know that the device supports it which probably means there was an error during initialisation. I would suggest to try reinitialising it to see if it resolves the issue - if it doesn’t please provide a log showing the initialisation.

Not really I’m afraid. You just need to work through the binding source :slight_smile:


(Morten Vinding) #1881

Whee another Trådfri user :slight_smile:
Not sure if this is of any help, but just for the record, this is what I receive from the Trådfri dimmer:

Turning up:

2019-01-16 00:33:14.851 [DEBUG] [tsystems.zigbee.ZigBeeNetworkManager] - RX CMD: MoveCommand [Level Control: 49609/1 -> 0/1, cluster=0008, TID=3C, moveMode=1, rate=195]

Stopping:

2019-01-16 00:33:14.890 [DEBUG] [tsystems.zigbee.ZigBeeNetworkManager] - RX CMD: Stop2Command [Level Control: 49609/1 -> 0/1, cluster=0008, TID=3F]

Turning down to OFF:

2019-01-16 00:33:16.560 [DEBUG] [tsystems.zigbee.ZigBeeNetworkManager] - RX CMD: MoveToLevelWithOnOffCommand [Level Control: 49609/1 -> 0/1, cluster=0008, TID=46, level=0, transitionTime=1]

I did pair the dimmer with the bulb AFTER pairing with the zigbee binding (normal IKEA way), and now it seems to send both to the binding AND the bulb.
To confirm: I also receive updates on the binding if I cut power to the bulb.


(Jonathan Christison) #1882

Hi Chris,

First off, thanks for this binding and all the hard work it must of taken to get to this point!

I’ve tried to repair/re-add the ZED (Xiaomi Lumi motion sensor) to the PAN a few times always with the same result, It seems to successfully join but does not update the switch toggle, I’ve seen else where that Xiaomi have proprietary/off spec implementations so perhaps as you say its not actually providing the correct cluster id or otherwise wrong message type.

I’ve pushed the log to a gist here in this i first remove the ZED, reset the device then attempt to keep it powered on whilst pairing by hitting the reset button every 4-5 seconds.

The last few entries are the message received upon triggering the motion sensor by waving my hand in front of it, though one of them might of been my cat walking past :smile:

I’ve not managed to fire up the debugger yet, hopefully i’ll get a bit spare time at the weekend.

@MortenVinding
I tried pairing the tradfri remote some time back but it seemed to “steal” the bulb from the PAN, I’ll certainly look into this when i get the chance as I have about 6 remotes in various cupboards and bags around my home doing nothing :laughing:.

I’d assumed, due to reading elsewhere, that again IKEA where doing something in a “non-standard” way and other people had issues with the remote never actually speaking to the coordinator and only to the router (the bulb)


(Pedro Garcia) #1883

Hi @Jonny0stars, I am using these Xiaomi Occupancy sensors and they are working correctly to me.

As you say, they requiere keeping them alive during discovery, but once joined and discovered, these (at least the version I have) correctly report their clusters.

Occupancy is correctly reported and working in my case

Pedro


(Antonio Jose) #1884

Hi Chris,

First at all thanks for creating this binding ^^ .

I have recently bought this multisensor “https://www.globalsources.com/gsol/I/IR-detector/p/sm/1158868228.htm#1158868228”. I have tried to include it many times but I can never see the illuminance channel but if I look for the illuminance cluster in the Zigbee XML file it’s there:

Also tamper channel doesn’t work (it doesn’t change).

Here is the log file “https://mega.nz/#!zPpiFA7I!Z5_q6wac2M04rPBQOPdWaCYrXE-UJ8eomcGLrM1PirA” (I think you can see useful information from 12:53:05.291).

What can I do?

Thanks :slight_smile:


(Jonathan Christison) #1885

Hey Pedro,

I think you might have the Xiaomi Aqara? as opposed to my Lumi, I’m guessing this as my motion sensor does not provide Illuminance sensing, the Aqara also comes with a stand/arm and the lumi does not AFIK.

I’ll keep this in mind for future purchases as now both appear to be roughly the same price, how is its performance so far? I’ve noticed my other Xiaomi devices (temperature, pressure and humidity) sensors have dropped off the PAN a few times, this was never a problem until recently so i’m guessing its either the battery running low or issues with a now larger network, but other than that I’m impressed for the price!

Thanks


(Pedro Garcia) #1886

Hi @Jonny0stars,

Xiaomi ZigBee devices are a cheap option, but probably not the best choice for a stable network (unless you use the Xiaomi hub, which is not our case): they are “somehow” ZigBee compliant and can be made to work, but many times with issues.

As you say, my occupancy sensors are probably the aqara, not the lumi ones. I have two of these: one works more or less reliably, while the other gets disconnected from time to time… probably because it is very far from the hub and I have heard in the forums (maybe “gossip” anyway :slight_smile:) they do not behave well with routers.

If you want to give a try to the lumi occupancy sensor, from the log you sent it seems to have the same issue as the lumi temperature and humidity sensors: I see they are reporting occupancy attributes, but probably the occupancy cluster is not in the list of clusters the device claims to support, so the binding does not know what to do with the received reported occupancy.

If you can post the modelId from the device properties, I can show you how to add a XML file to the binding to “force” the cluster into the device, and if it works, and @chris thinks it is OK, I can submit a PR for this file to be included in the binding, as there is already one for the lumi HT sensor.