Closed madman2143 closed 3 years ago
Product Page: https://sonoff.tech/product/smart-home-security/snzb-01
Please add the missing information as mentioned in the device request, thanks!
Sorry, I'm new to this!
Are you talking about this?
Any update on this. Do you need more information?
Very interested on this switch
As there hasn't been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.
As there hasn't been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it isn't solved, request to get this opened again.
Hi! Guys, I just get this device, but one question, I have only two actions: double and long, and missing single click.
Any suggestion for this situation or at current moment device is not fully supported yet?
But from the code I see only "on" and "off" as return possible.
static const Sensor::ButtonMap sonoffOnOffMap[] = {
// mode ep cluster cmd param button name
{ Sensor::ModeScenes, 0x01, 0x0006, 0x01, 0, S_BUTTON_1 + S_BUTTON_ACTION_SHORT_RELEASED, "On" },
{ Sensor::ModeScenes, 0x01, 0x0006, 0x00, 0, S_BUTTON_2 + S_BUTTON_ACTION_SHORT_RELEASED, "Off" },
// end
{ Sensor::ModeNone, 0x00, 0x0000, 0x00, 0, 0, nullptr }
};
Wich one numeric value you have ?
If I correctly understood your question 'bout values of buttons... double 1002, long 2002 (at Home Assistant events)
Ok so it seem this devices have other return value. I have used the @SAOPP log to make the table, but will be nice if someone can test it ?
The new code
static const Sensor::ButtonMap sonoffOnOffMap[] = {
// mode ep cluster cmd param button name
{ Sensor::ModeScenes, 0x01, 0x0006, 0x01, 0, S_BUTTON_1 + S_BUTTON_ACTION_DOUBLE_PRESS, "Double" },
{ Sensor::ModeScenes, 0x01, 0x0006, 0x00, 0, S_BUTTON_1 + S_BUTTON_ACTION_LONG_RELEASED, "Long" },
{ Sensor::ModeScenes, 0x01, 0x0006, 0x02, 0, S_BUTTON_1 + S_BUTTON_ACTION_SHORT_RELEASED, "Short" },
// end
{ Sensor::ModeNone, 0x00, 0x0000, 0x00, 0, 0, nullptr }
};
To test the code
git clone --branch sonoff https://github.com/Smanar/deconz-rest-plugin.git
cd deconz-rest-plugin
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins
I would be very happy to test this, but I am running DeConz in docker. Is that possible?
Nope, need a classic OS to compile the code. But not in hurry.
I would like to test to but don't know how on RPI2
Does it works only for snzb-01 or maybe also with 03?
@pippo73 The 03 is a motion sensor ? not a switch ?
@NovaGL If you have a Rpi with a classic OS (not HA for exemple), you have the procedure on homepage https://github.com/dresden-elektronik/deconz-rest-plugin#install-deconz-development-package-optional-linux-only
Just change a little for step (1- 4)
git clone --branch sonoff https://github.com/Smanar/deconz-rest-plugin.git
cd deconz-rest-plugin
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins
How do I install qmake?
You have tested
sudo apt install deconz-dev
Doesn't work for me, can you make a package for RPI2 and I'll test it.
I tried I built it on ubuntu but get login failed
Yes @Smanar I'm talking about the motion sensor
I tried I built it on ubuntu but get login failed
Login failed - what u r mean? U can't login into phoscon with ur creds or?
The error was misleading, it actually wasn't compiled for the right arch i believe.
Don't know what I'm doing. Tried in an ubuntu vm i can build it but don't know what arch its building for.
Any tips for compiling would be appreciated.
@pippo73 this code is for the switch what is the problem with the motion sensor ? It seem work since the version 79 > https://github.com/dresden-elektronik/deconz-rest-plugin/issues/2991
@NovaGL You just need to use sudo apt install deconz-dev
it will make the correct "environnement" according to your system. If this command work, the rest will be fine
And after use the same commands than me, what is your error displayed, it can come from me, I don't test all the code.
Hi @Smanar I struggle at this stage
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins
Before I copy the file everything works fine, the moment I copy the file I can't access anything. No error
If you can tell me how to debug it I'll send you what error I can find but the logs I have dont show errors.
See what are the access rights for the new library that you compiled?
I think I was getting confused and rebooting the computer shows it not as accessible. So it looks like it was compiled for the wrong arch when used on the PI and it shouldn't have been accessible on Ubuntu as it wasn't physically connected to it.
Is there anyway I can compile for the Raspberry PI when using Ubuntu VM.
as far I remember, it's a universal library, I can of course be wrong, the last time I compiled a few months ago
Compilation are machine specific, you can't compile on a machine and use the file on a different one.
Before I copy the file everything works fine, the moment I copy the file I can't access anything. No error
The system freeze ? Better to close deconz before replacing the file.
I don't have a proper computer to test it on as Hyper-V doesn't do USB Passthrough and can't compile on a RPI2 so I'll have to leave this for others to test.
@Smanar I've bought 5 of them, and I can connect only 2 of them. anyway I will try to ask in the 3d yo indicated me. Thank you anyway
I moved to zigbee2mqtt and these devices are working flawlessly
@NovaGL This is not a proper solution 😉
@Smanar Do we need to re-open this?
I agree this issue needs to be re-opened as it is not implemented correctly. Missing single click.
Happy to test but I just can't build it.
The current code base allows you to "fix" that on your own with a little guidance.
Awesome, can you point me in the right direction and I'll try and report back.
I can put my raspbee at official image, so maybe I can tested it...
You need to compile the current code of the offical repo. The instructions are mentioned there, in the readme. Additionally, you need to copy file button_maps.json to the location where your database (zll.db) resides. In the json file, you cann add the missing entry which is either known or can be taken from deconz debug output.
Thanks I gave up on that cause I couldn't compile it on my RPI2
@SwoopX It s an old code make before your change so for this one they don't need yet to use the button_maps.json
Hey guys, has this now been tested and confirmed working and will be merged into the next release?
It s not tested yet ^^
It s not tested yet ^^
Will it be pushed into beta branch for testing? Seems odd to have half of the sonoff range working and the other half not.
PR done, untested, but you will be able to edit the file yourself on next version, will be json file.
PR done, untested, but you will be able to edit the file yourself on next version, will be json file.
Excellent, I'll wait for it to be released. Good job and thanks.
@Smanar I just received this exact switch in the mail today and stumbled upon this thread when it didn't work. I cloned down your branch, compiled, and copied over the libde_rest_plugin.so and button_maps.json file. It didn't work for me. I still see the following logged when I do any of the button presses:
# Short
[INFO] - No button map for: WB01 endpoint: 0x01 cluster: 0x0006 command: 0x02 payload[0]: 000
# Double
[INFO] - No button map for: WB01 endpoint: 0x01 cluster: 0x0006 command: 0x01 payload[0]: 000
# Long
[INFO] - No button map for: WB01 endpoint: 0x01 cluster: 0x0006 command: 0x00 payload[0]: 000
What device are you using with the combee? Maybe you have to update button maps json
Device