Il vous faut :
1 sonoff dual R2 (important le R2)
1 interrupteur "Double poussoir" (moi j'ai prit du Lexman de chez Leroy)
1 boite d'enacastrement pour micro module genre https://www.domotique-store.fr/domotiqu ... 85500.html
Cabler la phase pour monter sur la sortie L2, celle pour descendre sur L1.
Relier le GND du port d'extension pour les boutons au commun des deux poussoirs et le bouton pour monter sur "Button0", celui pour descendre sur "Button1"
Flasher le sonoff avec la toute dernière version de ESPEASY branche MEGA (pas 2.0), et le configurer pour le wifi, activer les Rules dans les options.
Configurer le MQTT pour Domoticz.
Coté domoticz :
Créer :
1 Volet venitien
2 switchs type "Push On" avec Off Delay à 60s pour moi (selon votre volet), un pour monter un pour descendre.

Créer un script Blockly pour gérer l'interverouillage côté Domoticz

Ensuite tout se passe côté Easy ESP
Dans "Hardware"
Désactiver l'i2c. Configurer
GPIO0 : Input
GPIO9 : Input
GPIO12 : Output Low
GPIO5 : Output Low
Dans "Devices"

Créer 4 switchs (dont deux qui sont en réalité des sorties)
[*]BPM (pour monter) GPIO 0, Enabled, Pull up activé, Inverted activé, Normal Switch, décocher "Send to Controller"
[*]BPD (pour descendre) GPIO 9, Enabled, Pull up activé, Inverted activé, Normal Switch, décocher "Send to Controller"
[*]GPIO-5 (retour d'état sortie) GPIO 5, Enabled, Pull up désactivé, Inverted désactivé, Normal Switch, décocher "Send to Controller"
[*]GPIO-12 (retour d'état sortie) GPIO 12, Enabled, Pull up désactivé, Inverted désactivé, Normal Switch, décocher "Send to Controller"
Et créer deux sorties "MQTT helper"
[*]Name : Montée, Enabled, GPIO5, IDX celui de votre Domotics (89 pour moi)
[*]Name : Descendre, Enabled, GPIO12, IDX celui de votre Domotics (88 pour moi)
Et enfin dans Rules :
Code : Tout sélectionner
on BPM#Switch=1 do
if [GPIO-12#Switch]=1 OR [GPIO-5#Switch]=1
Publish domoticz/in, {"idx":87, "command":"switchlight", "switchcmd":"Stop"}
gpio,12,0
gpio,5,0
Delay 100
timerset,1,0
else
Publish domoticz/in, {"idx":87, "command":"switchlight", "switchcmd":"Off"}
gpio,12,0
Delay 500
gpio,5,1
timerset,1,60
endif
endon
on BPD#Switch=1 do
if [GPIO-12#Switch]=1 OR [GPIO-5#Switch]=1
Publish domoticz/in, {"idx":87, "command":"switchlight", "switchcmd":"Stop"}
gpio,12,0
gpio,5,0
Delay 100
timerset,1,0
else
Publish domoticz/in, {"idx":87, "command":"switchlight", "switchcmd":"On"}
gpio,5,0
Delay 500
gpio,12,1
timerset,1,60
endif
endon
on Rules#Timer=1 do
timerset,1,0
gpio,12,0
gpio,5,0
Delay 100
endon
Un appui sur monter ou descendre actionne pendant 60s, un appui sur n'importe lequel des deux pendant le mouvement (ou un appui sur stop dans Domoticz) stoppe le VR.
