-
Notifications
You must be signed in to change notification settings - Fork 59
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
Support de la télécommande ikea Tradfri #64
Comments
A ce que j'ai compris, la télécommande Ikea ne diffuse pas son status alors que par exemple le bouton aqara si. Dans tes articles, j'ai vu que en mode "sniffing", tu peut voir passer les trames entre la télécommande et l'ampoule. Donc au niveau du hardware, on pourrait bien détécter le "clic". Pourquoi ne pas laisser cette possibilité au niveau du firmware "normal" je voir toutes les trames ? |
J'ai un autre souci plus ou moins lié, je ne sais pas trop |
La telecommande Ikea envoie ses messages sur une adresse groupe. La Zigate recoit bien ce message mais ne le transmet pas. Actuellement pas de solution "simple" possible. |
Si effectivement la zigate voit les messages "passés", peut-être faudrait-il implémenter un nouveau type de réponse afin qu'une application tierce puisse exploiter ces messages, même si les messages sont destinés à un autre équipement. Par exemple un message type 0x9000 "routed message" avec en paramètre
Un peu comme si on pouvait faire du "sniffing" à tout moment |
Ne semble pas simple dans la mesure ou cette partie est dans les librairies NXP, donc pas accessible facilement. Une autre piste serait d'ajouter la zigate au groupe (comme une ampoule), je n'ai pas encore eu le temps de regarder plus avant cette solution. |
J'avais pensé à ça aussi mais je n'ai pas de télécommande pour essayer |
Salut à tous, Je confirme que la partie qui ignore le paquet envoyé par la télécommande se situe dans une librairie compilé (lib qui gère le protocole bas niveau). Les télécommandes qui respectent la norme fonctionnent toutes de la même manière. Seul Xiaomi, à ma connaissance, utilise les télécommandes (ou plutôt interrupteur) comme actionneur. Si vous avez d'autres idées je suis preneur ... |
I managed to get some progress to this problem. You can add ZiGate to group or at least I managed to do this twice. Currently using latest source code from github built with debug on and doudz/zigate python library. Hardware wise Trådfri 980lm e27 bulb and 5 button remote both using latest firmware,
After that it is possible to see debug message every time remote send command. Only color temperature command is manufacturer specific. I added function to ZiGate to enable manufacturer specific commands for remote. It shows that color temperature command is for scenes cluster. I haven't yet have time to investigate is it possible to figure which buttons is pressed. After that it might be possible to catch remote press and give user information. Also there is no way to change scenes or groups on remote because it wont have input cluster for those clusters. If we could get remote paired to ZiGate using touchlink we could probably capture remote button presses without remote sending commands to devices also, |
Sorry, but how could you add ZiGate to the group ? |
No, I didn't use ZWGUI. I used python library(https://github.com/doudz/zigate). I don't use ZWGUI at all. It is good source(especially source code which is easy to read) for looking commands and what parameters are needed, but other than that it feels buggy. |
Ok, I use ZWGUI only to tests some commands too. it's usefull... but could you share your command to group the ZiGate or the parameters you used because as I said, I have never succeeded to add a ZiGate to a group. |
This is how I do it with python. Included couple debug messages so you can see what commands are sent # Start library
import logging
logging.basicConfig()
logging.root.setLevel(logging.DEBUG)
import zigate
z = zigate.connect(port=None)
# Permit joining for 60 seconds
>> z.permit_join(60)
# From debug messages find bulb short address. Mine was this time 35e6
>> z.get_group_membership('35e6', 0x01)
DEBUG:zigate:Msg to send b'00620006b50235e6010100'
DEBUG:zigate:Encoded Msg to send b'0102106202100216b5021235e602110211021003'
# Check group
>> z.groups
{'3880': {('35e6', 1)}}
# Add ZiGate to group
>> z.add_group('0000', 0x01, '3880')
DEBUG:zigate:Msg to send b'00600007dd02000001013880'
DEBUG:zigate:Encoded Msg to send b'0102106002100217dd02120210021002110211388003' Requesting groups from ZiGate (address 0000) will crash ZiGate. |
Just a naive comment, it is showing progress, but adding the Zigate controller to the group is so far not bringing any features rather than just seen debug messages . Correct ? As indeed , the remote can manage group and the Zigate can manage the same group too |
Yes, at the moment ZiGate is only able to see commands sent to group. There is possibility to add functionality to convert those commands to button presses which could be directed to user. ZiGate can manage group without being member of group. Only good way that I can see would be ability to pair and touchlink remote just to ZiGate so user could rewrite all button presses on ZiGate end. |
Ok, I just tested and ZiGate intercept messages from remote controller. I don't know if It's a good things (concerning the norm) but It's works ! This solution is a kind of hack because the coordinator is not a device and mix roles is hassle. I will think about it and I'll see how to give this enhancement without make damages. Concerning touchlink, It's the same, normally it's for device or router... I'll see how It's the best compromise and I'll inform to you. Great thanks @ISO-B |
Yop, I updated some files in SDK and source code in branch 3.0f. |
I watched couple of Ikea gateway and Phillips hub videos and it seems that both are able to handle touchlink pairing. Also read somewhere that coordinator should be able to handle touchlink. So I think that we should try that too. |
I don't know, it's weird because for me it is necessary that the initiator of the touchlink is within 50 cm of the object so even if the ZiGate is able to do a touchlink, it doesn't seem to me very useful. |
If I understand correctly ZiGate should work as client(initiator) for remotes. When remotes touchlink lights those should join to same network with ZiGate and remote. Not sure though is there any benefit using touchlink over regular pairing. Have anyone any experience of using Ikea or hue hubs with touchlink? |
Made little bit more research about this. To achieve programmable buttons from ikea remote will prevent remote working without ZiGate and library. This process is mostly done with library not with ZiGate firmware. PairingFirst thing is to get ZiGate and remote paired. I am not actually sure is touchlink between remote and ZiGate needed. If remote tells group address to ZiGate while touchlinking, it would be awesome to have touchlink. If remote wont tell group straight to ZiGate it's possible to get it from bulbs. After that it is time to pair bulb to ZiGate and remote. This could be possible to do just using remote touchlink. It should add bulb to ZiGate's network. If it is not possible then pair bulb to ZiGate first and after that touchlink bulb with remote. LibraryWhen everything is set up it's time to use ZiGate library of your choice.
FirmwareOnly thing that is needed firmware wise is way to pass commands(or decoded button presses) from remote to user library. Rest functionality is handled with library. ConclusionThis is only way that I could figure how to get it work. It feels bit hacky, but if you don't want to use it don't add ZiGate to same group with remote and you don't get extra messages for your library. Without removing group from bulbs your remote works as before. This can already be done since fairecasoimeme added functionality to intercept pushed buttons from remote using group on ZiGate. Things to figureThings that still need more research are:
Does this all sound logical or stupid? |
Bonjour, Outlet Ikea <-> zigate (pour avoir le status et l'allumer) (appareillage classique) Ikea remote <-> outlet (pour contrôler la prise) 1/ Si je fais ça, j'arrive a voir le statut de la prise et la contrôler via zigate ET le bouton ? 2/ si oui, dans quel cas il est utile d'avoir les "ordres" du bouton vu qu'on a le résultat (prise allumé ou éteinte" ? Merci |
I am not completely sure that I understand what you are asking since I don't speak french.
If it is now possible to pair ZiGate with both remote and outlet and you can already use remote to control outlet then you should get outlet new status from outlet when remote changes it. Only reason that I can imagine where you could need to get remote button presses is if you would like to use ikea outlet and other manufacturer outlet(unless it can be paired with ikea remote) and get them to switch state at the same time. If it's not that time sensitive you could just change other outlet to same state after receiving ikea outlet state. Hopefully I answered questions that you asked 😄 |
@fairecasoimeme tested 3.0f branch with bulb and remote and messages work fine. Only problem that I noticed is that if ZiGate thinks that light is turned off then lower brightness button won't do nothing. It's probably something to do with enabling ONOFF server on ZiGate that it wont show commands when ONOFF is on OFF state. It might be best if we ignore requested action and just send command to user. |
Found solution for this. Going to make pull request later today. |
Great ! I wait your update to include in the 3.0f version |
Found fix to all of those. Haven't yet had time to test if it broke how ZiGate handles groups. Now responses come as they should and also no ffff groups are showing up. Will make PR after more testing. |
I found how to pair ikea remote control to oulet Ikea remote control talk only with 0x0000 group So, 1- pair remote and outlet with zigate And that's all I'll add the device (with explanations) to compatibility devices on zigate.fr https://zigate.fr/produit-telecommande-ikea-tradfri-compatible-zigate/ |
Is there a place where we could get a consolidated documentation for the IKEA Remote Pairing and the Group Management. From what I see with the 3.0f, they are now 2 'reserved' groups 0x0000 and 0xffff. Correct ? I see from the previous post how to pair the remote with an outlet, but how do you do with a Bulb. Am I missing something ? |
I assume that you tested using other groups as well?
You are partially correct. Both 0x0000 and 0xffff are invalid groups by Zigbee standard. You probably should be add those to any device that follows strictly Zigbee standard for group ids. For some reason Ikea has decided to use group 0x0000 with Outlet controller remote. So in this case I would say that it is 'reserved'. 0xffff group is what NXP has decided to use to reserve memory for groups.
I don't have that remote so I can't say for sure but I think this is how it will work. First you pair remote with ZiGate and after that add both remote and ZiGate to group 0x0000. Now you should be able to see which remote button is pressed. Pair bulb to ZiGate. Write program that handles incoming remote presses and sends commands to bulb. @KiwiHC16 I made PR #137 which should fix those group command |
@ISO-B Thanks for that. I'll try again and will try directly with ZGUI. But right now, no way to get the Remote with membership group 0x0000. Do I have to do something on the remote ? As this is a battery device and I'm not sure that is on Receive when Idle . Question: When adding Zigate to group 0x0000. I believe we use 0x0000 has the Network Adddress of the Zigate and 01 has the Endpoint with Address Mode 0x02, or should I use the IEEE addresse, or it doesn't matter ? BTW, the Xiaomi Plug has 0x0000 group membership by default. This might explain why Ikea does the same . |
Making progress I'm able to add 0x0000 to group 0x0000. However : I beleive this is related to the bug early reported. I'm going to handle that in the plugin code |
Stupid question. Cannot we make Zigate part of group 0x0000 by default ? |
I took better look for https://zigate.fr/produit-telecommande-ikea-tradfri-compatible-zigate/ and noticed that it doesn't have input cluster for Groups so we are not able to change its group unless it has hidden input input cluster for groups.. It however have ZLL: Commissioning cluster which can change devices group depending how it is implemented.
It won't receive when idle. 5 button remote receives commands if you press button before and after sending command. It really doesn't matter since there is not useful clusters to send commands. I don't know how @fairecasoimeme managed to add remote to group 0x0000 or is it already there.
It should not matter, but I personally use address mode 0x02, because short addresses are easier to remember and faster to write.
PR #137 should fix this.
Yes we could, but I would not do it. Not all users will need ZiGate to be in group 0x0000 and might need 5 groups for something else. They would have to remote it from group 0x0000. For me it is the best solution to leave group table empty by default and let user add groups they need. You can make your code to add ZiGate to group 0x0000 every time you start it. If it is already in group then you will just get response with group already exist status code. |
@ISO-B thanks. Maybe the version I got from Akila doesn't include this PR. That could explain |
Hi All, |
Decode80A7: SQN int8 |
I couldn't figure what those extra values are so I left them undecoded. uint8 u8Direction; |
@ISO-B thanks for such work, this is really moving Zigate ahead |
Very good, all working this morning !!! |
It does work, but still (with the early announcement version from @fairecasoimeme ), I do not get: 0x8060 when adding 0x0000 to a group When requesting for Group Membership to 0x0000 , I'm getting 5 times 0xffff and not the network address which Zigate belongs too. |
@KiwiHC16 Can you test with doudz python library? It should show left and right holds. If it doesn't then it is probably firmware related. @pipiche38 latest release on Github v3.0f_PR doesn't have that fix. You can build binary from my fork if you are in hurry. I think that fairecasoimeme will test my PR before accepting it. |
@ISO-B I do confirm that hold left/right works with the version I've got from Akila. The V3.0f I'm refering is one I got from Akila end of last week, and would tend to agree that your PR is not in, but must be in before a full release. |
@fairecasoimeme told me that he will look at the PR probably before releasing 3.0f. |
I put the remote to the Ikea GW and no upgrade was done. |
Currently doing some implementation test, and I have some difficulties to decode the Left/Right Release message on message 0x80A7 As command is concerned I receive 0x09 - Which is inline with your work @ISO-B Like the Direction and Unknown value could be more related to the Time of the hold rather than if it was left or right.As well this message seems coming several time |
I couldn't figure release message payload. I also tough time but values seemed to be all over place, like long press one time had big value and sometimes short. Release is always related to button that is last pressed, since you can only press on button. Maybe I need to switch release to use direction 2 so it would be unknown. |
Ok, so then we are on the same page ! |
Hi @fairecasoimeme, in your comment below in bold, I don't know how to pair the ikea remote with Zigate.
Using Test_GUI (ZGWUI), I put the Zigate in PermitJoin (Blue led blinking). Can you give some detail of how to pair the Ikea remote with the Zigate ? Thanks, |
Put ZiGate to permit join mode and press 4 times Ikea remote touch link button within 5 seconds or so. |
Should be closed, as this is fixed since 3.0f |
Bonjour
J'ai bien lu ton article
https://faire-ca-soi-meme.fr/test/2017/06/06/ikea-tradfri-zigbee-3-0-compatibilite-zigate/
Ce que je cherche à faire, ce n'est pas d'associer ma télécommande à une lampe, mais à associer la télécommande à ma zigate, pour ensuite binder les événements sur le broker pour lancer diverses actions.
Je n'arrive pas à associer la télécommande à la zigate / à recevoir des evenements
Lorsque je tiens le bouton appuyé 10 seconde,s rien coté zigate
Et si je fias un factory reset, j'arrive à avoir des choses
string(26) "zigate/device_changed/38b8"
string(128) "{"endpoints": [], "addr": "38b8", "info": {"addr": "38b8", "ieee": "d0cf5efffe05aa5d", "mac_capability": "10000000", "rssi": 3}}"
string(4) "XXXX"
string(26) "zigate/device_changed/38b8"
string(128) "{"endpoints": [], "addr": "38b8", "info": {"addr": "38b8", "ieee": "d0cf5efffe05aa5d", "mac_capability": "10000000", "rssi": 3}}"
Mais rien ensuite concernant les clics sur les boutons
Est-ce quelque chose de possible ?
Merci
The text was updated successfully, but these errors were encountered: