Commentaires sur : Xiaomi switch et Domoticz https://domo.easter.fr/2017/07/28/xiaomi-switch-et-domoticz/ Home Automation Stuff Mon, 05 Feb 2018 09:52:36 +0000 hourly 1 https://wordpress.org/?v=6.9 Par : Jerome https://domo.easter.fr/2017/07/28/xiaomi-switch-et-domoticz/#comment-42 Mon, 05 Feb 2018 09:52:36 +0000 https://domo.easter.fr/?p=76#comment-42 Non, je vais retester.

Merci 🙂

]]>
Par : simon https://domo.easter.fr/2017/07/28/xiaomi-switch-et-domoticz/#comment-41 Mon, 05 Feb 2018 00:15:38 +0000 https://domo.easter.fr/?p=76#comment-41 En réponse à Jerome.

As tu bien définis le script comme étant de type lua -> Device ?
Dans la partie en haut à droite de l’éditeur de script.

]]>
Par : Jerome https://domo.easter.fr/2017/07/28/xiaomi-switch-et-domoticz/#comment-40 Sun, 04 Feb 2018 08:49:34 +0000 https://domo.easter.fr/?p=76#comment-40 Bonjour,

j’ai essayé de rependre ton script (je n’y connais rien) pour allumer et éteindre une ampoule Yeelight avec un switch Aqara.
Seul hic, il ne se passe rien quand je click. ai je fait une erreur ?
Voici le code :

— Bouton physique lumière couloir

commandArray = {}

— Allumer couloir

if (devicechanged[‘Switch_couloir_haut’] == ‘Click’ and otherdevices[‘YeeLight_couloir_haut’] == ‘Off’) then
print(“Allumage couloir haut par bouton physique”)
commandArray[‘Switch_couloir_haut’]=’Off’
commandArray[1]={[‘YeeLight_couloir_haut’]=’On’}
end

if (devicechanged[‘Switch_couloir_haut’] == ‘Click’ and otherdevices[‘YeeLight_couloir_haut’] == ‘On’) then
print(“Extinction couloir haut par bouton physique”)
commandArray[‘Switch_couloir_haut’]=’Off’
commandArray[1]={[‘YeeLight_couloir_haut’]=’Off’}
end

return commandArray

]]>
Par : simon https://domo.easter.fr/2017/07/28/xiaomi-switch-et-domoticz/#comment-17 Tue, 12 Dec 2017 15:09:57 +0000 https://domo.easter.fr/?p=76#comment-17 En réponse à tomaprice.

Merci pour ton script ! 🙂

]]>
Par : tomaprice https://domo.easter.fr/2017/07/28/xiaomi-switch-et-domoticz/#comment-16 Tue, 12 Dec 2017 13:49:46 +0000 https://domo.easter.fr/?p=76#comment-16 Merci pour ce script qui m’a permis de gérer mon bouton rond xiaomi et l’état ON/OFF avec le click tout en gardant le double click pour une autre action.
Je partage le script retouché :
— Bouton physique d’activation de l’alarme

commandArray = {}

— Alarme totale

if (devicechanged[‘Xiaomi_Bouton’] == ‘Click’ and otherdevices[‘Alarme_out’] == ‘Off’) then
print(« Activation alarme out par bouton physique »)
commandArray[‘Xiaomi_Bouton’]=’Off’
commandArray[1]={[‘Alarme_out’]=’On’}
end

if (devicechanged[‘Xiaomi_Bouton’] == ‘Click’ and otherdevices[‘Alarme_out’] == ‘On’) then
print(« Désactivation alarme out par bouton physique »)
commandArray[‘Xiaomi_Bouton’]=’Off’
commandArray[1]={[‘Alarme_out’]=’Off’}
end

if (devicechanged[‘Xiaomi_Bouton’] == ‘Click’ and otherdevices[‘Alarme_in’] == ‘On’) then
print(« Désactivation alarme out par bouton physique »)
commandArray[‘Xiaomi_Bouton’]=’Off’
commandArray[1]={[‘Alarme_out’]=’On’}
commandArray[2]={[‘Alarme_in’]=’Off’}
end

— Alarme partielle

if (devicechanged[‘Xiaomi_Bouton’] == ‘Double Click’ and otherdevices[‘Alarme_in’] == ‘Off’) then
print(« Activation alarme in par bouton physique »)
commandArray[‘Xiaomi_Bouton’]=’Off’
commandArray[1]={[‘Alarme_in’]=’On’}
end

if (devicechanged[‘Xiaomi_Bouton’] == ‘Double Click’ and otherdevices[‘Alarme_in’] == ‘On’) then
print(« Activation alarme in par bouton physique »)
commandArray[‘Xiaomi_Bouton’]=’Off’
commandArray[1]={[‘Alarme_in’]=’Off’}
end

if (devicechanged[‘Xiaomi_Bouton’] == ‘Double Click’ and otherdevices[‘Alarme_out’] == ‘On’) then
print(« Activation alarme in par bouton physique »)
commandArray[‘Xiaomi_Bouton’]=’Off’
commandArray[1]={[‘Alarme_in’]=’On’}
commandArray[2]={[‘Alarme_out’]=’Off’}
end

return commandArray

]]>