Closed eserero closed 4 years ago
Ha nice thx ^^. I can make the modification myself, but better if you do it, like that changes will be assigned to you.
If you wana do that :
Go on beta branch (not the master), and try to edit a file, it will make a fork on your github.
Or you can make a fork direclty, but remember to use the beta branch.
Got it - just did - see if this make sense to you?
Yep, perfect ^^, Thx a lot, I have comment the PR, I have see it before your post here.
Just a think, there is so much button, idk how look the device in domoticz, but it will be not a good idea to use the combobox, instead of the button display ?
Thanks Smanar - agree with all your suggestions, also I just saw that I didn't remove my name, just put it there so I will remember what code sections I touched, so feel free to remove. the reason for so many buttons is that for each button you can possibly have single press, double press and long press. as you can see from the code many events are not yet working, but i'm monitoring the changes in deconz rest plugin, and when it is supported I will add the rest of the events.
Why remove your name ? IDK on your machine, but on mine, it's look like that
but if you wana use combo (Just need to change SelectorStyle in code)
IDK for you, but I think the combo will be more usefull ? Harder to use but better for GUI ?
Combo is better. on my machine I'm using machinon theme, so there is a scroller. in any case, this is a switch - whole purpose is to press physical buttons, so I never use the domoticz widget directly
Right, anyway you can't clic on button on domoticz, else you will have an error "this device don't support action".
I make change to use it as combo.
@eserero Hello, the Version 76 of deconz is just out, with better version for opple. If you can check/modify the plugin code with last deconz code ?
Ha Ha - you are fast :-). actually I have 5 switches waiting for this for a while. I will definitely do this - hopefully tomorrow.
Lol, yeap, so long time I m waiting for this version, so many bugs corrected.
hi @Smanar, I updated the file I have, and it is working now, but I saw that you did some changes in the beta branch related to the opple switch which changed the conversion function to a table. I am still using the conversion function and have the updated code. would you like to merge it yourself? note that the only thing that doesnt work is release after hold events, but I already implemented this so when this will start working in deconz then domoticz will work as well.
in plugin.py
kwarg['Options'] = {"LevelActions": "|||||||||||||||||||||||||||||", "LevelNames": "Off|B1|B2|B3|B4|B5|B6|B1L|B2L|B3L|B4L|B5L|B6L|B1RL|B2RL|B3RL|B4RL|B5RL|B6RL|B1D|B2D|B3D|B4D|B5D|B6D|B1T|B2T|B3T|B4T|B5T|B6T", "LevelOffHidden": "true", "SelectorStyle": "0"}
in fonction.py
if val == '1002' or val == 1002: kwarg['nValue'] = 10 elif val == '2002' or val == 2002: kwarg['nValue'] = 20 elif val == '3002' or val == 3002: kwarg['nValue'] = 30 elif val == '4002' or val == 4002: kwarg['nValue'] = 40 elif val == '5002' or val == 5002: kwarg['nValue'] = 50 elif val == '6002' or val == 6002: kwarg['nValue'] = 60 elif val == '1001' or val == 1001: kwarg['nValue'] = 70 elif val == '2001' or val == 2001: kwarg['nValue'] = 80 elif val == '3001' or val == 3001: kwarg['nValue'] = 90 elif val == '4001' or val == 4001: kwarg['nValue'] = 100 elif val == '5001' or val == 5001: kwarg['nValue'] = 110 elif val == '6001' or val == 6001: kwarg['nValue'] = 120 elif val == '1003' or val == 1003: kwarg['nValue'] = 130 elif val == '2003' or val == 2003: kwarg['nValue'] = 140 elif val == '3003' or val == 3003: kwarg['nValue'] = 150 elif val == '4003' or val == 4003: kwarg['nValue'] = 160 elif val == '5003' or val == 5003: kwarg['nValue'] = 170 elif val == '6003' or val == 6003: kwarg['nValue'] = 180 elif val == '1004' or val == 1004: kwarg['nValue'] = 190 elif val == '2004' or val == 2004: kwarg['nValue'] = 200 elif val == '3004' or val == 3004: kwarg['nValue'] = 210 elif val == '4004' or val == 4004: kwarg['nValue'] = 220 elif val == '5004' or val == 5004: kwarg['nValue'] = 230 elif val == '6004' or val == 6004: kwarg['nValue'] = 240 elif val == '1005' or val == 1005: kwarg['nValue'] = 250 elif val == '2005' or val == 2005: kwarg['nValue'] = 260 elif val == '3005' or val == 3005: kwarg['nValue'] = 270 elif val == '4005' or val == 4005: kwarg['nValue'] = 280 elif val == '5005' or val == 5005: kwarg['nValue'] = 290 elif val == '6005' or val == 6005: kwarg['nValue'] = 300 else: kwarg['nValue'] = 0
Ok so I have updated the code with your values, if you can make a try before I validate the code pls ?
For information I will use the same table for all opple switch (2 to 6 button).
Sure - I'll try it this evening and update.
just replaced the file and the switches are still working fine (tested all the buttons). didnt test creation of a new switch, but you didnt change that. I"ll probably do this in a couple of days.
No for the creation I have used your widget, I have just changed the condition to create this sensor using only the end of name instead of the full name, to make it compatible for all opple sensor (the end of the name is always the same).
So I think it's good, thx ^^
Hello, you haven't error like this one in log on your side ?
Error: (ConBee) Can't Update Unit >19 (sensors)
Hello - recent version of deconz (V2_05_73) introduce support in opple smart switches that have 3 variants (6 buttons, 4 buttons, 2 buttons). https://github.com/dresden-elektronik/deconz-rest-plugin/issues/2061
The support is not perfect, and they are working to improve, but single press is functional as well as long press on some of the buttons. I meddle a bit with the python code and added support for the 6 button switch (what I have) for whats there. dont know much about how to go about it in Git, so I just pasted the files with my changes. I marked sections I changed with "#eyal start" and "#eyal end". these are really great switches and cheap, so I hope it help someone and that you can included it in the official release.
fonctions.txt plugin.txt