Comme je te l'avais dit plus haut il faut installer "libgpiod" puis créer un script, depuis la nouvelle bibliothèque du PI, Domoticz ne la connait pas.
Donc après son installation il faut un script par exemple DzVentz :
Code : Tout sélectionner
return {
on = {
devices = {
'Carillon2', -- associé à GPIO 19
'Sirenes2', -- associé à GPIO 6
'Portail1' -- associé à GPIO 26
}
},
execute = function(domoticz, device)
local gpiochip = 'gpiochip0' -- ← puce GPIO détectée par la commande en Putty "gpiodetect # Liste les puces GPIO"
-- Association entre les noms Domoticz et les numéros GPIO
local gpioMap = {
Carillon2 = 19,
Sirenes2 = 6,
Portail1 = 26,
}
local gpio = gpioMap[device.name]
if gpio == nil then
domoticz.log('GPIO non défini pour ' .. device.name, domoticz.LOG_ERROR)
return
end
local value = (device.state == 'On') and 1 or 0
local cmd = string.format('/usr/bin/gpioset %s %d=%d', gpiochip, gpio, value)
domoticz.log('Commande GPIO : ' .. cmd, domoticz.LOG_INFO)
os.execute(cmd)
end
}
Actuellement en service chez moi et fonctionne parfaitement.
A+