dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.89k stars 496 forks source link

Xfinity Keypad XHK1-UE #4560

Closed a1ad closed 3 years ago

a1ad commented 3 years ago

Device

afbeelding

Screenshots

Required screenshots:

Power Configuration

afbeelding

Identify

afbeelding

Poll Control

afbeelding

Temperature measurement

afbeelding

ISA Zone

afbeelding

Diagnostics

afbeelding

OTAU

afbeelding

IAS ACE

afbeelding afbeelding afbeelding

Here is a Reddit post from someone that successfully added the keypad to zigbee2mqtt and with some more info.

Greets,

Mimiix commented 3 years ago

@Smanar Would you like this one?

Smanar commented 3 years ago

Hu will need to create more field.

I have searched some information about this device, I think we need to create/use as field

But do we need state/alarm ? IDK it s a good idea to use this device as ZHAalarm, as he don't need to trigger alarm but more send armed/disarmed infoirmation.

And there is some comment about temperature and sensor ?

a1ad commented 3 years ago

If it can send the 4 digit code to home assist that would be a great start. Let me know if i can help with something. I think its a great little device and really nice to have.

Smanar commented 3 years ago

I think it s possible from that I m reading about it. Do you have a linux machine to test code modification ?

a1ad commented 3 years ago

Ofc, i have a fedora workstation or plenty of lxc servers on my proxmox host. The conbee is connected to the PI3B

Smanar commented 3 years ago

Ok so first try

You have the procedure here https://github.com/dresden-elektronik/deconz-rest-plugin#install-deconz-development-package-optional-linux-only So for you

sudo apt install deconz-dev
git clone --branch keypad https://github.com/Smanar/deconz-rest-plugin.git
cd deconz-rest-plugin
qmake && make
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

This code will do nothing, just create the entry in the API. If you can show me the entry created to check how decone reconize the device ? I can explain how to use the API if you need ?

a1ad commented 3 years ago

Just on the pi or do i need a new Linux machine? I don't want to lose my ZB network of course.

Smanar commented 3 years ago

As you want, just need a linux OS (not docker), raspbian or other. But yes if you have your production network on the proxmox, better to use the pi, on a new network, you can just switch the conbee 10mn, time of tests, and switch it again after.

Devices configuration are stored on the host, network configuration on the conbee.

a1ad commented 3 years ago

Ok so first try

You have the procedure here https://github.com/dresden-elektronik/deconz-rest-plugin#install-deconz-development-package-optional-linux-only So for you

sudo apt install deconz-dev
git clone --branch keypad https://github.com/Smanar/deconz-rest-plugin.git
cd deconz-rest-plugin
qmake && make
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

This code will do nothing, just create the entry in the API. If you can show me the entry created to check how decone reconize the device ? I can explain how to use the API if you need ?

Yeah, i need more info about the API, compilation is ok

Smanar commented 3 years ago

for API long story > https://dresden-elektronik.github.io/deconz-rest-doc/getting_started/ short story > http://IP:PORT/api/KEY/sensors

IP and PORT are the same than for phoscon KEY is an API key, if you haven't one

curl http://127.0.0.1:80/api/ -X POST -d '{"devicetype": "TestKey"}'

a1ad commented 3 years ago

There is no info in /sensors other than: { "1": { "config": { "configured": true, "on": true, "sunriseoffset": 30, "sunsetoffset": -30 }, "etag": "f306ae97bf6113b349f25bbb8354d014", "manufacturername": "Philips", "modelid": "PHDL00", "name": "Daylight", "state": { "dark": true, "daylight": false, "lastupdated": "2021-03-12T22:26:43.353", "status": 230, "sunrise": "2021-03-12T06:02:55", "sunset": "2021-03-12T17:41:17" }, "swversion": "1.0", "type": "Daylight", "uniqueid": "00:21:2e:ff:ff:04:09:f0-01" } }

the device is showing in deconz like you can see in the screenshots, but no entry in the phoscon app.

The port was 8080 and not 80 here

