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

[Request device support] Support for Namron 4-channel switch (Luzense/Sunricher clone) #2158

Closed
eckhart opened this issue Dec 1, 2019 · 71 comments

Comments

@eckhart
Copy link

eckhart commented Dec 1, 2019

This is widely available in Norway, and fits the standard ELKO frames which are common here:

https://www.elektroimportoren.no/namron-zigbee-4-kanaler-bryter-k8/4512703/Product.html

To me it seems more or less identical to the 4-channel ones in #1509 but under a different brand name. It shows up in deCONZ with "Namron AS" as manufacturer instead of "Sunricher" and doesn't show up as a switch in Phoscon/REST API after the switch confirms successful pairing.

Below is what I have from deCONZ. I've read out all the attributes from the seperate channels, they look identical so just including one of them here. Let me know if more info is needed.

namron_switch1
namron_switch3
namron_switch4
namron_switch5
namron_switch6
namron_switch11

@eckhart eckhart changed the title Support for Namron 4-channel switch (Luzense/Sunricher clone) [Request device support] Support for Namron 4-channel switch (Luzense/Sunricher clone) Dec 1, 2019
@corvy
Copy link

corvy commented Dec 2, 2019

@eckhart it does not show up in groups in the old web interface either?

@ebaauw I guess it takes a very basic change to add support for this?

@eckhart
Copy link
Author

eckhart commented Dec 2, 2019

No, it doesn't show in the old web interface either.. Would be great to have it supported as it's a lot cheaper than other brands.

@ebaauw
Copy link
Collaborator

ebaauw commented Dec 2, 2019

Probably. Just whitelist it in supportedDevices in de_web_plugin.cpp and assign it to the buttonmap for the 8-button switch in sensors.cpp.

@eckhart
Copy link
Author

eckhart commented Dec 7, 2019

@ebaauw Sorry that I haven't had the time to follow this up, would be great if no more than this is needed. Being new to this, do the devs prefer that I add, build and test this myself and then make a pull request?

@ebaauw
Copy link
Collaborator

ebaauw commented Dec 7, 2019

do the devs prefer that I add, build and test this myself and then make a pull request?

That's what I've done for the devices I own or could borrow. Adding support without having physical access to the device is almost undoable, due to different interpretations of the ZigBee standards by different manufacturers, and due to the complexity of the REST API plugin code (there's always one more place to whitelist a device).

@monsivar
Copy link

monsivar commented Jan 4, 2020

@ebaauw Sorry that I haven't had the time to follow this up, would be great if no more than this is needed. Being new to this, do the devs prefer that I add, build and test this myself and then make a pull request?

Do you have an config that works for this switch?

@eckhart
Copy link
Author

eckhart commented Jan 10, 2020

@monsivar Unfortunately no, I haven't had the time to set up a building and testing environment yet. I'll submit a pull request when I have something working.

@monsivar
Copy link

Is there any recipes on the net for adding this switch to the deconz for an nuub like me? @ebaauw

@ebaauw
Copy link
Collaborator

ebaauw commented Jan 17, 2020

None official. I did a writeup here: #2061 (comment)

@phithor
Copy link
Contributor

phithor commented Jan 23, 2020

I'd like support for this switch myself. Going to try to do this over the weekend.

@monsivar
Copy link

I'd like support for this switch myself. Going to try to do this over the weekend.

Nice, I did not see the effort of trying..

@flemmingss
Copy link

I am also interested in getting this Namron 4-channel switch to work with Deconz,
I have one still unopened because of this support missing. I am not in any way experienced with doing anything non-phoscon at this time, but if there is some info I can supply just let me know

@phithor
Copy link
Contributor

phithor commented Jan 27, 2020

I tried to whiteliste it and button map it as described above and then i was unable to build it in my environment, got an error with missing QT module serialport for some reason and did not have time to debug it. Do I need to install qt explicitly in addition to deconz-dev?

EDIT: Set up a fresh new Ubuntu VM and was able to build it. I re-paired the switch but nothing showed up in Phoscon. Maybe I need to whitelist some more places as linked to above.

master...phithor:namronswitch

@mk1blacklimited
Copy link

+1 for wanting this supported! :)

