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

Hue smart button doesn't pair with CC1352P-2 #2625

Closed
kitcorey opened this issue Dec 28, 2019 · 20 comments
Closed

Hue smart button doesn't pair with CC1352P-2 #2625

kitcorey opened this issue Dec 28, 2019 · 20 comments

Comments

@kitcorey
Copy link

Bug Report

What happened

I'm using the latest dev docker image with a CC1352P-2 adapter and I'm not able to add a hue smart button (9290022230) to the network. I was able pair it to a hue bridge and update to the latest firmware (2.30.0_r30777).

Pairing looks like it is successful in the logs, but pressing the button doesn't light the indicator LED or send any updates to mqtt.

What did you expect to happen

How to reproduce it (minimal and precise)

Debug Info

zigbee2mqtt version: zigbee2mqtt:latest-dev
CC1352P-2 firmware version: CC1352P_2_20191106.zip
Debug logs: https://pastebin.com/MYwDMTiW

@magnayn
Copy link

magnayn commented Jan 10, 2020

I don't think this is specific to the CC1352; I have a CC2531 and it exhibits the same behaviour (pairs, but button does nothing).

I think it's to do with something more complex being required. I wrote it up here:
https://zigbee2mqtt.discourse.group/t/philips-hue-smart-button-not-working/751

I'm a bit stumped as to what to do next..

@Koenkk
Copy link
Owner

Koenkk commented Jan 11, 2020

@magnayn the configure probably fails because the device is sleeping, try waking up the device by pressing it while the configure happens (on start of zigbee2mqtt or when doing it manually via https://www.zigbee2mqtt.io/information/mqtt_topics_and_message_structure.html#zigbee2mqttbridgeconfigure)

@magnayn
Copy link

magnayn commented Jan 11, 2020

I got a response in the log that config isn't required (I reset the device itself, it wa definitely awake with a flashing light):

zigbee2mqtt:debug 2020-01-11 15:37:35: Received MQTT message on 'zigbee2mqtt/bridge/configure' with data 'SmartButton'
winston:file written true false
winston:file logged 220841 debug 2020-01-11 15:37:35: Received MQTT message on 'zigbee2mqtt/bridge/configure' with data 'SmartButton'

zigbee2mqtt:warn  2020-01-11 15:37:35: Skipping configure of 'SmartButton', device does not require this.
winston:file written true false
winston:file logged 220935 warn  2020-01-11 15:37:35: Skipping configure of 'SmartButton', device does not require this.

My configuration.yaml lists it, so pairing seemed to work:

devices:
  '0x286d97000108a3d1':
    friendly_name: 'MotionSensor'
  '0x00178801060766a4':
    friendly_name: 'SmartButton'

@magnayn
Copy link

magnayn commented Jan 11, 2020

(The initial setup logs showed this, not sure if it is of any use)

zigbee-herdsman:controller:log Permit joining +1m
  zigbee-herdsman:adapter:zStack:znp:SREQ --> ZDO - mgmtPermitJoinReq - {"addrmode":15,"dstaddr":65532,"duration":254,"tcsignificance":0} +1m
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,5,37,54,15,252,255,254,0,228] +1m
  serialport/stream _write 10 bytes of data +1m
  serialport/binding-abstract write 10 bytes +1m
  serialport/bindings/unixWrite Starting write 10 bytes offset 0 bytesToWrite 10 +1m
  serialport/bindings/unixWrite write returned: wrote 10 bytes +1ms
  serialport/bindings/unixWrite Finished writing 10 bytes +0ms
  serialport/stream binding.write write finished +1ms
  serialport/bindings/poller received "readable" +1m
  serialport/binding-abstract read +12ms
  serialport/bindings/unixRead Starting read +1m
  serialport/bindings/unixRead Finished read 6 bytes +0ms
  serialport/stream binding.read finished { bytesRead: 6 } +11ms
  zigbee-herdsman:adapter:zStack:unpi:parser <-- [254,1,101,54,0,82] +1m
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [254,1,101,54,0,82] +0ms
  zigbee-herdsman:adapter:zStack:unpi:parser --> parsed 1 - 3 - 5 - 54 - [0] - 82 +0ms
  zigbee-herdsman:adapter:zStack:znp:SRSP <-- ZDO - mgmtPermitJoinReq - {"status":0} +1m
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [] +0ms
  serialport/stream _read reading { start: 16159, toRead: 49377 } +0ms
  serialport/binding-abstract read +0ms
  serialport/bindings/unixRead Starting read +0ms
  serialport/bindings/unixRead waiting for readable because of code: EAGAIN +1ms
  serialport/bindings/poller Polling for "readable" +1ms
  serialport/bindings/poller received "readable" +8ms
  serialport/binding-abstract read +9ms
  serialport/bindings/unixRead Starting read +8ms
  serialport/bindings/unixRead Finished read 8 bytes +0ms
  serialport/stream binding.read finished { bytesRead: 8 } +9ms
  zigbee-herdsman:adapter:zStack:unpi:parser <-- [254,3,69,182,0,0,0,240] +9ms
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [254,3,69,182,0,0,0,240] +0ms
  zigbee-herdsman:adapter:zStack:unpi:parser --> parsed 3 - 2 - 5 - 182 - [0,0,0] - 240 +0ms
  zigbee-herdsman:adapter:zStack:znp:AREQ <-- ZDO - mgmtPermitJoinRsp - {"srcaddr":0,"status":0} +1m
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [] +0ms
  serialport/stream _read reading { start: 16167, toRead: 49369 } +1ms
  serialport/binding-abstract read +1ms
  serialport/bindings/unixRead Starting read +1ms
  serialport/bindings/unixRead waiting for readable because of code: EAGAIN +0ms
  serialport/bindings/poller Polling for "readable" +1ms

@magnayn
Copy link

magnayn commented Jan 11, 2020

I'm somewhat confused by the zigbee 3.0 vs zigbee 1.2 stuff - maybe this is part of the issue?

I have a 1.2 firmware on my CC2531 (I tried the 3.0.x firmware and it did not seem to be able to pair with anything at all).

@Koenkk
Copy link
Owner

Koenkk commented Jan 13, 2020

This is probably not part of the issue, I think the device requires the additional configure which you mentioned in https://zigbee2mqtt.discourse.group/t/philips-hue-smart-button-not-working/751.

After adding this to devices.js you should be able to configure it, but make sure while configuring it the device is awake (by pressing e.g. a button on it).

@magnayn
Copy link

magnayn commented Jan 20, 2020

Ah, I think pairing works (the title of this ticket is probably not quite right), it's just unresponsive after that (same as OP: "Pairing looks like it is successful in the logs, but pressing the button doesn't light the indicator LED or send any updates to mqtt.").

It feels like yes, it needs some sort of configuration. I can do the software coding bit, but I'm drawing a blank as to what that device needs in order to work correctly...

@magnayn
Copy link

magnayn commented Jan 25, 2020

So, digging and trying to learn as I go. The database shows this:

 "endpoints": {
    "1": {
      "profId": 260,
      "epId": 1,
      "devId": 2096,
      "inClusterList": [
        0,
        1,
        3,
        64512,
        4096
      ],
      "outClusterList": [
        25,
        0,
        3,
        4,
        6,
        8,
        5,
        4096
      ],
      "clusters": {
        "genBasic": {
          "attributes": {
            "modelId": "ROM001",
            "manufacturerName": "Philips",
            "powerSource": 3,
            "zclVersion": 2,
            "appVersion": 2,
            "stackVersion": 1,
            "hwVersion": 1,
            "dateCode": "20190619",
            "swBuildId": "2.21.0_r29784"
          }
        }
      },
      "binds": []
    }
  },

I have tried to make it configure by adjusting the devices.js thus:

  {
        zigbeeModel: ['ROM001'],
        model: '9290022230',
        vendor: 'Philips',
        description: 'Hue smart button',
        supports: 'action',
        fromZigbee: [fz.command_on, fz.command_off_with_effect, fz.SmartButton_skip, fz.battery_percentage_remaining],
        toZigbee: [],
         meta: {configureKey: 1},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint1 = device.getEndpoint(1);
            await bind(endpoint1, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);

        },

But nothing seems to happen. I hard-reset the button (hold down reset for 10 secs) - it announces itself (enough to pair) but then nothing futher.

Any hints?

@Koenkk
Copy link
Owner

Koenkk commented Jan 26, 2020

Is this the device: https://www2.meethue.com/en-us/p/hue-smart-button/046677553715?

We need to figure out how to configure it, do you have the original hue bridge to sniff traffic? (https://www.zigbee2mqtt.io/how_tos/how_to_sniff_zigbee_traffic.html)

@magnayn
Copy link

magnayn commented Jan 30, 2020 via email

@Koenkk
Copy link
Owner

Koenkk commented Jan 30, 2020

Can you try with

{
    zigbeeModel: ['ROM001'],
    model: '9290022230',
    vendor: 'Philips',
    description: 'Hue smart button',
    supports: 'action',
    fromZigbee: [fz.command_on, fz.command_off_with_effect, fz.SmartButton_skip, fz.battery_percentage_remaining],
    toZigbee: [],
    meta: {configureKey: 4},
    configure: async (device, coordinatorEndpoint) => {
        const endpoint1 = device.getEndpoint(1);
        await bind(endpoint1, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);

        const options = {manufacturerCode: 0x100B, disableDefaultResponse: true};
        await endpoint1.write('genBasic', {0x0031: {value: 0x000B, type: 0x19}}, options);
        await bind(endpoint1, coordinatorEndpoint, ['manuSpecificPhilips', 'genPowerCfg']);
        await configureReporting.batteryPercentageRemaining(endpoint1);
    },
},

@magnayn
Copy link

magnayn commented Jan 31, 2020 via email

@Koenkk
Copy link
Owner

Koenkk commented Jan 31, 2020

Please try with the latest dev branch, I've improved the error logging there to get a better understanding where things go wrong.

@magnayn
Copy link

magnayn commented Feb 1, 2020 via email

@magnayn
Copy link

magnayn commented Feb 1, 2020

debug.log

@Koenkk
Copy link
Owner

Koenkk commented Feb 1, 2020

Are you sure you are using my updated code from #2625 (comment) (it uses endpoint 1 instead of 2 now. I'm asking because it fails at await endpoint1.write (because endpoint1 = null), but this is impossible as it is already used before.

@magnayn
Copy link

magnayn commented Feb 1, 2020

Ah, sorry - I hadn't noticed that the patch had changed.

I'm happy to report though that it seems to work! 🎆

Thankyou for this, the hue button is a really neat little controller which will signficantly improve my home WAF :)

@Koenkk
Copy link
Owner

Koenkk commented Feb 1, 2020

@magnayn
Copy link

magnayn commented Feb 1, 2020 via email

Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue Feb 1, 2020
@Koenkk
Copy link
Owner

Koenkk commented Feb 1, 2020

Awesome, I will add it to the dev branch 😄

@Koenkk Koenkk closed this as completed Feb 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants