Closed julunde closed 2 years ago
Technically, yes. I don't think it's exposed correctly in deCONZ, though. Want to have that discussion first.
Ok awesome! I can validate that it has 2 endpoints on every switch (I have three).
[16/12/2021, 20:39:01] [Hue] Phoscon-GW: /sensors/2: warning: ignoring unknown ZHASwitch sensor {"config":{"battery":null,"group":null,"on":true,"reachable":true},"ep":2,"etag":"e7bd842818d00e7ee7515822b4c855f0","lastannounced":"2021-12-12T18:33:21Z","lastseen":"2021-12-16T20:37Z","manufacturername":"_TZ3000_i3rjdrwu","mode":1,"modelid":"TS0042","name":"Switch","state":{"buttonevent":2002,"lastupdated":"2021-12-16T20:38:22.124"},"type":"ZHASwitch","uniqueid":"8c:f6:81:ff:fe:91:0b:8b-02-0006"}
[16/12/2021, 20:39:01] [Hue] Phoscon-GW: /sensors/3: warning: ignoring unknown ZHASwitch sensor {"config":{"battery":null,"group":null,"on":true,"reachable":true},"ep":1,"etag":"ffdd7203ad7e059269efc794b0ac9790","lastannounced":"2021-12-12T18:33:21Z","lastseen":"2021-12-16T20:37Z","manufacturername":"_TZ3000_i3rjdrwu","mode":1,"modelid":"TS0042","name":"Switch","state":{"buttonevent":1004,"lastupdated":"2021-12-16T20:38:24.243"},"type":"ZHASwitch","uniqueid":"8c:f6:81:ff:fe:91:0b:8b-01-0006"}
[16/12/2021, 20:39:01] [Hue] Phoscon-GW: /sensors/4: warning: ignoring unknown ZHASwitch sensor {"config":{"battery":null,"group":null,"on":true,"reachable":true},"ep":1,"etag":"1bfd4b4f5640d78e988d53cf84773807","lastannounced":null,"lastseen":"2021-12-16T20:14Z","manufacturername":"_TZ3000_i3rjdrwu","mode":1,"modelid":"TS0042","name":"Switch (2)","state":{"buttonevent":1002,"lastupdated":"2021-12-16T20:11:40.488"},"type":"ZHASwitch","uniqueid":"8c:f6:81:ff:fe:91:0b:7e-01-0006"}
[16/12/2021, 20:39:01] [Hue] Phoscon-GW: /sensors/5: warning: ignoring unknown ZHASwitch sensor {"config":{"battery":null,"group":null,"on":true,"reachable":true},"ep":2,"etag":"7a73b8f209294b3804ad1dee739f35aa","lastannounced":null,"lastseen":"2021-12-16T20:14Z","manufacturername":"_TZ3000_i3rjdrwu","mode":1,"modelid":"TS0042","name":"Switch (2)","state":{"buttonevent":2002,"lastupdated":"2021-12-16T20:14:11.247"},"type":"ZHASwitch","uniqueid":"8c:f6:81:ff:fe:91:0b:7e-02-0006"}
[16/12/2021, 20:39:01] [Hue] Phoscon-GW: /sensors/6: warning: ignoring unknown ZHASwitch sensor {"config":{"battery":null,"group":null,"on":true,"reachable":true},"ep":1,"etag":"b68c9a2390851b1cd9f052397e983431","lastannounced":null,"lastseen":"2021-12-16T20:36Z","manufacturername":"_TZ3000_i3rjdrwu","mode":1,"modelid":"TS0042","name":"Switch (3)","state":{"buttonevent":1002,"lastupdated":"2021-12-16T20:36:42.077"},"type":"ZHASwitch","uniqueid":"8c:f6:81:ff:fe:91:0b:7b-01-0006"}
[16/12/2021, 20:39:01] [Hue] Phoscon-GW: /sensors/7: warning: ignoring unknown ZHASwitch sensor {"config":{"battery":null,"group":null,"on":true,"reachable":true},"ep":2,"etag":"0622b1b270260daaca34ca74881ced30","lastannounced":null,"lastseen":"2021-12-16T20:36Z","manufacturername":"_TZ3000_i3rjdrwu","mode":1,"modelid":"TS0042","name":"TS0042 7","state":{"buttonevent":2002,"lastupdated":"2021-12-16T20:36:49.988"},"type":"ZHASwitch","uniqueid":"8c:f6:81:ff:fe:91:0b:7b-02-0006"}
In v0.13.31.
Awesome. Just tested there, it works flawlessly. Thanks for the effort, it is greatly appreciated.
@ebaauw - Just for your info, I got 2 more switches and they didn't work as intended initially. It seems that DeConz/Phoscon creates an endpoint per switch only if you add-> delete-> re-add the switches without first deleting them in the device manager on the webapp. If you pair them first time, it will use a 01 endpoin for both buttons and differentiate buttons based on the event IDs (as expected).
They work now, but in order to get the Homebridge hue to recognize buttons I guess I had to incorrectly (for lack of a better word) discover the device.
Issue
Hi there,
Would it be possible to add support for a Tuya 2 button switch?
I've gotten it to work with Conbee2 but it is showing as an unsupported device in the home app. I made a similar request over on the Dresden Elektronik and this thread contains the information on the switch.
I'm primarily interested in single button press functionality so these are mapped to:
Single Press: Button 1 has the buttonevent value of 1002, Button 2 has the buttonevent value of 2002
But in the interest of completeness, the other button event values are as follows:
Double Press: Button 1 has the buttonevent value of 1004, Button 2 has the buttonevent value of 2004
Long Press: Button 1 has the buttonevent value of 1003, Button 2 has the buttonevent value of 2003
Thanks,
julunde
Log Messages
Hue Plugin Log
Phoscon API Event Log
Debug Files