edit: I am using the beta in production (due to sonof mini ZB) and the current stable on the test server. edit2: did i do something wrong?

Smanar commented 3 years ago

The port was 8080 and not 80 here

If you are right, will be the same than you are using for phoscon.

edit: I am using the beta in production (due to sonof mini ZB) and the current stable on the test server.

The code is based on the last code on official, so will be the beta too. But you are using another machine for test ?

Can you share the logs during inclusion ? On deconz/help/log with "info" and "info_l2" ?

a1ad commented 3 years ago

The port was 8080 and not 80 here

If you are right, will be the same than you are using for phoscon.

edit: I am using the beta in production (due to sonof mini ZB) and the current stable on the test server.

The code is based on the last code on official, so will be the beta too. But you are using another machine for test ?

Can you share the logs during inclusion ? On deconz/help/log with "info" and "info_l2" ?

Yes i use another VM, just to be safe.., i didnt need to include the device, when i switched the conbee to the new VM the devices where all there.

Smanar commented 3 years ago

i didnt need to include the device, when i switched the conbee to the new VM the devices where all there.

You need, your device are still in the zigbee network (because it will be the same network, same mac adress, same network key, ect ....) but the device are not in the API. Devices are stored on the host, not the USB key.

a1ad commented 3 years ago
  "2": {
    "config": {
      "battery": null,
      "offset": 0,
      "on": true,
      "reachable": true
    },
    "ep": 1,
    "etag": "71a295870418824acd1faea34c51b15a",
    "lastseen": "2021-03-13T15:32Z",
    "manufacturername": "Universal Electronics Inc",
    "modelid": "URC4450BC0-X-R",
    "name": "Temperature 2",
    "state": {
      "lastupdated": "none",
      "temperature": null
    },
    "type": "ZHATemperature",
    "uniqueid": "00:0d:6f:00:13:4f:61:39-01-0402"
  }
Smanar commented 3 years ago

Ok, nice, and no ZHAAlarm one ? will continu the code.

a1ad commented 3 years ago

Nope afbeelding

Thanks!

Smanar commented 3 years ago

Ok do have updated the code

cd deconz-rest-plugin
git pull
qmake && make
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

Now you will have a new sensor a ZHAswitch with a field "armed"

But I have lot of question :

Can you try the new code, use the device to arm/disarm for exemple and show logs during the command pls ?

a1ad commented 3 years ago

@Smanar how to obtain logs?

Smanar commented 3 years ago

on deconz / help / log with "info" and "info_l2"

a1ad commented 3 years ago

Do i need to reinclude the device?

Smanar commented 3 years ago

Yep, pls, if I m right the code will create a new device now, a zhaSwitch.

a1ad commented 3 years ago

I don't think its working, i only see the temp sensor.

Smanar commented 3 years ago

I have checked the code again, nothing special, can you share the log during the inclusion ?

a1ad commented 3 years ago

I cant include the device anymore... tried a bunch of stuff already Temp sensor is showing up, but the device does not confirm that its joined to a network oh no, temp is blinking red, so i cant join

a1ad commented 3 years ago

hmm the temp sensor is paired again, but no new sensor found. No logs, i was too late to enable the logs. I can only pair the sensor when i select search lights? Does it matter? edit: is there a real log file with history?

Smanar commented 3 years ago

I don't think there is a difference beetween sensor or light. As the device is already included n phoscon you can trigger inclusion easily

This trick will trigger an inclusion.

Enable log before setting in permit join, on the dev machine you have few devices, will be not a problem.

a1ad commented 3 years ago

i cant find a setting in phoscon to permit join?? In deconz there is one. So i set permit join for 255 and read the basic attr successful, but no new sensor.

the logs are full with this stuff: 20:04:08:295 enqueue event config/localtime for /config/ 20:04:08:295 poll node 80:4b:50:ff:fe:b5:65:d8-01 20:04:08:295 Poll light node On/Off light 2 20:04:08:295 Idle timer triggered 20:04:08:296 binding for attribute reporting of ep: 0x01 cluster 0x0001 seems to be active 20:04:08:296 binding for attribute reporting of ep: 0x01 cluster 0x0402 seems to be active

