Bonsoir,
Mon système Jeedom fonctionne depuis pas mal de temps, mais je n’en suis qu’un utilisateur lambda.
Ma sonnette étant en panne, j’ai vite fait acheter une version sans fil (de marque Semac, un truc à pas cher de chez Bricolage).
Bref, c’est du 433MHz, donc je pense que ça pourrait être intégré. Mais je n’y arrive pas.
Mon module RfxCOM est un 433E :
[2021-03-30 23:47:51][DEBUG] : Firmware version = 0x01
[2021-03-30 23:47:51][DEBUG] : RFXtrx433 operating at 433.92MHz
[2021-03-30 23:47:51][DEBUG] : Hardware major version = 0x01
[2021-03-30 23:47:51][DEBUG] : Hardware minor version = 0x03
Voici ce que j’ai fait pour le moment :
- Activation du protocol Undecoded
- Activation des logs en mode debug
- Je redémarre le Daemon, et je révifie les logs (j’ai un peu plus l’habitude de
tail -f /var/www/html/log/rfxcom | grep -B7 -A1 'No decoder found'
que de l’interface).
Donc au premier appuie (de mon test) sur la sonnette, je finis par trouver dans les logs :
[2021-03-30 23:08:09][DEBUG] : decodePacket START ---------------------------------------------------------------------------------
[2021-03-30 23:08:09][DEBUG] : Decode RAW : b'\x07\x03\x01\x0f\x17l\xbc\xa0'
[2021-03-30 23:08:09][DEBUG] : Decode : 0703010f176cbca0
[2021-03-30 23:08:09][DEBUG] : Test message: 0703010f176cbca0
[2021-03-30 23:08:09][DEBUG] : PacketType: 0x03
[2021-03-30 23:08:09][DEBUG] : Length: 8
[2021-03-30 23:08:09][DEBUG] : No decoder found
[2021-03-30 23:08:09][DEBUG] : decodePacket END ===================================================================================
[2021-03-30 23:08:09][DEBUG] : Message: 08030110191b2f2800
[2021-03-30 23:08:09][DEBUG] : decodePacket START ---------------------------------------------------------------------------------
[2021-03-30 23:08:09][DEBUG] : Decode RAW : b'\x08\x03\x01\x10\x19\x1b/(\x00'
[2021-03-30 23:08:09][DEBUG] : Decode : 08030110191b2f2800
[2021-03-30 23:08:09][DEBUG] : Test message: 08030110191b2f2800
[2021-03-30 23:08:09][DEBUG] : PacketType: 0x03
[2021-03-30 23:08:09][DEBUG] : Length: 9
[2021-03-30 23:08:09][DEBUG] : No decoder found
[2021-03-30 23:08:09][DEBUG] : decodePacket END ===================================================================================
Visiblement tout ce qui concerne le RFxCOM se situe dans ce répertoire : /var/www/html/plugins/rfxcom/
J’ai donc updaté le code de /var/www/html/plugins/rfxcom/resources/rfxcomd/rfxcomd.py
pour avoir des séparateur pour pouvoir suivre les trames.
Quelques appuis plus tard j’obtiens :
[2021-03-30 23:10:44][DEBUG] : decodePacket START ---------------------------------------------------------------------------------
[2021-03-30 23:10:44][DEBUG] : Decode RAW : b"\x07\x03\x01'\x17l\xbc\xa0"
[2021-03-30 23:10:44][DEBUG] : Decode : 07030127176cbca0
[2021-03-30 23:10:44][DEBUG] : Test message: 07030127176cbca0
[2021-03-30 23:10:44][DEBUG] : PacketType: 0x03
[2021-03-30 23:10:44][DEBUG] : Length: 8
[2021-03-30 23:10:44][DEBUG] : No decoder found
[2021-03-30 23:10:44][DEBUG] : decodePacket END ===================================================================================
[2021-03-30 23:10:44][DEBUG] : Message: 08030128191b2f2800
[2021-03-30 23:10:44][DEBUG] : decodePacket START ---------------------------------------------------------------------------------
[2021-03-30 23:10:44][DEBUG] : Decode RAW : b'\x08\x03\x01(\x19\x1b/(\x00'
[2021-03-30 23:10:44][DEBUG] : Decode : 08030128191b2f2800
[2021-03-30 23:10:44][DEBUG] : Test message: 08030128191b2f2800
[2021-03-30 23:10:44][DEBUG] : PacketType: 0x03
[2021-03-30 23:10:44][DEBUG] : Length: 9
[2021-03-30 23:10:44][DEBUG] : No decoder found
[2021-03-30 23:10:44][DEBUG] : decodePacket END ===================================================================================
Et au 3ème, j’ai :
[2021-03-30 23:17:15][DEBUG] : Message: 0703016c176cbca0
[2021-03-30 23:17:15][DEBUG] : decodePacket START ---------------------------------------------------------------------------------
[2021-03-30 23:17:15][DEBUG] : Decode RAW : b'\x07\x03\x01l\x17l\xbc\xa0'
[2021-03-30 23:17:15][DEBUG] : Decode : 0703016c176cbca0
[2021-03-30 23:17:15][DEBUG] : Test message: 0703016c176cbca0
[2021-03-30 23:17:15][DEBUG] : PacketType: 0x03
[2021-03-30 23:17:15][DEBUG] : Length: 8
[2021-03-30 23:17:15][DEBUG] : No decoder found
[2021-03-30 23:17:15][DEBUG] : decodePacket END ===================================================================================
[2021-03-30 23:17:15][DEBUG] : Message: 0803016d191b2f2800
[2021-03-30 23:17:15][DEBUG] : decodePacket START ---------------------------------------------------------------------------------
[2021-03-30 23:17:15][DEBUG] : Decode RAW : b'\x08\x03\x01m\x19\x1b/(\x00'
[2021-03-30 23:17:15][DEBUG] : Decode : 0803016d191b2f2800
[2021-03-30 23:17:15][DEBUG] : Test message: 0803016d191b2f2800
[2021-03-30 23:17:15][DEBUG] : PacketType: 0x03
[2021-03-30 23:17:15][DEBUG] : Length: 9
[2021-03-30 23:17:15][DEBUG] : No decoder found
[2021-03-30 23:17:15][DEBUG] : decodePacket END ===================================================================================
C’est là où j’ai du mal à comprendre, la sonnette semble envoyer deux messages radio (mais pas tout le temps) :
[2021-03-30 23:21:58][DEBUG] : Decode : 07030193176cbca0
[2021-03-30 23:21:59][DEBUG] : Decode : 08030194191b2f2800
[2021-03-30 23:22:54][DEBUG] : Decode : 0803019c199b2f2800
[2021-03-30 23:22:54][DEBUG] : Decode : 0803019d191b2f2800
[2021-03-30 23:23:06][DEBUG] : Decode : 070301a1176cbca0
[2021-03-30 23:23:06][DEBUG] : Decode : 080301a2191b2f2800
[2021-03-30 23:23:13][DEBUG] : Decode : 080301a4191b2f2800
[2021-03-30 23:23:18][DEBUG] : Decode : 070301a5176cbca0
[2021-03-30 23:23:18][DEBUG] : Decode : 080301a6191b2f2800
[2021-03-30 23:23:23][DEBUG] : Decode : 070301a7176cbca0
[2021-03-30 23:23:23][DEBUG] : Decode : 080301a8191b2f2800
[2021-03-30 23:23:43][DEBUG] : Decode : 070301a9176cbca0
[2021-03-30 23:23:43][DEBUG] : Decode : 080301aa191b2f2800
[2021-03-30 23:23:51][DEBUG] : Decode : 070301af176cbca0
[2021-03-30 23:23:51][DEBUG] : Decode : 080301b0191b2f2800
[2021-03-30 23:23:58][DEBUG] : Decode : 070301b2176cbca0
[2021-03-30 23:23:58][DEBUG] : Decode : 080301b3191b2f2800
[2021-03-30 23:24:06][DEBUG] : Decode : 070301b4176cbca0
[2021-03-30 23:24:06][DEBUG] : Decode : 080301b5191b2f2800
[2021-03-30 23:24:13][DEBUG] : Decode : 070301b6176cbca0
[2021-03-30 23:24:13][DEBUG] : Decode : 080301b7191b2f2800
[2021-03-30 23:24:28][DEBUG] : Decode : 080301ba199b2f2800
En plus il semble y a voir une valeur tournante sur le 4ème byte. En mettant la liste du dessus dans un autre ordre :
[2021-03-30 23:21:58][DEBUG] : Decode : 07030193176cbca0
[2021-03-30 23:23:06][DEBUG] : Decode : 070301a1176cbca0
[2021-03-30 23:23:18][DEBUG] : Decode : 070301a5176cbca0
[2021-03-30 23:23:23][DEBUG] : Decode : 070301a7176cbca0
[2021-03-30 23:23:43][DEBUG] : Decode : 070301a9176cbca0
[2021-03-30 23:23:51][DEBUG] : Decode : 070301af176cbca0
[2021-03-30 23:23:58][DEBUG] : Decode : 070301b2176cbca0
[2021-03-30 23:24:06][DEBUG] : Decode : 070301b4176cbca0
[2021-03-30 23:24:13][DEBUG] : Decode : 070301b6176cbca0
[2021-03-30 23:21:59][DEBUG] : Decode : 08030194191b2f2800
[2021-03-30 23:22:54][DEBUG] : Decode : 0803019c199b2f2800
[2021-03-30 23:22:54][DEBUG] : Decode : 0803019d191b2f2800
[2021-03-30 23:23:06][DEBUG] : Decode : 080301a2191b2f2800
[2021-03-30 23:23:13][DEBUG] : Decode : 080301a4191b2f2800
[2021-03-30 23:23:18][DEBUG] : Decode : 080301a6191b2f2800
[2021-03-30 23:23:23][DEBUG] : Decode : 080301a8191b2f2800
[2021-03-30 23:23:43][DEBUG] : Decode : 080301aa191b2f2800
[2021-03-30 23:23:51][DEBUG] : Decode : 080301b0191b2f2800
[2021-03-30 23:23:58][DEBUG] : Decode : 080301b3191b2f2800
[2021-03-30 23:24:06][DEBUG] : Decode : 080301b5191b2f2800
[2021-03-30 23:24:13][DEBUG] : Decode : 080301b7191b2f2800
[2021-03-30 23:24:28][DEBUG] : Decode : 080301ba199b2f2800
Je ne sais pas à quoi elle sert cette valeur.
Comme on peut le voir, le message de 8 bytes arrive moins souvent que le 9 bytes. J’ai donc préféré partir sur celui là pour tester.
Je me suis dis qu’en adaptant l’existant, je devrais pouvoir arriver à quelque chose. Alors j’ai pris un des fichiers du répertoire /var/www/html/plugins/rfxcom/resources/rfxcomd/RfxPacket/
pour créer un 0x03.py
qui n’existait pas. Puis je l’ai déclaré dans le __init__.py
.
Le chmod
et le chown
qui vont bien. Et voilà ce que maintenant j’obtient :
[2021-04-01 22:46:33][DEBUG] : Message: 07030117176cbca0
[2021-04-01 22:46:33][DEBUG] : decodePacket START ---------------------------------------------------------------------------------
[2021-04-01 22:46:33][DEBUG] : Decode RAW : b'\x07\x03\x01\x17\x17l\xbc\xa0'
[2021-04-01 22:46:33][DEBUG] : Decode : 07030117176cbca0
[2021-04-01 22:46:33][DEBUG] : Test message: 07030117176cbca0
[2021-04-01 22:46:33][DEBUG] : PacketType: 0x03
[2021-04-01 22:46:33][DEBUG] : Length: 8
[2021-04-01 22:46:33][DEBUG] : Start decoding packet type 0x03
[2021-04-01 22:46:33][DEBUG] : Data : size 0x07
[2021-04-01 22:46:33][DEBUG] : Message: 08030118191b2f2800
[2021-04-01 22:46:33][DEBUG] : decodePacket START ---------------------------------------------------------------------------------
[2021-04-01 22:46:33][DEBUG] : Decode RAW : b'\x08\x03\x01\x18\x19\x1b/(\x00'
[2021-04-01 22:46:33][DEBUG] : Decode : 08030118191b2f2800
[2021-04-01 22:46:33][DEBUG] : Test message: 08030118191b2f2800
[2021-04-01 22:46:33][DEBUG] : PacketType: 0x03
[2021-04-01 22:46:33][DEBUG] : Length: 9
[2021-04-01 22:46:33][DEBUG] : Start decoding packet type 0x03
[2021-04-01 22:46:33][DEBUG] : Data : size 0x08
[2021-04-01 22:46:33][DEBUG] : Data 8 : size 0x08
[2021-04-01 22:46:33][DEBUG] : Subtype = Semac Group Normand 433.92MHz
[2021-04-01 22:46:33][DEBUG] : Data : {'packetlen': '0x08', 'packettype': '0x03', 'subtype': '0x01', 'seqnbr': '0x18', 'cmd1': '0x19', 'cmd2': '0x1B', 'cmd3': '0x2F', 'pulse': 40, 'filler': 0, 'rssi': 0}
[2021-04-01 22:46:33][DEBUG] : parse JUST BEFORE RETURN ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[2021-04-01 22:46:33][DEBUG] : Decoded info : {'packettype': '0x03', 'subtype': '0x01', 'id': '191B2F', 'pulse': 160, 'rssi': 0}
[2021-04-01 22:46:33][DEBUG] : unknown device id : 191B2F
A ce mement là de mes tests, j’ai un soucis car dès que j’inactive le undecoded
protocol, je n’ai plus rien dans les logs.
J’ai même tenté une inclusion, mais il ne se passe rien.
Quelqu’un a-t-il une idée de ce que j’ai oublié de faire ?
Merci.