Switchbot et domoticz

Posez ici vos questions d'utilisation, de configuration de DomoticZ, de bugs, de conseils sur le logiciel lui même dans son utilisation et son paramétrage.
Des forums spécifiques sont ouverts ci-dessous pour regrouper les différents sujets.
Bond5410
Messages : 2
Inscription : 02 sept. 2020, 16:35

Switchbot et domoticz

Message par Bond5410 »

Bonjour je viens de faire une box domotique sous domoticz et je cherche donc a mettre mes équipements dessus j'ai un switchbot comme celui-ci https://urlz.fr/dJav et trois autres comme cela https://urlz.fr/dJax des idées ? j'ai trouver l'IP mais je n'ai pas les commandes pour le premier
Bond5410
Messages : 2
Inscription : 02 sept. 2020, 16:35

Re: Switchbot et domoticz

Message par Bond5410 »

Abbij
Messages : 63
Inscription : 28 oct. 2019, 08:06

Re: Switchbot et domoticz

Message par Abbij »

Bonjour

Je me permets de relancer le sujet
Avez-vous trouvé une solution?

D'avance merci ;)
psytgc
Messages : 95
Inscription : 30 juil. 2017, 12:10

Re: Switchbot et domoticz

Message par psytgc »

Bonsoir
je déterre un peu, mais j'ai réussi à actionner un switchbot en bluetooth à partir d'un orangepi
j'ai utilisé ce tuto :
https://github.com/OpenWonderLabs/pytho ... /README.md

Du coup j'aimerais incorporer un bouton interrupteur qui actionne ce switch dans domoticz.
Les commandes sudo python3 switchbot_py3.py -d F9:38:1F:6E:12:33 -c on et
sudo python3 switchbot_py3.py -d F9:38:1F:6E:12:33 -c off
fonctionnent en ssh , maintenant je ne sais pas comment les incorporer dans domoticz pour les exécuter sans erreur genre 32512.

Pouvez-vous m'aider?
Merci
psytgc
Messages : 95
Inscription : 30 juil. 2017, 12:10

Re: Switchbot et domoticz

Message par psytgc »

Bonsoir

Et bien merci chat GPT4

voici le script Lua qui fonctionne :

Code : Tout sélectionner

commandArray = {}

-- Define the device that will trigger the script
local switchbot_device = 'switchbot'

-- Define the Python command to execute
local switchbot_cmd = ''
if (devicechanged[switchbot_device] == 'On') then
    switchbot_cmd = 'python3 /home/orangepi/python-host/switchbot_py3.py -d F9:38:1F:6E:12:63 -c on'
elseif (devicechanged[switchbot_device] == 'Off') then
    switchbot_cmd = 'python3 /home/orangepi/python-host/switchbot_py3.py -d F9:38:1F:6E:12:63 -c off'
end

-- Execute the Python command if it's defined
if (switchbot_cmd ~= '') then
    os.execute(switchbot_cmd)
    print('SwitchBot command executed: ' .. switchbot_cmd)
end

return commandArray
remplacez switchbot par le nom de votre interrupteur et les chemins vers le script en.py

Vraiment trop fort ce chat GPT
Répondre