@monsivar
Copy link

monsivar commented Feb 4, 2020

EDIT: Set up a fresh new Ubuntu VM and was able to build it. I re-paired the switch but nothing showed up in Phoscon. Maybe I need to whitelist some more places as linked to above.

Any update on this?

@bardnilsen
Copy link

@eckhart I am having trouble setting the switch in network pairing mode. How did you do it? (Namron 4512703)
I tried holding down on and off buttons in group1 followed by pressing off button in group1 when the led turned on. It blinks 13 times then stops. Any ideas?

@lrzorg
Copy link

lrzorg commented Feb 9, 2020

+1 for supporting Namron switches.
New to HA and bought some of the 2-channel ones (4512702) thinking any ZigBee 3.0 switch would work :-/
The hardware seems visually equal to the iCasa switches, apart from the button symbols...

About pairing:
Not sure if this helps, but the manual states that if the device is in "network mode" (already paired), it needs to be factory reset before pairing.
The device is in "network mode" if the led blinks when a button is pressed.
To do a factory reset, as per the manual press and hold the first "1" button until the light goes on, then press 5 times on the "1" button. The 5 presses should not be too fast in my experience. This took me a couple of tries to get right. About one second between each press seems right
The device responds by blinking three times if successful.
If pressing a button does not cause the led to blink, it is ready for pairing again.
Pairing mode should be just holding down the first "1" until the light goes on, then press the first "0".

This worked for the 2 channel switch to behave as intended (still needs deconz support), and I checked the manual for the 4-channel and it is the same setup.

@monsivar
Copy link

Any updates on this one?

@crazyclona
Copy link

Any updates on this one?

I hope there is soon ;) Would be awsome.. bought a few of them.......

@phithor
Copy link
Contributor

phithor commented Mar 9, 2020

OK guys, I have not figured out if my branch works, I think I need to try again. Or can any of you help test my branch above? Build it, install it, test of you can add the button.

@bardnilsen
Copy link

Hi phithor,

Great work :)

I have tested it. I can now add the 4-channel switch in phoscon app, but it does not show up in phoscon web gui. I see it in the rest-api and shows up in my HomeAssistant, but with no entities.

@phithor
Copy link
Contributor

phithor commented Mar 13, 2020

Ah, thanks for that, I did not understand what worked and what not. At least we have gotten somewhere when it shows up in the rest-api. AS you I have seen I have a device with ID "4512703". It's corona-time, so I think I will have time to do some more on this today/this weekend.

@phithor
Copy link
Contributor

phithor commented Mar 14, 2020

Hah, in conclusion the commit I made almost two months ago more or less works perfectly fine.
I did it the same as was done here: 539b217

The key to using the switch is pressing open network, activating each of the groups on the switch by pressing a button, then reading the basic cluster of each of the groups while the network is open. Then the groups will be made where you can add lights to.
See info in this thread:
#1509 (comment)

I will push the commit to the main repo asap.

@monsivar
Copy link

monsivar commented Mar 24, 2020

@phithor cloned your git https://github.com/phithor/deconz-rest-plugin

Then I get this problem when trying to test, after running the command: qmake && make -j2

In file included from bindings.cpp:11:
de_web_plugin.h:16:10: fatal error: deconz.h: Ingen slik fil eller filkatalog
#include <deconz.h>
^~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile.Release:527: release/bindings.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from authorisation.cpp:13:
de_web_plugin_private.h:23:10: fatal error: sqlite3.h: Ingen slik fil eller filkatalog
#include <sqlite3.h>
^~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile.Release:509: release/authorisation.o] Error 1
make[1]: Leaving directory '/home/pi/deconz-rest-plugin'
make: *** [Makefile:40: release] Error 2

@phithor
Copy link
Contributor

phithor commented Mar 24, 2020

Hm, I think I got that as well the first time, but I believe that is missing files in your qt setup? Have you installed deconz-dev?

@monsivar
Copy link

Hm, I think I got that as well the first time, but I believe that is missing files in your qt setup? Have you install deconz-dev?

I have. Restarted my pi, and its working :-)

@monsivar
Copy link

monsivar commented Mar 25, 2020

Hm, I think I got that as well the first time, but I believe that is missing files in your qt setup? Have you installed deconz-dev?

Hi. but i still have an problem . The switch is not listed upp in the old web interface, or in the api.

Sorry for all the questions, first time manually adding something, and first time cloning from git... so a big learning curve here

image

@phithor
Copy link
Contributor

phithor commented Mar 25, 2020

Did you follow the instructions I linked to above? In the old interface, open the network and then read cluster in each of the channels. That should create the groups.

@Mimiix Mimiix closed this as completed Jul 10, 2020
@SwoopX SwoopX reopened this Jul 10, 2020
@SwoopX SwoopX closed this as completed Jul 10, 2020
@habakke
Copy link

habakke commented Jul 10, 2020

@Mimiix && @SwoopX I am sort of confused whether support for this device has been implemented or not? It is definitely not working here. Must the device be supported by the Phoscon app for it to be usable and able to control any lights? I have been under the impression that adding support for it in the deconz-rest-plugin is sufficient?

For good measure I created a git issue as suggested by @Mimiix: dresden-elektronik/phoscon-app-beta#152

@SwoopX
Copy link
Collaborator

SwoopX commented Jul 10, 2020

It is supported and also whitelisted in the code. However, the support was provided by someone who obviously wasn't that familiar with the code.

As such, the underlying request is done. Visibility in Phoscon is a different thing, as Mimiix pointed out, therefore the requirement for a request.

@phithor
Copy link
Contributor

phithor commented Jul 11, 2020

@habakke i checked your issue in the Phoscon App and I noticed your switch shows manufacturer id "NAMRON AS" in all caps. I have not seen that before. That might why it is not working for you, as the whitelist is only for "Namron AS" if I remember correctly.
Can you confirm the manufacturer ID shows all caps?

@habakke
Copy link

habakke commented Jul 12, 2020

@phithor I can confirm the manufacturer name show all caps "NAMRON AS" as seen in the screenshot of the basic cluster group below:

image

The OTAU cluster group shows the manufacturer ID to be 0x1224 as seen below:

image

@habakke
Copy link

habakke commented Jul 12, 2020

@phithor I installed the dev env. and did a quick change to the code to assign the sunricher buttonmap if the manufacturer matches upper case "NAMRON AS", compiled and installed. Now the groups are created as expected:

image

I am now able to add lights to the groups in and control them using the buttons. The integration with Home Assistant does not work properly yet though, and I assume this will require the device to be supported by the Phoscon app as per @Mimiix and @SwoopX'es comments.

@SwoopX
Copy link
Collaborator

SwoopX commented Jul 13, 2020

Taken care of this in my last PR real quick. While pairing, we now set the Manufacturer to "Namron AS" for all devices beginning with 451270. Should be included in the next release.

@clindland
Copy link

Taken care of this in my last PR real quick. While pairing, we now set the Manufacturer to "Namron AS" for all devices beginning with 451270. Should be included in the next release.

Mine still won´t work. After this release I checked the model identifier number, and it says 4512721, and still "NAMRON AS" with all caps. Is it possible to include the switches with these id numbers?

Skjermbilde 2020-07-21 kl  10 25 12

@SwoopX
Copy link
Collaborator

SwoopX commented Jul 21, 2020

Renaming will be done based on the modelId. Of course your device brings another one into play, which doesn't fit the pattern... How many different IDs can one device have...?

@clindland
Copy link

Yeah, they didn't make it easy on us.. Is it possible to add my ID's (or my pattern if there's anyone out there with an ID similar to mine) to the renaming pool? It would be really great to get this to the deconz hassio addon 👍

@SwoopX
Copy link
Collaborator

SwoopX commented Jul 28, 2020

Don't worry, will be supported with the next release.

@flemmingss
Copy link

Do you know when that is? because I am on the least one now and am not able to discover it.

image

@SwoopX
Copy link
Collaborator

SwoopX commented Aug 3, 2020

August 15th, if you run bare Raspian, without HA and have subscribed to the beta channel.

@flemmingss
Copy link

I am using Raspian, without HA, but how do i subscribe to the beta channel?

@SwoopX
Copy link
Collaborator

SwoopX commented Aug 4, 2020

@flemmingss
Copy link

Thanks, can i run stable and beta side-by-side?

@SwoopX
Copy link
Collaborator

SwoopX commented Aug 5, 2020

Nope. But since you already run version .79 I'd assume you're using the beta channel already.

@flemmingss
Copy link

I will wait until August 15th and see then :)

@flemmingss
Copy link

pi@phoscon:~ $ sudo dpkg -i deconz-latest-beta.deb

dpkg: warning: downgrading deconz from 2.05.78-raspbian-stretch-stable to 2.05.72-raspbian-stretch-beta
(Reading database ... 74742 files and directories currently installed.)
Preparing to unpack deconz-latest-beta.deb ...
Unpacking deconz (2.05.72-raspbian-stretch-beta) over (2.05.78-raspbian-stretch-stable) ...
Setting up deconz (2.05.72-raspbian-stretch-beta) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for mime-support (3.60) ...
pi@phoscon:~ $ 

Still not able to add it. deconz-latest-beta.deb last modify is 15-Aug-2020 14:04.

image

pi@phoscon:~ $ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Hit:2 http://phoscon.de/apt/deconz stretch InRelease
Hit:3 http://raspbian.raspberrypi.org/raspbian stretch InRelease      
Reading package lists... Done              
pi@phoscon:~ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  deconz
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/5,843 kB of archives.
After this operation, 12.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Reading changelogs... Done
(Reading database ... 74105 files and directories currently installed.)
Preparing to unpack .../deconz_2.05.78-raspbian-stretch-stable_armhf.deb ...
Unpacking deconz (2.05.78-raspbian-stretch-stable) over (2.05.72-raspbian-stretch-beta) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Setting up deconz (2.05.78-raspbian-stretch-stable) ...
pi@phoscon:~ $ 

image

@SwoopX
Copy link
Collaborator

SwoopX commented Aug 15, 2020

You first downgraded 6 versions and then upgraded 6 versions. And are still 2 versions behind... You also use the stable branch instead of beta. .79 should be promoted to stable today, .80 next month.

@flemmingss
Copy link

can you give me te correct commands to get the last one :P

@flemmingss
Copy link

Okay, I am on the last one, still not able to add it.
image

@t112013
Copy link

t112013 commented Sep 1, 2020

Hello, i have a question i just got two of these but one with 2 channels and one with only 1 channel. (4 and 2 buttons).
But i cannot add them in phoscon app. could anyone please tell me what to do ? or is it only the 4 channels one supported ?
iam running hassio with deCONZ ver 2.05.79.
thanks a lot. iam completly noob :)

@Mimiix
Copy link
Collaborator

Mimiix commented Sep 1, 2020

@t112013 Support was added in .80. So you have to wait until HA updates it.

Same goes for @flemmingss : You are not on latest update afaik. Please open a seperate issue.

Locking this issue for further conversation. If there's issue, please open seperate userquestions/bugreports.

@dresden-elektronik dresden-elektronik locked as resolved and limited conversation to collaborators Sep 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests