Bonjour,
Je suis en train d’essayer d’intégrer au plugin blea l’interrupteur Schneider Wiser pour volet roulants, je reprends la suite de quelques messages postés sur le sujet suivant.
Voici l’interrupteur
Je souhaite équiper toute la maison de ces modules et je pensais avant l’achat qu’ils étaient compatible avec jeedom au travers du plugin Odace SFSP, je me rendu compte que ce n’était pas le cas car même gamme différente donc je me suis lancé pour voir leur intégration via le plugin blea.
J’ai pas mal avancé et je suis presque à la fin d’intégration fonctionnelle mais j’ai encore des problèmes de connexions / déconnexions bluetooth sur mon intégration, je suis preneur de tout aide pour terminer.
Je suis sur une box JeedUP avec jeedom 4.1, j’utilise le bluetooth intégré
Pour résumé :
- Sur ma box j’ai un problème de connexion lente et/ou qui échoue 1,2,3 fois puis un problème de déconnexion sauvage (par le thread du plugin)
- Lors de mes devs et tests depuis un script python sur un raspbery avec clef bluetooth je n’observe pas ces problèmes de bluetooth.
- Avant j’avais aussi des problèmes de « concurrent poll() invocation » après écriture sur registre gatt, j’ai résolu en mettant à jour la libraire bluepy sur la dernière version 1.3.0 (qui corrige des problèmes d’accès concurrents sur le write)
Le fichier de log complet
blea_local_forum.txt (78,3 Ko)
La partie problématique qui se connecte puis envoi la commande à l’interrupteur, ça fonctionne mais ça me semble instable, en plus d’autres fois la connexion met plusieurs dizaine de seconde voir minutes à se faire (sur 2, ou 3 ème tentative)
WiserShutter correspond à ma classe en pièce jointe
[2021-02-04 23:15:46.233][DEBUG] : Message read from socket: b'{"apikey":"fakekey","cmd":"action","device":{"id":"D0:CF:5E:0D:A7:D1"},"command":{"name":"wisershutter","action":"up","device":{"id":"D0:CF:5E:0D:A7:D1","delay":0,"needsrefresh":"0","name":"wisershutter"}}}'
[2021-02-04 23:15:46.234][DEBUG] : Client disconnected from [127.0.0.1:48366]
[2021-02-04 23:15:46.461][DEBUG] : SOCKET-READ------Message received in socket JEEDOM_SOCKET_MESSAGE
[2021-02-04 23:15:46.463][DEBUG] : SOCKET-READ------Received command from jeedom : action
[2021-02-04 23:15:46.463][DEBUG] : SOCKET-READ------Attempt an action on a device
[2021-02-04 23:15:46.466][DEBUG] : BeeWiSmartLite------manuf: name:wisershutter data:
[2021-02-04 23:15:46.466][DEBUG] : SOCKET-READ------Action Thread Launched
[2021-02-04 23:15:46.469][DEBUG] : WiserShutter--isValid()=true : name=wisershutter manuf= data= mac=
[2021-02-04 23:15:46.470][DEBUG] : WiserShutter--action(): {'apikey': 'fakekey', 'cmd': 'action', 'device': {'id': 'D0:CF:5E:0D:A7:D1', 'localname': 'wisershutter'}, 'command': {'name': 'wisershutter', 'action': 'up', 'device': {'id': 'D0:CF:5E:0D:A7:D1', 'delay': 0, 'needsrefresh': '0', 'name': 'wisershutter'}}}
[2021-02-04 23:15:46.471][DEBUG] : WiserShutter--sendCommand() : up on D0:CF:5E:0D:A7:D1
[2021-02-04 23:15:46.472][DEBUG] : UTILS------Creating a new connection for D0:CF:5E:0D:A7:D1
[2021-02-04 23:15:46.473][DEBUG] : CONNECTOR------Connecting : D0:CF:5E:0D:A7:D1 with bluetooth 0
[2021-02-04 23:15:47.035][DEBUG] : CONNECTOR------Failed to connect to peripheral D0:CF:5E:0D:A7:D1, addr type: public attempt 1
[2021-02-04 23:15:48.640][DEBUG] : CONNECTOR------Connected... D0:CF:5E:0D:A7:D1
[2021-02-04 23:15:48.641][DEBUG] : WiserShutter--sendCommand() : UP
[2021-02-04 23:15:48.642][DEBUG] : CONNECTOR------Writing Characteristic... D0:CF:5E:0D:A7:D1
[2021-02-04 23:15:48.708][DEBUG] : No name in data but i know it is : wisershutter
[2021-02-04 23:15:48.710][DEBUG] : BeeWiSmartLite------manuf: b602010020000b0200ff00090600000000000000000000000000 name:wisershutter data:
[2021-02-04 23:15:48.712][DEBUG] : WiserShutter--isValid()=true : name=wisershutter manuf=b602010020000b0200ff00090600000000000000000000000000 data= mac=d0:cf:5e:0d:a7:d1
[2021-02-04 23:15:48.713][DEBUG] : SCANNER------This is a wisershutter device d0:cf:5e:0d:a7:d1
[2021-02-04 23:15:48.714][DEBUG] : WiserShutter--parse() : name=wisershutter manuf=b602010020000b0200ff00090600000000000000000000000000 data= mac=d0:cf:5e:0d:a7:d1
[2021-02-04 23:15:48.714][DEBUG] : WiserShutter--parse() : operation=00 position=ff
[2021-02-04 23:15:48.715][DEBUG] : WiserShutter--parse() : {'status': 'closed', 'label': 'Fermé', 'position': 100, 'present': 1, 'id': 'd0:cf:5e:0d:a7:d1'}
[2021-02-04 23:15:48.715][DEBUG] : {'status': 'closed', 'label': 'Fermé', 'position': 100, 'present': 1, 'id': 'D0:CF:5E:0D:A7:D1', 'type': 'wisershutter', 'name': 'wisershutter', 'rssi': -81, 'source': 'local'}
[2021-02-04 23:15:48.763][DEBUG] : Send to jeedom : {'devices': {'D0:CF:5E:0D:A7:D1': {'status': 'closed', 'label': 'Fermé', 'position': 100, 'present': 1, 'id': 'D0:CF:5E:0D:A7:D1', 'type': 'wisershutter', 'name': 'wisershutter', 'rssi': -81, 'source': 'local'}}}
[2021-02-04 23:15:48.771][DEBUG] : Starting new HTTP connection (1): 127.0.0.1:80
[2021-02-04 23:15:48.801][DEBUG] : http://127.0.0.1:80 "POST /plugins/blea/core/php/jeeBlea.php?apikey=fakekey HTTP/1.1" 200 0
[2021-02-04 23:15:48.926][DEBUG] : HEARTBEAT------This antenna should not keep a connection with this device, disconnecting D0:CF:5E:0D:A7:D1
[2021-02-04 23:15:48.927][DEBUG] : CONNECTOR------Disconnecting... D0:CF:5E:0D:A7:D1
[2021-02-04 23:15:48.932][DEBUG] : CONNECTOR------'NoneType' object has no attribute 'poll' attempt 1
[2021-02-04 23:15:48.933][DEBUG] : Device disconnected
[2021-02-04 23:15:48.934][DEBUG] : CONNECTOR------Disconnected...D0:CF:5E:0D:A7:D1
[2021-02-04 23:15:48.934][DEBUG] : CONNECTOR------Retry connection D0:CF:5E:0D:A7:D1
[2021-02-04 23:15:48.935][DEBUG] : HEARTBEAT------Removed from keep connection list D0:CF:5E:0D:A7:D1
[2021-02-04 23:15:48.936][DEBUG] : CONNECTOR------Connecting : D0:CF:5E:0D:A7:D1 with bluetooth 0
[2021-02-04 23:15:48.964][DEBUG] : CONNECTOR------Connected... D0:CF:5E:0D:A7:D1
[2021-02-04 23:15:49.230][DEBUG] : No name in data but i know it is : wisershutter
[2021-02-04 23:15:49.232][DEBUG] : BeeWiSmartLite------manuf: b602010020000b0201ff00090400000000000000000000000000 name:wisershutter data:
[2021-02-04 23:15:49.234][DEBUG] : WiserShutter--isValid()=true : name=wisershutter manuf=b602010020000b0201ff00090400000000000000000000000000 data= mac=d0:cf:5e:0d:a7:d1
[2021-02-04 23:15:49.234][DEBUG] : SCANNER------This is a wisershutter device d0:cf:5e:0d:a7:d1
[2021-02-04 23:15:49.234][DEBUG] : WiserShutter--parse() : name=wisershutter manuf=b602010020000b0201ff00090400000000000000000000000000 data= mac=d0:cf:5e:0d:a7:d1
[2021-02-04 23:15:49.235][DEBUG] : WiserShutter--parse() : operation=01 position=ff
[2021-02-04 23:15:49.235][DEBUG] : WiserShutter--parse() : {'status': 'opening', 'label': 'Ouverture', 'position': 100, 'present': 1, 'id': 'd0:cf:5e:0d:a7:d1'}
[2021-02-04 23:15:49.236][DEBUG] : {'status': 'opening', 'label': 'Ouverture', 'position': 100, 'present': 1, 'id': 'D0:CF:5E:0D:A7:D1', 'type': 'wisershutter', 'name': 'wisershutter', 'rssi': -81, 'source': 'local'}
[2021-02-04 23:15:49.375][DEBUG] : CONNECTOR------Characteristic written... D0:CF:5E:0D:A7:D1
[2021-02-04 23:15:49.378][DEBUG] : {'rsp': ['wr']}
[2021-02-04 23:15:49.379][DEBUG] : WiserShutter--sendCommand() : action writed: True
[2021-02-04 23:15:49.508][DEBUG] : Send to jeedom : {'devices': {'D0:CF:5E:0D:A7:D1': {'status': 'opening', 'label': 'Ouverture', 'position': 100, 'present': 1, 'id': 'D0:CF:5E:0D:A7:D1', 'type': 'wisershutter', 'name': 'wisershutter', 'rssi': -81, 'source': 'local'}}}
[2021-02-04 23:15:49.516][DEBUG] : Starting new HTTP connection (1): 127.0.0.1:80
[2021-02-04 23:15:49.584][DEBUG] : http://127.0.0.1:80 "POST /plugins/blea/core/php/jeeBlea.php?apikey=fakekey HTTP/1.1" 200 0
[2021-02-04 23:15:50.295][DEBUG] : No name in data but i know it is : wisershutter
[2021-02-04 23:15:50.297][DEBUG] : BeeWiSmartLite------manuf: b602010020000b0201f900090400000000000000000000000000 name:wisershutter data:
[2021-02-04 23:15:50.298][DEBUG] : WiserShutter--isValid()=true : name=wisershutter manuf=b602010020000b0201f900090400000000000000000000000000 data= mac=d0:cf:5e:0d:a7:d1
[2021-02-04 23:15:50.298][DEBUG] : SCANNER------This is a wisershutter device d0:cf:5e:0d:a7:d1
[2021-02-04 23:15:50.299][DEBUG] : WiserShutter--parse() : name=wisershutter manuf=b602010020000b0201f900090400000000000000000000000000 data= mac=d0:cf:5e:0d:a7:d1
[2021-02-04 23:15:50.299][DEBUG] : WiserShutter--parse() : operation=01 position=f9
[2021-02-04 23:15:50.299][DEBUG] : WiserShutter--parse() : {'status': 'opening', 'label': 'Ouverture', 'position': 97, 'present': 1, 'id': 'd0:cf:5e:0d:a7:d1'}
La classe python en question, je n’utilise plus la partie notification depuis que j’ai décodé les trames advertisées qui contiennent aussi les infos qui m’intéresse.
wisershutter.txt (9,9 Ko)
La config json si besoin
wisershutter_json.txt (3,2 Ko)
J’ai une autre question sur comment gérer un paramétrage de l’interrupteur, en effet on doit régler le temps de course pour pouvoir gérer correctement le % d’ouverture / fermeture.
Est ce qu’il y a moyen d’avoir une config spécifique sur un device dans le plugin ?
J’ai ajouté une action + info avec un widget heureminute pour le gérer pour l’instant mais ça me semble inadapté.
Dans l’idéal il me faudrait une fenêtre de config comme en enocean, est ce possible via blea ?