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

[New device request] Osram Smart+ mini switch #2763

Closed
NicolasBoulanger opened this issue May 12, 2020 · 155 comments · Fixed by #2917
Closed

[New device request] Osram Smart+ mini switch #2763

NicolasBoulanger opened this issue May 12, 2020 · 155 comments · Fixed by #2917

Comments

@NicolasBoulanger
Copy link

Hello,
i bought 2 zigbee osram mini switch, i made a pull request to make it working on zigbee2mqtt, but now i use conbee :)
i have 1 blue and 1 white
i like these remotes for my roller shutter
https://www.amazon.fr/dp/B074PYT9R4/ref=twister_B07MVNX6V6?_encoding=UTF8&psc=1
the device is detected in deconz but can only switch on and off all lights
here screenshot of the 2 remote (maybe different)
if you need more informations tell me :)
thanks !

Blue:
mini_switch_blue

White:
mini_switch_white

@NicolasBoulanger NicolasBoulanger changed the title New device request [New device request] Osram Smart+ mini switch May 12, 2020
@Smanar
Copy link
Collaborator

Smanar commented May 12, 2020

Hello.
What is the mystery with this device ^^ ?

There is so much issue about it
#2082
#374
#294
ect ...

Some people say it's working, some other not.

And I don't see the problem, I m missing something ?

This device is detected in deconz ? I don't see it in supported device on the code, you have it as light or sensor ? Can you show me the device JSON pls ?

You want to use it for your roller shutter ? But how it work ATM, I m seeing only 3 button on the device and according to the cluster it can make on/off+ level control + color control, seriously ???

Edit:

Button 1 short press: All ON
Button 1 long press: Brightness UP
Button 2 short press: 2700K / Brightness 100%
Button 2 long press: Change color (forward)
Button 3 short press: All OFF
Button 3 short press: Brightness DOWN

@NicolasBoulanger
Copy link
Author

its not really working, i cannot see remote in switch category on deconz software
it is detect but cannot assign light or whatever
remote can switch on all light with up button
turn on life with down button
i cannot configure button in deconz

i use it with:
short up press : open my living room cover
short circle pres: stop living room cover
short down press: close living room cover

long press up: open desktop window cover
long press circle: stop desktop window cover
long press down: close desktop window cover

my second remote, i use it for garden light

which json logs you need ? which command?
this logs ?

15:52:24:069 APS-DATA.indication srcAddr: 0x532a, srcEp: 0x02 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 215, rssi: -6715:52:24:069 APS-DATA.indication srcAddr: 0x532a, srcEp: 0x02 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 215, rssi: -67

15:54:00:255 APS-DATA.indication srcAddr: 0x50b9, srcEp: 0x02 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 215, rssi: -67

thanks !

@Smanar
Copy link
Collaborator

Smanar commented May 12, 2020

Ok so you are using it with zigbee broadcast (or group) command ?

Are you using an home assistant application with deconz ? HASS openhab or other ? (and have an API key ?)
If yes can you see the remote in it ?

@NicolasBoulanger
Copy link
Author

i'm using unicast: default configuration in deconz docker version
unicast
im using home assistant only to display my entities, but
my automations are in node-red vm
my configuration :
proxmox server :
deconz vm
node-red vm
hassio vm

all in bridged network, managed by my unifi router
i use deconz api in node-red with node-red-contrib-deconz palette
i cannot see remote in hassio

@NicolasBoulanger
Copy link
Author

@Smanar
Copy link
Collaborator

Smanar commented May 12, 2020

Ok so I think this device is not in deconz at all.

It will be something I will ask again soon, so to see your device in deconz API, you can use this kind of url
http://IP:PORT/api/API_KEY/sensors
For ip and port, it's the same you are using than for phoscon
For API_KEY I think you can find it somewhere on the deconz plugin in HASS

Now I can try make a ZHAswitch for this device, so you will have a value for all fonctions (IDK how much yet).