i can give you access to the dev machine (ssh + x2go), if you give me your pubkey

Smanar commented 3 years ago
i cant find a setting in phoscon to permit join?? In deconz there is one.
So i set permit join for 255 and read the basic attr successful, but no new sensor.

In phoscon it s "add new sensor/light" If you make the permit join using directly deconz, it will not use the API, the device can't be included.

But fortunately, I have this ind of problem on an other device too, will add some debug line to your branch.

Smanar commented 3 years ago

@a1ad have pull a special version with some more debug line, if you can try it ?

a1ad commented 3 years ago
"2": {
    "config": {
      "battery": null,
      "offset": 0,
      "on": true,
      "reachable": true
    },
    "ep": 1,
    "etag": "67c497dc2c5c49ff01d58308c20bd4e2",
    "lastseen": "2021-03-14T10:52Z",
    "manufacturername": "Universal Electronics Inc",
    "modelid": "URC4450BC0-X-R",
    "name": "Temperature 2",
    "state": {
      "lastupdated": "2021-03-13T17:57:21.281",
      "temperature": 2700
    },
    "type": "ZHATemperature",
    "uniqueid": "00:0d:6f:00:13:4f:61:39-01-0402"
  },
  "3": {
    "config": {
      "armed": null,
      "battery": null,
      "on": true,
      "reachable": true
    },
    "ep": 1,
    "etag": "3e478d66fbff54ed19e14ba095ab79b5",
    "lastseen": "2021-03-14T10:52Z",
    "manufacturername": "Universal Electronics Inc",
    "mode": 1,
    "modelid": "URC4450BC0-X-R",
    "name": "Switch 3",
    "state": {
      "buttonevent": null,
      "lastupdated": "none"
    },
    "type": "ZHASwitch",
    "uniqueid": "00:0d:6f:00:13:4f:61:39-01-0501"
  }

Now we got the switch, again forget the logs ... i am so used to have a log file ...

edit: when i press some keys: 11:55:17:080 Debug Keypad : Address 0x000D6F00134F6139 Payload , command 0x07 11:55:17:080 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: 0x07, payload: None, zclSeq: 80

Edit2: isnt there some sort of filter on the log? There are a lot of unrelated lines

Smanar commented 3 years ago

So no need more log ^^

Information are fine, here you have the command list

#define CMD_ARM 0x00
#define CMD_BYPASS 0x01
#define CMD_EMERGENCY 0x02
#define CMD_FIRE 0x03
#define CMD_PANIC 0x04
#define CMD_GET_ZONE_ID_MAP 0x05
#define CMD_GET_ZONE_INFORMATION 0x06
#define CMD_GET_PANEL_STATUS 0x07
#define CMD_GET_BYPASSED_ZONE_LIST 0x08
#define CMD_GET_ZONE_STATUS 0x09

the one you have was CMD_GET_PANEL_STATUS , I think you will have different according the command you make on the device. Can you share me the log when making a complete code ? From that I have read the device send the code, and it s you that send the arm or disarm order to the device after checking. I think the code will be in a payload.

a1ad commented 3 years ago

Yes correct. Its just pretty hard to obtain the logs because there is just so much excessive "noise" in there. I am going to try tho.

Can't you disable the logging for the other devices in this build?

Smanar commented 3 years ago

It s possible but not managed by deconz, it s for that I m making special log starting by "Debug Keypad" to find them with search feature.

a1ad commented 3 years ago

This is the only debug keypad found in the log: Pressed a lot of digits

15:54:21:621 Debug Keypad : Address 0x000D6F00134F6139 Payload , command 0x07 15:54:21:621 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: 0x07, payload: None, zclSeq: 113

full log: cryptobin.co/r242a1d4 pass: deconz

Smanar commented 3 years ago

Ok so in fact it's normal, there is no payload for this command

8.3.2.4.6 Get Panel Status Command This command is used by ACE clients to request an update to the status (e.g., security system arm state) of the ACE server (i.e., the IAS CIE). In particular, this command is useful for battery-powered ACE clients with polling rates longer than the ZigBee standard check-in rate. 8.3.2.4.6.1 Payload Format There is no payload for the Get Panel Status command. 8.3.2.4.6.2 Ef fect on Receipt On receipt of this command, the ACE server responds with the status of the security system. The IAS ACE server SHALL generate a Get Panel Status Response command.

a1ad commented 3 years ago

Yeah, but no log entry when pushing the buttons?

Smanar commented 3 years ago

Yep , the keyboard is waiting for a command from deconz. I have just making it, from reading documentation, so it s totaly experimental ^^.

I think just after that we will have more data.

Smanar commented 3 years ago

No more return in log with last version ?

a1ad commented 3 years ago

No more return in log with last version ?

Ow, did you make a new version. I didn't got that. Let me check later today.

a1ad commented 3 years ago

Relevant log files:

22:09:00:952 Debug Keypad : Address 0x000D6F00134F6139 Payload , command 0x07 22:09:00:953 Debug Keypad : Sending answer 22:09:00:953 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: 0x07, payload: None, zclSeq: 114

22:09:15:966 Debug Keypad : Address 0x000D6F00134F6139 Payload , command 0x07 22:09:15:966 Debug Keypad : Sending answer 22:09:15:967 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: 0x07, payload: None, zclSeq: 120

22:08:42:144 Debug Keypad : Address 0x000D6F00134F6139 Payload , command 0x07 22:08:42:145 Debug Keypad : Sending answer 22:08:42:145 enqueue event config/reachable for /sensors/2 22:08:42:146 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: 0x07, payload: None, zclSeq: 110

Smanar commented 3 years ago

Nothing more ?

Can you log but this APS ? we will have zigbee echanges like that.

22:09:15:966 Debug Keypad : Sending answer

when you see that I m sending an answer to the device, I was hoping for an answer ....

I have find a sniff from another device https://github.com/Koenkk/zigbee2mqtt/issues/6242#issuecomment-778577448

Can you try too with the new code ? I have disabled the ZclFCDisableDefaultResponse (was false on the link)

a1ad commented 3 years ago

Nope: only this msg when the proximity senor is activated: 22:41:40:626 Debug Keypad : Address 0x000D6F00134F6139 Payload , command 0x07 22:41:40:627 Debug Keypad : Sending answer 22:41:40:628 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: 0x07, payload: None, zclSeq: 77

edit: APS logs: 22:43:27:439 APS-DATA.indication request id: 161 -> finished 22:43:27:440 APS-DATA.request id: 161 erase from queue 22:43:30:313 APS-DATA.request id: 180, addrmode: 0x03, addr: 0x804b50fffeb565d8, profile: 0x0000, cluster: 0x0031, ep: 0x00 -> 0x00 queue: 0 len: 2 tx.options 0x00 22:43:30:346 APS-DATA.confirm id: 180, status: 0x00 SUCCESS 22:43:30:347 APS-DATA.confirm request id: 180 -> confirmed, timeout 1615931010 22:43:30:392 APS-DATA.indication srcAddr: 0xfbf3, srcEp: 0x00 dstAddrMode: 2, profile: 0x0000, cluster: 0x8031, lqi: 255, rssi: -50 22:43:30:393 APS-DATA.indication request id: 180 -> finished

Smanar commented 3 years ago

But you are just pressing random button or making command like Arm/disarm/emergency ? From that I m reading if you make the good conbinaison you need to have more command than the 0x07

Perhaps it s because the device is not enrolled, but from zigbee2mqtt it seem it s not needed, here you have the procedure to check and make one https://github.com/dresden-elektronik/deconz-rest-plugin/issues/3970#issuecomment-761892533

a1ad commented 3 years ago

More news: you are right with the enrollmend!

