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

Sonoff SNZB-01 #2990

Closed madman2143 closed 3 years ago

madman2143 commented 4 years ago

Device

image image

jdonofrio728 commented 3 years ago

I'm using the ConBee 2. I copied the button maps file from Smanar's branch to the ~/.local/share/dresden-elektronik/deCONZ/button_maps.json. I guess I'm not sure if that is the right place, but its the same directory as the zll.db file.

NovaGL commented 3 years ago

I mean what device is the combee connected too? A raspberry Pi?

jdonofrio728 commented 3 years ago

Oh sorry. Deconz is installed on an LXD container running ubuntu 18.04. The ConBee USB stick is passed through to the container just like you would for docker.

SwoopX commented 3 years ago

Try creating a folder called devices where your zll.db resides and copy the json file there.

jdonofrio728 commented 3 years ago

@SwoopX Yeah that made a difference. However the double press and the long press might be mixed up.

# Short
[INFO] - Button 1002 short
# Double
[INFO] - Button 1003 Long
# Long
Button 1004 double

if I edit the button_maps.json to switch the two like this then the log output is as expected:

"sonoffOnOffMap": [
                        [1, "0x01", "ONOFF", "ON", "0", "S_BUTTON_1", "S_BUTTON_ACTION_LONG_RELEASED", "double"],
                        [1, "0x01", "ONOFF", "OFF", "0", "S_BUTTON_1", "S_BUTTON_ACTION_DOUBLE_PRESS", "Long"],
                        [1, "0x01", "ONOFF", "TOGGLE", "0", "S_BUTTON_1", "S_BUTTON_ACTION_SHORT_RELEASED", "short"]
                ]
Smanar commented 3 years ago

Thx, corrected on my side.

SwoopX commented 3 years ago

So, now with some more freedom and keyboard in front of me ;)

Manu changed the file path and obviously forgot to mention it. I found this out just yesterday myself. The path must be

~/.local/share/dresden-elektronik/deCONZ/devices/button_maps.json

@jdonofrio728 Glad it worked out, so the new approach already paid off.

jdonofrio728 commented 3 years ago

I will say that even though the log messages look better, something still doesn't seem right. Home assistant (out of scope here) doesn't see this switch as a "switch", rather only detects the battery level. Deconz also only shows the same.

I expected the cluster object for On/Off or something else to be available. Perhaps I'm just misunderstanding something?

SwoopX commented 3 years ago

You got your ZHASwitch resource, don't you?

jdonofrio728 commented 3 years ago

The only entity that home assistant found was the battery:

image

jdonofrio728 commented 3 years ago

I'm sorry, I re-read the deconz integration documentation and found out that this is working correctly. Button pushes only fire events which I am fully able to capture. Everything seems to be working as expected. Sorry about that!

NovaGL commented 3 years ago

Seems to be working now with the new button map which is good.

SAOPP commented 3 years ago

Glad to hear this.

Jimmy-SafeCash commented 3 years ago

What's the current status of this regarding v2.05.84 and latest FW?

Do we still require the above workaround? For me, the switch does not work at all via the normal method. It is seen by phoscon but never registers and event in developer listening tab.

SAOPP commented 3 years ago

Not working with 84 too.

SAOPP commented 3 years ago

Only like as before, 1002 double, and long 1003 events.

Jimmy-SafeCash commented 3 years ago

Only like as before, 1002 double, and long 1003 events.

I cannot see any events in HA when listening to deconz_events :/

SAOPP commented 3 years ago

Try to reconnect the device, because initially there was no only a the single click event, double and long clicks should work.

Jimmy-SafeCash commented 3 years ago

Try to reconnect the device, because initially there was no only a the single click event, double and long clicks should work.

I've removed and added 3 times with no difference. Not sure what I'm doing wrong.

SAOPP commented 3 years ago

Strange, what the stick u have?

Jimmy-SafeCash commented 3 years ago

Strange, what the stick u have?

Conbee II, RPi 4, Docker

SAOPP commented 3 years ago

@SwoopX @Smanar guys, could u please clarify this situation with this device? Thanks in advance!

Mimiix commented 3 years ago

@SAOPP @Jimmy-SafeCash As far as i can see, it is added properly. Tagging Swoop won't help, he didn't integrate it.

adamkanovak commented 3 years ago

I have checked with the latest HA deconz addon with version 2.05.84. Short button press is still not recognized.

NovaGL commented 3 years ago