But if you want to make "direct connexion" between your shutter and the remote, not sure if it will work. You can make try using phoscon.
IDK if your shutter support "direct connexion", wich one cluster they need, and why you can use it with bulb and not the shutter (perhaps the shutter use windowcovering cluster ?)

But if you want a buttonevent value like for ikea remote to use it with nodered, I think it will be possible.

But it's strange no one have already do it ^^, I think there is a trap I haven't see yet.

@NicolasBoulanger
Copy link
Author

NicolasBoulanger commented May 12, 2020

ok i'll check with the api
my shutter is in wifi (shelly2.5 module) so, event, yes and button configuration in web interface, it will be the solution
thanks !

@NicolasBoulanger
Copy link
Author

i think this is the action for remote switch?
tempsnip

@bphermansson
Copy link

Ok so I think this device is not in deconz at all.

It will be something I will ask again soon, so to see your device in deconz API, you can use this kind of url
http://IP:PORT/api/API_KEY/sensors
For ip and port, it's the same you are using than for phoscon
For API_KEY I think you can find it somewhere on the deconz plugin in HASS

You can get the API key by locking up the gateway and run a Rest client, or Curl:
curl --header "Content-Type: application/json" --request POST --data "{ "devicetype": ""}" http://192.168.1.15/api
The API gets back as username, "{"username":"D7nnnnnn"}}]".
This is explained at https://dresden-elektronik.github.io/deconz-rest-doc/getting_started/.

@NicolasBoulanger
Copy link
Author

Ok so I think this device is not in deconz at all.
It will be something I will ask again soon, so to see your device in deconz API, you can use this kind of url
http://IP:PORT/api/API_KEY/sensors
For ip and port, it's the same you are using than for phoscon
For API_KEY I think you can find it somewhere on the deconz plugin in HASS

You can get the API key by locking up the gateway and run a Rest client, or Curl:
curl --header "Content-Type: application/json" --request POST --data "{ "devicetype": ""}" http://192.168.1.15/api
The API gets back as username, "{"username":"D7nnnnnn"}}]".
This is explained at https://dresden-elektronik.github.io/deconz-rest-doc/getting_started/.

yes i have my key :)

@Smanar
Copy link
Collaborator

Smanar commented May 13, 2020

Ok so I have started Smanar@55ecd9a

But I have some problems for the table sensor.

Have you an Unix machine 32 bit to compile the code and make tries ?

The procedure is explained here > https://github.com/dresden-elektronik/deconz-rest-plugin at "Install deCONZ development package (optional, Linux only)"

You just need to change the step 1 by
git clone https://github.com/Smanar/deconz-rest-plugin.git

The new code will include the device, you will probably have some issue with braodcast command (some bulbs in your network will react to the remote). You will have a new sensor, a ZHAswitch with "bouttonevent" field.
I think the device will be invisible in phoscon, but you can see it in the API or HA.

If you enable the deconz log (like in your second post) you will see something like

14:54:41:654 no button handler for: XXXXXX sensor ep: 0x01 cl: 0x0006 cmd: 0x42 pl[0]: 0x00

Everytime you press a button (for the missing one, but I think only 2 will work)
I just need the button (short/long/release) you have pressed and the message

@bphermansson
Copy link

I've tried this and it's working. I installed Smanars patch and started a search for new switches in Phoscon. I see the switch in Deconz and in the logs:

13:11:05:886 0x00124B0014B71F47 onOff 0 --> 1
13:11:05:887 no button map for: PSMP5_00.00.03.16TC ep: 0x01 cl: 0x0006 cmd: 0x0A pl[0]: 000
13:11:05:887 ZCL attribute report 0x00124B0014B71F47 for cluster: 0x0006, ep: 0x01, frame control: 0x18, mfcode: 0x0000

@Smanar
Copy link
Collaborator

Smanar commented May 14, 2020

But to make it working I need all button value, I have some problem to guesss them (3 mode / 4 cluster/ 3 endpoint .....), and it's easier with debug.
Just press a button and give me the log with "no button map" for missing one
You have Short press / long press / release for all 3 buttons (I think, not sure)