When i press the 3 buttons on top, nothing happens. the same log: 21:26:21:926 Debug Keypad : Address 0x000D6F00134F6139 Payload , command 0x07 21:26:21:926 Debug Keypad : Sending answer 21:26:21:926 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: 0x07, payload: None, zclSeq: 60

But after i press 4 random digits we get a new entry in the log: 21:27:02:621 Debug Keypad : Address 0x000D6F00134F6139 Payload 02043131313100, command 0x00 21:27:02:622 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: ARM (0x00), payload: 02043131313100, zclSeq: 62

Progress? I guess the payload is the 4 digit code?

some more detail: When i press the first digit i get: 21:38:36:479 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: 0x07, payload: None, zclSeq: 115

After digit 4, i get: 21:38:38:207 Debug Keypad : Address 0x000D6F00134F6139 Payload 00043838383800, command 0x00 21:38:38:208 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: ARM (0x00), payload: 00043838383800, zclSeq: 116

When i press immediately an other digit i get: 21:38:41:545 Debug Keypad : Address 0x000D6F00134F6139 Payload 00043838383800, command 0x00 21:38:41:545 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: ARM (0x00), payload: 00043838383800, zclSeq: 117

and another: 21:38:42:387 Debug Keypad : Address 0x000D6F00134F6139 Payload 00043838383800, command 0x00 21:38:42:387 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: ARM (0x00), payload: 00043838383800, zclSeq: 118

and so on.

Smanar commented 3 years ago

Yeah ^^, I will continu tommorow but yes, I think some data are the digit.

There is a notification when you press a number, but the final notification is only when the code is finished.

But BTW you need the enrollement ? It don't work without it ?

a1ad commented 3 years ago

Yeah ^^, I will continu tommorow but yes, I think some data are the digit.

There is a notification when you press a number, but the final notification is only when the code is finished.

But BTW you need the enrollement ? It don't work without it ?

It started to work after the enrollment. Can i reset the enrollment to try again?

Smanar commented 3 years ago

It started to work after the enrollment. Can i reset the enrollment to try again?

Sure but not the priority.

Have updated the code to display more detail, and I hope the code, but I have something strange

payload: 00 04 38 38 38 38 00

00 is the ARM the last 00 is the zone ID so it make for code 04 38 38 38 38, 38 can be the ascii value for "8", but what can be 04 ?

a1ad commented 3 years ago

Yes! Nice work:

22:21:39:874 Debug Keypad : Address 0x000D6F00134F6139 Payload 00043131313100, command 0x00 22:21:39:874 Debug Keypad : Arm command, size 7 22:21:39:874 Debug Keypad : Arm command, Arm mode 0, code 1111, Zone id0 22:21:39:875 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: ARM (0x00), payload: 00043131313100, zclSeq: 14

22:22:21:380 Debug Keypad : Address 0x000D6F00134F6139 Payload 01043535353500, command 0x00 22:22:21:380 Debug Keypad : Arm command, size 7 22:22:21:380 Debug Keypad : Arm command, Arm mode 1, code 5555, Zone id0 22:22:21:381 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: ARM (0x00), payload: 01043535353500, zclSeq: 18

04 can be the zone status? afbeelding

Ow yeah, now the device beeps after the 4 digit code

Edit: The device has a tamper protection button, when the case is closed you get this: 17:40:27:288 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ZONE (0x0500), command: STATUS_CHANGE (0x00), payload: 000000000000, zclSeq: 40

When you open the case or just take it of the wall or something, you get this: 17:40:45:111 [INFO] - No button map for: URC4450BC0-X-R, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ZONE (0x0500), command: STATUS_CHANGE (0x00), payload: 040000000000, zclSeq: 41

I would like to get the tamper alarm so i can send a notification to my mobile :-)

Smanar commented 3 years ago

On my side I think 04 is the code len, but this part can be device dependent.

I m making a roolback on the code to create ZHAalarm entry, like that you will have the enrollement + the tamper field.

Can you try the new code, and show me the entries created, the JSON.