Using the button map file works maybe update your button map and try again

SwoopX commented 3 years ago

The change will come with .85 Why does nobody read the release notes, it's not mentioned there.

SAOPP commented 3 years ago

Thanks buddy, I didn't read and know it. I thought these fixes should have been at 83 or 84... okay. So wait for 15th October. :)

Jimmy-SafeCash commented 3 years ago

Thanks buddy, I didn't read and know it. I thought these fixes should have been at 83 or 84... okay. So wait for 15th October. :)

Have now updated to 85 and re-added the switch. Still not working for me. Listening to deconz_events shows nothing for any of my sensors (but they still work). Any ideas why the switch doesn't? It used to work on double press and long press (not single), but now nothing at all. It also used to show in events.

I can confirm that all other sonoff sensors work fine.

SwoopX commented 3 years ago

I do not see any apparent reason why it shouldn't work. Can you share some deconz logs which include the button presses?

Jimmy-SafeCash commented 3 years ago

I do not see any apparent reason why it shouldn't work. Can you share some deconz logs which include the button presses?

Thanks @SwoopX for the prompt reply. Here are my logs:

23:50:01:032 GW firmware version: 0x26660700 23:50:01:032 GW firmware version is up to date: 0x26660700 23:50:08:837 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0406 command: 0x0A payload[0]: 000 23:50:08:837 ZCL attribute report 0x0017880106F4F8F9 for cluster: 0x0406, ep: 0x02, frame control: 0x08, mfcode: 0x0000 23:50:25:112 New websocket 192.168.2.40:51170 (state: 3) 23:50:54:971 Current channel 15 23:50:54:979 Device TTL 836 s flags: 0x7 23:51:26:761 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0406 command: 0x0A payload[0]: 000 23:51:26:761 ZCL attribute report 0x0017880106F4E208 for cluster: 0x0406, ep: 0x02, frame control: 0x08, mfcode: 0x0000 23:51:26:845 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0400 command: 0x0A payload[0]: 000 23:51:26:845 ZCL attribute report 0x0017880106F4E208 for cluster: 0x0400, ep: 0x02, frame control: 0x08, mfcode: 0x0000 23:51:30:306 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0402 command: 0x0A payload[0]: 000 23:51:30:306 ZCL attribute report 0x0017880106F4F8F9 for cluster: 0x0402, ep: 0x02, frame control: 0x08, mfcode: 0x0000 23:51:54:967 Current channel 15 23:51:54:975 Device TTL 776 s flags: 0x7 23:52:36:484 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0402 command: 0x0A payload[0]: 000 23:52:36:484 ZCL attribute report 0x0017880106F4E208 for cluster: 0x0402, ep: 0x02, frame control: 0x08, mfcode: 0x0000 23:52:39:063 [INFO] - No button handler for: RWL021 endpoint: 0x02 cluster: 0x0001 command: 0x0A payload[0]: 021 23:52:39:064 ZCL attribute report 0x0017880104F32359 for cluster: 0x0001, ep: 0x02, frame control: 0x08, mfcode: 0x0000 23:52:54:959 Current channel 15 23:52:54:967 Device TTL 716 s flags: 0x7 23:53:12:460 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0406 command: 0x0A payload[0]: 000 23:53:12:460 ZCL attribute report 0x0017880106F4D4F9 for cluster: 0x0406, ep: 0x02, frame control: 0x08, mfcode: 0x0000 23:53:12:555 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0400 command: 0x0A payload[0]: 000 23:53:12:555 ZCL attribute report 0x0017880106F4D4F9 for cluster: 0x0400, ep: 0x02, frame control: 0x08, mfcode: 0x0000

The device is added via phoscon and shows as it always has. I have added the button_maps.json in the /devices folder

Jimmy-SafeCash commented 3 years ago

Update: The switch is connected to the network. When I press the button the VNC map shows the switch blinking blue and green.

deconz_events in HA shows nothing and never has (no matter which sensor I activate).

Latest logs when spamming button presses:

22:29:32:390 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0402 command: 0x0A payload[0]: 000 22:29:32:390 ZCL attribute report 0x0017880106F4F8F9 for cluster: 0x0402, ep: 0x02, frame control: 0x08, mfcode: 0x0000 22:29:33:961 Current channel 15 22:29:33:969 Device TTL 5639 s flags: 0x7 22:29:39:220 [INFO] - Button 1002 short 22:29:42:004 [INFO] - Button 1002 short 22:29:45:960 [INFO] - No button handler for: TH01 endpoint: 0x01 cluster: 0x0402 command: 0x0A payload[0]: 000 22:29:45:960 ZCL attribute report 0x00124B002228CA84 for cluster: 0x0402, ep: 0x01, frame control: 0x18, mfcode: 0x0000 22:29:46:151 [INFO] - Button 1003 long 22:29:53:344 sensor 2 (SML001): disable presence 22:29:53:548 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0406 command: 0x0A payload[0]: 000 22:29:53:548 ZCL attribute report 0x0017880106F4ECA3 for cluster: 0x0406, ep: 0x02, frame control: 0x08, mfcode: 0x0000 22:30:13:926 [INFO] - Button 1002 short 22:30:15:927 [INFO] - Button 1004 double 22:30:16:941 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0406 command: 0x0A payload[0]: 000 22:30:16:941 ZCL attribute report 0x0017880106F4D4F9 for cluster: 0x0406, ep: 0x02, frame control: 0x08, mfcode: 0x0000 22:30:17:031 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0400 command: 0x0A payload[0]: 000 22:30:17:031 ZCL attribute report 0x0017880106F4D4F9 for cluster: 0x0400, ep: 0x02, frame control: 0x08, mfcode: 0x0000 22:30:18:366 [INFO] - Button 1002 short 22:30:18:530 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0400 command: 0x0A payload[0]: 000 22:30:18:530 ZCL attribute report 0x0017880106F4D4F9 for cluster: 0x0400, ep: 0x02, frame control: 0x18, mfcode: 0x0000 22:30:19:225 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0400 command: 0x0A payload[0]: 000 22:30:19:225 ZCL attribute report 0x0017880106F4F8F9 for cluster: 0x0400, ep: 0x02, frame control: 0x08, mfcode: 0x0000 22:30:20:792 [INFO] - Button 1004 double 22:30:24:050 [INFO] - Button 1002 short 22:30:27:196 [INFO] - Button 1002 short 22:30:31:694 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0402 command: 0x0A payload[0]: 000 22:30:31:694 ZCL attribute report 0x0017880106F4E208 for cluster: 0x0402, ep: 0x02, frame control: 0x08, mfcode: 0x0000 22:30:33:958 Current channel 15 22:30:33:966 Device TTL 5579 s flags: 0x7 22:31:20:908 [INFO] - No button handler for: RWL021 endpoint: 0x02 cluster: 0x0001 command: 0x0A payload[0]: 021 22:31:20:908 ZCL attribute report 0x0017880104F32359 for cluster: 0x0001, ep: 0x02, frame control: 0x08, mfcode: 0x0000 22:31:25:859 [INFO] - No button handler for: TH01 endpoint: 0x01 cluster: 0x0405 command: 0x0A payload[0]: 000 22:31:25:859 ZCL attribute report 0x00124B002228CA84 for cluster: 0x0405, ep: 0x01, frame control: 0x18, mfcode: 0x0000 22:31:33:968 Current channel 15 22:31:33:976 Device TTL 5519 s flags: 0x7 22:31:47:732 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0402 command: 0x0A payload[0]: 000 22:31:47:732 ZCL attribute report 0x0017880106F4D4F9 for cluster: 0x0402, ep: 0x02, frame control: 0x08, mfcode: 0x0000 22:31:53:383 [INFO] - Button 1002 short 22:32:33:960 Current channel 15 22:32:33:969 Device TTL 5458 s flags: 0x7 22:32:40:047 dev /dev/ttyAMA0 22:32:40:047 GW firmware version: 0x26660700 22:32:40:047 GW firmware version is up to date: 0x26660700 22:33:05:271 [INFO] - No button handler for: RWL021 endpoint: 0x02 cluster: 0x0001 command: 0x0A payload[0]: 021 22:33:05:271 ZCL attribute report 0x0017880106A7F62F for cluster: 0x0001, ep: 0x02, frame control: 0x08, mfcode: 0x0000 22:33:17:495 [INFO] - No button handler for: SML001 endpoint: 0x02 cluster: 0x0402 command: 0x0A payload[0]: 000 22:33:17:495 ZCL attribute report 0x0017880106F4ECA3 for cluster: 0x0402, ep: 0x02, frame control: 0x08, mfcode: 0x0000

Jimmy-SafeCash commented 3 years ago

Fixed! For some reason when I had added the switch it had created a light group with the same switch ID? I deleted the light group, reloaded the integration and bingo, it worked.

SAOPP commented 3 years ago

Guys 86th version, any events is not presents :(

markusadam27 commented 3 years ago

Hi guys I have a SNZB-01 that i try to get to work with the phoscon app, at the moment i use a win10 PC. For me in deCONZ everything looks fine since the new version 86. In Debugview i see that the events are printed out correct: [1248] 19:37:50:010 [INFO] - Button 1002 short [1248] 19:37:52:487 [INFO] - Button 1004 double [1248] 19:38:00:549 [INFO] - Button 1003 long

In Phoscon the switch is detected but i can not add it to a group

image

image

Does anybody know if the switch is only fully supported for deCONZ but not for Phoscon?

SwoopX commented 3 years ago

Please check out the Phoscon beta repository for your question. Phoscon is just another REST API client, the switch itself is fully supported.

Smanar commented 3 years ago

This device don't have group capabilities, it s possible to make group with it in phoscon ?

SwoopX commented 3 years ago

I wouldn't place a sure bet on it yet. However, I cannot check it as I don't have any such device.

carloaugx commented 3 years ago

Confirm same issue; SNZB-01 recognized with deconz 2.06.00 / 11/15/2020 Raspbee 2 Firmware Version: 26660700

But cannot be added to an existing group as available switch.

SwoopX commented 3 years ago

You need to do it via the old webapp.

carloaugx commented 3 years ago

Thanks @SwoopX, but what exact version I need to use of deconz? image

SwoopX commented 3 years ago

It's not a version thing. Your screenshot is from Phoscon and not the old webapp.

Iirc, you reach the old webapp via http://YOUR_IP_ADDRESS/login.html Username is: delight

carloaugx commented 3 years ago

Great @SwoopX it works! Thanks a lot for your help.

riyas1980 commented 3 years ago

It's not a version thing. Your screenshot is from Phoscon and not the old webapp.

Iirc, you reach the old webapp via http://YOUR_IP_ADDRESS/login.html Username is: delight

I have the same issue. It's detected by phoscon but I can't use it. I've tried to follow your suggestion by using the old webapp but it's not connecting. I am using raspberry pi 4 with Hassio. Can you please help me how to do that ?

TadFocus commented 3 years ago

hello, I have the same issue as @riyas1980, please help @SwoopX But my phoscon didn´t detect it.

rudak commented 3 years ago

I have a result after pairing it with Conbee II on Jeedom

Version 2.5.84
Firmware 0x26660700
{
    "22": {
        "config": {
            "battery": 100,
            "group": "2",
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "822d1c3c54107d08a8e4d755eddd8df8",
        "lastseen": "2021-02-03T18:59Z",
        "manufacturername": "eWeLink",
        "mode": 1,
        "modelid": "WB01",
        "name": "WB01 22",
        "state": {
            "buttonevent": 2002,
            "lastupdated": "2021-02-03T18:14:10.812"
        },
        "swversion": "20200718",
        "type": "ZHASwitch",
        "uniqueid": "00:12:4b:00:1f:66:18:aa-01-0006"
    }
}

Only the double clic is recognized... lol

KMDobrev commented 3 years ago

Hi guys I have a SNZB-01 that i try to get to work with the phoscon app, at the moment i use a win10 PC. For me in deCONZ everything looks fine since the new version 86. In Debugview i see that the events are printed out correct: [1248] 19:37:50:010 [INFO] - Button 1002 short [1248] 19:37:52:487 [INFO] - Button 1004 double [1248] 19:38:00:549 [INFO] - Button 1003 long

In Phoscon the switch is detected but i can not add it to a group

I am having the same problem. Sorry, I couldn't find a solution.

TadFocus commented 3 years ago

hello, I have the same issue as @riyas1980, please help @SwoopX But my phoscon didn´t detect it.

Everything works for me after the last update

KMDobrev commented 3 years ago

hello, I have the same issue as @riyas1980, please help @SwoopX But my phoscon didn´t detect it.

Everything works for me after the last update

What is the update version?

FreshJonte commented 3 years ago

hello, I have the same issue as @riyas1980, please help @SwoopX But my phoscon didn´t detect it.

Everything works for me after the last update

What is the update version?

Having the same issue. Any update?

sunshineautomate commented 3 years ago

Thanks to the devs for looking at this. Same issue, Alot of people will be buying this Sonoff gear as their zigbee implementation is decent. Hoping for a resolution.