@NicolasBoulanger
Copy link
Author

@bphermansson can you did it ? you have this device too ?
thanks

@Smanar
Copy link
Collaborator

Smanar commented May 15, 2020

I can make explanation if you need @NicolasBoulanger ?
You have some problem with your OS ?

@bphermansson
Copy link

I have the Osram remote that is black in rubber. It has three button, large and small arrow and a circle. The output I get from Deconz is noisy and I only see one of the buttons, the small arrow. It gives this on a short press:
18:08:35:642 no button map for: PSMP5_00.00.03.16TC ep: 0x01 cl: 0x0702 cmd: 0x0A pl[0]: 000
Can't see no difference on a long press. Can some values from Zigbee2Mqtt help?

@Smanar
Copy link
Collaborator

Smanar commented May 15, 2020

I think I have values from zigbee2mqtt @NicolasBoulanger give a link for that #2763 (comment)

But it's realy faster using debug ^^. I will try better tommorow

But I don't understand why you have only the small arrow and not the big, I can understand for the "O" but the arrow ...
Perhaps It is already working, this debug message is only for not working button.
And there is something strange too

cl: 0x0702

Cluster metring ?

I will try to make better using this mapping

@Smanar
Copy link
Collaborator

Smanar commented May 15, 2020

And I m stupid.

Better to check working values before the no working one ^^.

Pls can you check in the json (or somewhere else) the "buttonevent" value, if the value is "none" I m totaly wrong, if you have something like X00Y I have at least 1 good value in my table.
This field is the last pressed button.

@Smanar
Copy link
Collaborator

Smanar commented May 16, 2020

So I have used this message
13:11:05:887 no button map for: PSMP5_00.00.03.16TC ep: 0x01 cl: 0x0006 cmd: 0x0A pl[0]: 000

So now I m using 1 endpoint by button, but always cluster 0006 and command 0x0A.
I m almost sure I miss the cluster 0008 but IDK wich one command to use with it

@NicolasBoulanger
Copy link
Author

NicolasBoulanger commented May 18, 2020

is good for you with these logs ?

11:55:47:312 no button map for: SML001 ep: 0x02 cl: 0x0406 cmd: 0x0A pl[0]: 000
11:55:49:309 no button map for: SML001 ep: 0x02 cl: 0x0400 cmd: 0x0A pl[0]: 000
11:55:55:431 no button map for: SML001 ep: 0x02 cl: 0x0402 cmd: 0x0A pl[0]: 000
11:02:34:469 no button map for: RWL021 ep: 0x02 cl: 0x0001 cmd: 0x0A pl[0]: 021

@Smanar
Copy link
Collaborator

Smanar commented May 18, 2020

Bas luck, RWL021 is a philips dimmer and SML001 is a HUE motion sensor ^^.

And now I m looking better, I have based my table on

13:11:05:887 no button map for: PSMP5_00.00.03.16TC ep: 0x01 cl: 0x0006 cmd: 0x0A pl[0]: 000
13:11:05:887 ZCL attribute report 0x00124B0014B71F47 for cluster: 0x0006, ep: 0x01, frame control: 0x18, mfcode: 0x0000

But It's not the good device too 0x00124B0014B71F47 is not in the good MAC range adress.

The log I need will contain "no button handler for: Lightify Switch mini" (not sure for typo).

@Smanar
Copy link
Collaborator

Smanar commented May 20, 2020

No-one can compile the code and give me some logs ?
I don't even know if only one works ...

@bphermansson
Copy link

Maybe later tonight I can give it a try.

@bphermansson
Copy link

Some new findings. Now I see my switch as 0x75B7 in Deconz. It's a Osram Lightify Switch Mini. Pushing the circle gives:

07:57:23:092 APS-DATA.indication srcAddr: 0x75b7, srcEp: 0x03 dstAddrMode: 2, profile: 0x0104, cluster: 0x0008, lqi: 167, rssi: -70
07:57:24:083 APS-DATA.indication srcAddr: 0x75b7, srcEp: 0x03 dstAddrMode: 2, profile: 0x0104, cluster: 0x0300, lqi: 167, rssi: -70

(and my Hue lamp switches on)

Pushing the large arrow:

08:01:20:906 APS-DATA.indication srcAddr: 0x75b7, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 151, rssi: -72
08:01:21:002 APS-DATA.indication srcAddr: 0x192c, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 255, rssi: -34
08:01:21:003 no button map for: PSMP5_00.00.03.16TC ep: 0x01 cl: 0x0006 cmd: 0x0A pl[0]: 000

The small arrow:
08:03:33:218 APS-DATA.indication srcAddr: 0x75b7, srcEp: 0x02 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 159, rssi: -71
08:03:33:300 APS-DATA.indication srcAddr: 0x192c, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 255, rssi: -35
08:03:33:302 no button map for: PSMP5_00.00.03.16TC ep: 0x01 cl: 0x0006 cmd: 0x0A pl[0]: 000
08:03:33:302 ZCL attribute report 0x00124B0014B71F47 for cluster: 0x0006, ep: 0x01, frame control: 0x18, mfcode: 0x0000

@NicolasBoulanger
Copy link
Author

Some new findings. Now I see my switch as 0x75B7 in Deconz. It's a Osram Lightify Switch Mini. Pushing the circle gives:

07:57:23:092 APS-DATA.indication srcAddr: 0x75b7, srcEp: 0x03 dstAddrMode: 2, profile: 0x0104, cluster: 0x0008, lqi: 167, rssi: -70
07:57:24:083 APS-DATA.indication srcAddr: 0x75b7, srcEp: 0x03 dstAddrMode: 2, profile: 0x0104, cluster: 0x0300, lqi: 167, rssi: -70

(and my Hue lamp switches on)

Pushing the large arrow:

08:01:20:906 APS-DATA.indication srcAddr: 0x75b7, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 151, rssi: -72
08:01:21:002 APS-DATA.indication srcAddr: 0x192c, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 255, rssi: -34
08:01:21:003 no button map for: PSMP5_00.00.03.16TC ep: 0x01 cl: 0x0006 cmd: 0x0A pl[0]: 000

The small arrow:
08:03:33:218 APS-DATA.indication srcAddr: 0x75b7, srcEp: 0x02 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 159, rssi: -71
08:03:33:300 APS-DATA.indication srcAddr: 0x192c, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 255, rssi: -35
08:03:33:302 no button map for: PSMP5_00.00.03.16TC ep: 0x01 cl: 0x0006 cmd: 0x0A pl[0]: 000
08:03:33:302 ZCL attribute report 0x00124B0014B71F47 for cluster: 0x0006, ep: 0x01, frame control: 0x18, mfcode: 0x0000

Did you try long press on both buttons?
Thanks !

@Smanar
Copy link
Collaborator

Smanar commented May 21, 2020

Hello, what is the MAC adress of your osram remote ?

Because perhaps the line

cluster: 0x0006, lqi: 255, rssi: -35
08:03:33:302 no button map for: PSMP5_00.00.03.16TC ep: 0x01 cl: 0x0006 cmd: 0x0A pl[0]: 000

is for the device 0x00124B0014B71F47 PSMP5

And this one is already on the table https://github.com/Smanar/deconz-rest-plugin/blob/master/sensor.cpp#L146

Can you share the complete log ?

@NicolasBoulanger
Copy link
Author

smart-switch-mini-commutateur-blanc
i found this image for phoscon app ?

@Smanar
Copy link
Collaborator

Smanar commented May 21, 2020

But phoscon is closed source.
We can't make something on our side.

@olicooper
Copy link
Contributor

olicooper commented Jun 9, 2020

Sorry, I didn't mean to say 0x0021 (I don't think it has battery percentage attribute?)...
I took a picture of the power cluster output 0x0001 so you can see what I see on deCONZ.

The button reports battery level on cluster 0x0001 ep 0x0020 but it also has an alarm mask on ep 0x0035 and cluster 0x0000 ep 0x0013 too.

As you have said before, I think reporting on 0x0020 is working because:

17:10:16:365 MyDebug apsdeDataIndication profileId:0x0104, cid:0x0001
17:10:16:365 ZCL configure reporting rsp seq: 46 0x000D6F00XXXXXXXX for ep: 0x01 cluster: 0x0001 attr: 0x0020 status: 0x00

I've also seen these:

17:11:45:234 MyDebug DeviceAnnce 3 sSenSt:1, apsCtrl:1
17:11:45:234 FP indication 0x0000 / 0x0013 (0x000D6F00XXXXXXXX / 0x9028)
17:11:45:234 ... (0x000D6F00XXXXXXXX / 0x9028)

Update:
In my previous tests I could get the battery stats to appear if I manually read the data on the power cluster. I decided to enabled forced reading of the battery stats as a test and it seems to work! Do you think this fix is correct - I'm not sure about read frequency? olicooper@0bec4e0

I wonder if the read problems are because we don't push the sensor fingerprint in bindings.cpp? srcEndpoints.push_back(sensor->fingerPrint().endpoint)... see this part in de_web_plugin.cpp

These are the logs:

11:19:26:228 MyDebug 40 SensorNode 2 / Switch 2 <-- new debug added
11:19:26:228 SensorNode 2: Switch 2 added
11:19:26:228 0x000D6F00XXXXXXXX (Lightify Switch Mini) create binding for attribute reporting of cluster 0x0001 on endpoint 0x01
11:19:26:228 queue binding task for 0x000D6F00XXXXXXXX, cluster 0x0001
11:19:26:229 Update Sensor 0x000D6F00XXXXXXXX Basic Cluster
11:19:26:229 MyDebug apsdeDataIndication profileId:0x0104, cid:0x0000

One last thing.. The middle button event seems to take longer to appear/update on the API than the other two buttons. Do you know why that might be? I disabled the 'suprise' button mapping to test but it didn't make it any quicker.

@olicooper
Copy link
Contributor

We might be close to having these devices supported in the API (not Phoscon yet) 🤞 ..
Related: #294 | #1893 | #2082

@Smanar
Copy link
Collaborator

Smanar commented Jun 9, 2020

No you are right, and I have checked on other project it s 0x20 for sure.

We don't make

srcEndpoints.push_back(sensor->fingerPrint().endpoint

But we make

 srcEndpoints.push_back(0x01);
  srcEndpoints.push_back(0x02);
  srcEndpoints.push_back(0x03);

so at final it's same.

For me the problem can come from
1 - A bad setting when configuring reporting

            rq.attributeId = 0x0020;   // battery voltage
            rq.minInterval = 3600;
            rq.maxInterval = 3600;
            rq.reportableChange8bit = 0;

you can try other values, on z2m they are using 300, 3600, 0. (reportableChange8bit = 0xFF for disabled)

2 - Or just the device don' use reporting but the pooling cluster, I have exactly same problem for legrand switch, it's the code you are using ^^

But this code work for legrand because this device make a device announce every time you press the button, not sure osram do same. With this code it's possible the value will be updated only 1 time.
And the reporting is working on z2M, so I realy don't see why It don't work.

For the middle button, have you take a look on log in same time, to see wich one action is delayed ? Its perhaps normal and coming from the hardware ?

@olicooper
Copy link
Contributor

olicooper commented Jun 10, 2020

Right, I messed around with the reporting attributes and can't explain why changing intervals sorted it, but I configured rq.minInterval = 900 and 15 minutes later I got a status update as expected.

12:22:15:637 Node data 0x000D6F00XXXXXXXX profileId: 0x0104, clusterId: 0x0001
12:22:15:637 0x000D6F00XXXXXXXX: update ZCL value 0x01/0x0001/0x0020 after 0 s
12:22:15:637 MyDebug apsdeDataIndication profileId:0x0104, cid:0x0001
12:22:15:637 MyDebug 1
12:22:15:637 MyDebug 2
12:22:15:637 MyDebug ZCL attribute report 0x000D6F00XXXXXXXX for cluster: 0x0001, ep: 0x01, frame control: 0x18, mfcode: 0x0000
12:22:15:637    MyDebug payload: 2000201c
12:22:15:637 MyDebug 3
12:22:15:637 MyDebug 5.3 mode: 1 ep: 0x01 cluster: 0x0001 cmd: 0x0A sPrevD: 0xFF
12:22:15:637 Force binding of attribute reporting for sensor Lightify Switch Mini
12:22:15:637 MyDebug 11
12:22:15:637 MyDebug 12
12:22:15:637 MyDebug 13 srcEndpointSize: 3, gidSize: 3
12:22:15:637 MyDebug 14 gid: 1

Maybe making the min interval shorter means we get a report before the device goes in to deep sleep? I'm not convinced it is fixed so I'm going to test again to ensure it wasn't accidental etc.

What do you think is in this payload? MyDebug payload: 2000201c It must be some battery related statistics right?

Update:
From the related links below people have had batteries draining quickly from the min interval set at 300 so I'm going to increase it again and see if it still works okay, then call it a day probably cus this has dragged on for a long while now! 🤣

Related links:

@Smanar
Copy link
Collaborator

Smanar commented Jun 10, 2020

Ha, you have cleaned the code ?
I don't find your "MyDebug payload: 2000201c" ? But I have checked the code and no, I think the part you have find this code is realy just for attribute reporting command, there is no values inside.

@olicooper
Copy link
Contributor

olicooper commented Jun 10, 2020

I've started a pull request...
#2917

I had to create a new fork because the master branch was a mess and GitHub still don't allow multiple forks... my old forked-repo is still there as a mirror though.

I'm currently testing that pull request so should be done soon. I can create another PR if there are bugs found but I don't think there are. Let me know if there is anything wrong etc. and I'll fix it 👍

Ideally I would have the double press working too but its probably not going to be easy so I think its better if this is added later too.

@Smanar
Copy link
Collaborator

Smanar commented Jun 10, 2020

Yep, it s better ^^, because so much tries.

I think it will be ok for the 3 buttons remote.
But not sure for the 4 buttons, this device have 6 endpoints.

And I think it can be usefull to bind only the usefull cluster for exemple only the 0008 and 0006 or only the 0300. Because without that it can make 3 * 6 = 18 binds.

But you are right, even not perfect, the PR will be usefull, at least for some returns.

@olicooper
Copy link
Contributor

olicooper commented Jun 10, 2020

I had a look at the binds for the 4 button and one of them is on the comissioning cluster 0x1000 which we disabled so I think it's 5 binds total, but I can't see how there are more than 4 endpoints when there is only 4 buttons? I was looking at this: https://pastebin.com/xdG3Mw0Z

And I think it can be usefull to bind only the usefull cluster

Yes, I think it would be better. zigbee2mqtt has this: Koenkk/zigbee-herdsman-converters@7756df8#diff-6c9a6acf22f90d1c6e524d9f3c5c1745R1347-R1353 Not sure how you do this though.

Also, the battery updates are working 👍

@Smanar
Copy link
Collaborator

Smanar commented Jun 10, 2020

IDK, perhaps they are not usefull, and I don't find the device on other project.
Better to wait for a beta tester with return, than spend time for nothing. Your code is enought for that, just need to wait for some logs.

And you are right, hard to that with the actual code, If I have time tommorow, I will try to make something without too much ugly hacks.

Happy for battery, because I haven't more idea for it :)

@olicooper
Copy link
Contributor

I'm considering making the battery updates every 43200 seconds (12 hours) because the battery is only a CR2450 so 1 update every hour is going to drain the battery still. How can we make a manual request to fetch the battery voltage when the deice first pairs with the gateway? Would I be okay adding this back in? olicooper/deconz-rest-plugin-old@1e05921#diff-c941fc017347f7109bf6036ba9505576L5666-L5677

@Smanar
Copy link
Collaborator

Smanar commented Jun 11, 2020

I m agree with you, make it every hour is useless.
But the notification can be used as "device life check", so it can have some reaction on deconz, just make test and choose the prefered one.

If you make code change on the branch you have make the PR, the modification will be used too on this github.

But I realy don't think it's something usefull, there is no devices that use that, because you just need some time to have the value, the device make lot of requests during inclusion, better to remove the useless one.

@Smanar
Copy link
Collaborator

Smanar commented Jun 11, 2020

BTW, I have started something.

Not sure it will be usefull, so it's just a prototype Smanar@8986adf

Not compiled/ Not tested, so don't spend too much time on it.

But with this code, you can choose the endpoint, the group and the cluster like in Z2M, and it s compatible with old code.

The return will be "false" so I think you will have an error message but the binding will work.
To cheat, you can use "ret = true;" juste after the fonction list.

@olicooper
Copy link
Contributor

I have tested your prototype code and its working. There were a few compile issues and I updated it a bit too so check out my latest commit for the changes. olicooper/deconz-rest-plugin-old@c525343

The first cluster binding task starts at 19:08:51:349 and the last one is at 19:09:29:396 which is around 30 seconds to completion.

This is the first binding task:

19:08:51:346 0x000D6F00XXXXXXXX (Lightify Switch Mini) create binding for attribute reporting of cluster 0x0001 on endpoint 0x01
19:08:51:346 queue binding task for 0x000D6F00XXXXXXXX, cluster 0x0001
...
19:08:51:349 0x000D6F00XXXXXXXX [Lightify Switch Mini] create binding (S) for client cluster 0x0006 on endpoint 0x01
19:08:51:349 queue binding task for 0x000D6F00XXXXXXXX, cluster 0x0006
19:08:51:349 0x000D6F00XXXXXXXX [Lightify Switch Mini] create binding (S) for client cluster 0x0008 on endpoint 0x01
19:08:51:349 queue binding task for 0x000D6F00XXXXXXXX, cluster 0x0008
19:08:51:349 0x000D6F00XXXXXXXX [Lightify Switch Mini] create binding (S) for client cluster 0x0006 on endpoint 0x02
19:08:51:349 queue binding task for 0x000D6F00XXXXXXXX, cluster 0x0006
19:08:51:349 0x000D6F00XXXXXXXX [Lightify Switch Mini] create binding (S) for client cluster 0x0008 on endpoint 0x02
19:08:51:349 queue binding task for 0x000D6F00XXXXXXXX, cluster 0x0008
19:08:51:349 0x000D6F00XXXXXXXX [Lightify Switch Mini] create binding (S) for client cluster 0x0300 on endpoint 0x03
19:08:51:349 queue binding task for 0x000D6F00XXXXXXXX , cluster 0x0300

Still no broadcasting with this new code and all bindings are still present so this solution will work 👍

checkSensorBindingsForClientClusters is called from a lot of places which makes it harder to modify. I don't think these changes should be part of the PR but it is a good thing to add in!

@Smanar
Copy link
Collaborator

Smanar commented Jun 12, 2020

I have already do an update since, but the last is not tested ^^.
With the next one if you don't set group, the binding will be done on the coordinator.
https://github.com/Smanar/deconz-rest-plugin/blob/osram/bindings.cpp

But on bad branch, will correct tommorow

And In my mind, I prefer remove the "return ret" on line 2576 (and all the code before. Like this the code can be compatible for old and new binding mode.

If you are using the new one srcEndpoints.size() will be = 0, so so all the "if loop" will be skipped and the code will continue normally at line 2768.
So futures modifications on code will be used too.

But like you idk if theses changes can be used in your PR, for me it's usefull for some other device, we realy miss a simple bind fonction.
It's not usefull for the 3 buttons, but perhaps for the 4 buttons, with it you can reduce the bind requests.

And I have set only the last bind able to change the ret value, it will work like before the modification, and I m not sure it will be usefull to check all command, it s just a binding list, if 1 succed, all other will do same.

@olicooper
Copy link
Contributor

So futures modifications on code will be used too.

Yes that's a good point, I will use your code for the next version. The reason I copied the code was to be 100% sure it wasn't going to execute anything else for the test. I knew it probably wouldn't though 😊

But like you idk if theses changes can be used in your PR, for me it's usefull for some other device, we realy miss a simple bind fonction.

I think we need to ask the main developers about it maybe? I would probably submit another PR with this added function, then update the code later on to use this so that it is all kept clean and separate. Maybe this won't work for the development of that other device you are working on though? It would be nice to speak directly with the main devs though, maybe they will add it straight in without a PR?

Happy to test it soon. Good work!

@Smanar
Copy link
Collaborator

Smanar commented Jun 13, 2020

Don't worry for that, my modification don't impact the rest of the deconz code.
For me it will depend on osram 4 button device, this code is not realy usefull for the 3 buttons, but if you need it for the 4 button, you can take it.

In the worst sistuation it's your device that will not work, no impact for others devices.

And the code just take 10/20 lines.

And PR take somes days to be validated, so hard to wait beetween 2 of them, it's for that you can see some PR used for 5/6devices or more.

@olicooper
Copy link
Contributor

Hi Smanar, I noticed one small issue when I bound a light to the button in the old UI, the center (0) button sets the color back to default but it doesn't make the light go to 100% like it should. I've added some new code to bind one of the missing button handlers and it works again but could you double check that this implementation is okay? olicooper/deconz-rest-plugin-old@7d2c24b
Thanks 👍

@Smanar
Copy link
Collaborator

Smanar commented Jun 14, 2020

Lol, don't worry, I trust you, you know the code for this device as good than me, and you have the device to make test and not me.

@stale
Copy link

stale bot commented Jul 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 5, 2020
@NicolasBoulanger
Copy link
Author

Thanks for your hard work ! 🎉

@7wells
Copy link

7wells commented Sep 19, 2020

Hello,

I have switched from the not-anymore-supported Osram Lightify gateway to Phoscon on Raspberry Pi 2 with RaspBee II from Dresden-Elektronik. As I was able to pair the grey and blue Osram SMART+ Switch Mini (AC0251 600NJ | x 1718 and AC0251 700NJ | x 1718), I thought I could put them to use as well. They appear (besides a normal-sized Osram SMART+ Switch) in Phoscon under switches. However, when I try to connect them in a group, they are not offered, i.e. do not appear in that selection screen at all; only the normal-sized switch is there. So it seems that Phoscon adds them as switches but cannot use them in groups to apply them to certain lights/plugs etc. for whatever reason.

Now do these mini switches work for you in Phoscon? How can you apply them to existing groups?

I have no experience yet with deconz and logs etc., so I do not yet know how I can provide some logs, but I am willing to learn. :)

Thanks for your kind help and hints!

@Smanar
Copy link
Collaborator

Smanar commented Sep 19, 2020

Hi, I don't think phoscon support thoses switches, for me the better is using third application.

@7wells
Copy link

7wells commented Sep 19, 2020

What is so different with the mini switch in comparison to the normal-sized switch?

If logs or sniffed traffic of the mini switch helps, I could try to provide such, but would need a little help how to accomplish this. I think that I have everything that is needed, except the knowledge how to start. ;)

@Smanar
Copy link
Collaborator

Smanar commented Sep 19, 2020

The problem is the API have nothing to see with phoscon.
Phoscon use the api like third app, Try to ask here https://github.com/dresden-elektronik/phoscon-app-beta

If your device is the 3 button device, this one use native zigbee command, so you can use group feature in the "old web app", it will be direct connexion, without using deconz/phoscon/API.

But I don't remember what will be the 3 used command with this remote (and you will be not able to change them)

@7wells
Copy link

7wells commented Sep 19, 2020

Thank you so much, I will look there. It is indeed the 3 buttons switch (available in different rubber colours). And I just now realise that my comments might be off-topic here, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants