je viens de remplacer mon variateur de ventilation de ma cheminée pour un Wally dimmer FIBARO .
Je souhaite automatiser sa régulation avec domoticz: Je possède un détecteur de fumée +thermostat
FGSD-002 FIBARO placé à la sortie d'une bouche d'air.
j'essaie de faire évoluer le pourcentage de ventilation à chaque variation de température :De le démarrer à partir d'une certaine température et de l'arrêter lorsqu'il n'y a plus de chaleur à diffuser.
création d'un interrupteur virtuel OK :Ventilateur cheminee (action off :http://X.X.X.X:8080/json.htm?type=comma ... tchcmd=Off)
Mais voila :
1-Mon petit programme en lua se répète toutes les minutes alors que je souhaite qu'il s’exécute uniquement à l'évolution de la température. ?
2-Il semble qu'il ralentit domoticz :
2021-11-05 18:12:12.693 Status: EventSystem: Fetching URL http://192.168.10.152:8080/json.htm?typ ... el&level=5 after 0.2 seconds...
3- lorsque je lance la commande :
commandArray['OpenURL'] = 'http://X.X.X.X:8080/json.htm?type=comma ... el&level=5'
==> le widget du walli dimmer ne se met pas à jour.
j'ai fait beaucoup( trop) fais de test et modification ..et la je n'arrive plus à progresser .
Qui peut me donner un petit coup de main ...je vous remercie.
voici pour programme
Code : Tout sélectionner
----------------------------------------------------------------
-- PILOTAGE VENTILATION DE LA CHEMINEE
-- WALLI PLUG
-- DETECTEUR DE FUMEE + SONDE TEMPERATURE INTERNE
--
------------------------------------------------------------------
-- chargement des modules
dofile('/home/pi/domoticz/scripts/lua/modules.lua')
commandArray = {}
interrupteur = otherdevices['ventilateur cheminee']
print("interrupteur ="..interrupteur)
for deviceName,deviceValue in pairs(devicechanged) do
--print ("Device based event fired on '"..deviceName.."', value '"..tostring(deviceValue).."'");
if (deviceName=='Watt ventilateur') then
print("variable"..tostring(deviceValue).."'");
end
end
puissance = tostring(deviceValue)
--if (devicechanged['ventilateur cheminee'] == 'On' ) then
if interrupteur == 'On' then
puissance = otherdevices['Watt ventilateur']
temperature_cheminee = (otherdevices_svalues['cheminee'])
print("Donnee brute = "..temperature_cheminee)
print("ventilateur cheminée activée")
commandArray['Walli cheminee']='Set Level '.. puissance
print("puissance ventilateur = ".. puissance)
if ((tonumber(temperature_cheminee) < tonumber("20")) and (tonumber(puissance))~= 0) then
print("ventilateur cheminée déactivé")
commandArray['OpenURL'] = 'http://X.X.X.X:8080/json.htm?type=command¶m=switchlight&idx=310&switchcmd=Off'
end
if ((tonumber(temperature_cheminee) > tonumber("21")) and (tonumber(puissance))== 5)then
commandArray['OpenURL'] = 'http://X.X.X.X:8080/json.htm?type=command¶m=switchlight&idx=310&switchcmd=Set%20Level&level=5'
end
if (tonumber("26")<tonumber(temperature_cheminee) and tonumber(temperature_cheminee)>tonumber("30")and (tonumber(puissance))== 15) then
commandArray['OpenURL'] = 'http://X.X.X.X:8080/json.htm?type=command¶m=switchlight&idx=310&switchcmd=Set%20Level&level=15'
end
if (tonumber("31")<tonumber(temperature_cheminee) and tonumber(temperature_cheminee)>tonumber("35")and (tonumber(puissance))== 25) then
commandArray['OpenURL'] = 'http://X.X.X.X:8080/json.htm?type=command¶m=switchlight&idx=310&switchcmd=Set%20Level&level=25'
end
if (tonumber("36")<tonumber(temperature_cheminee) and tonumber(temperature_cheminee)>tonumber("40")and (tonumber(puissance))== 35) then
commandArray['OpenURL'] = 'http://X.X.X.X:8080/json.htm?type=command¶m=switchlight&idx=310&switchcmd=Set%20Level&level=35'
end
if (tonumber("41")<tonumber(temperature_cheminee) and tonumber(temperature_cheminee)>tonumber("45")and (tonumber(puissance))~= 45) then
commandArray['OpenURL'] = 'http://X.X.X.X:8080/json.htm?type=command¶m=switchlight&idx=310&switchcmd=Set%20Level&level=45'
end
------------POUR TEST ------
--if (tonumber("20")<tonumber(temperature_cheminee) and tonumber(temperature_cheminee)>tonumber("21")and (tonumber(puissance))~= 55) then
if (tonumber("17")<tonumber(temperature_cheminee)) and (tonumber(temperature_cheminee)<tonumber("21")and (tonumber(puissance))~= 10.2) then
--puissance = (otherdevices_svalues['Watt ventilateur'])
commandArray['Walli cheminee']='Set Level '.. puissance
commandArray['OpenURL'] = 'http://X.X.X.X:8080/json.htm?type=command¶m=switchlight&idx=310&switchcmd=Set%20Level&level=5'
end
if (tonumber("51")<tonumber(temperature_cheminee) and tonumber(temperature_cheminee)>tonumber("55")and (tonumber(puissance))== (tonumber("65"))) then
commandArray['OpenURL'] = 'http://X.X.X.X:8080/json.htm?type=command¶m=switchlight&idx=310&switchcmd=Set%20Level&level=65'
end
if (tonumber("56")<tonumber(temperature_cheminee) and tonumber(temperature_cheminee)>tonumber("60")and (tonumber(puissance))== 75) then
commandArray['OpenURL'] = 'http://X.X.X.X:8080/json.htm?type=command¶m=switchlight&idx=310&switchcmd=Set%20Level&level=75'
end
if(( tonumber(temperature_cheminee) > tonumber("61")) and (tonumber(puissance))>76) then
commandArray['OpenURL'] = 'http://X.X.X.X:8080/json.htm?type=command¶m=switchlight&idx=310&switchcmd=Set%20Level&level=95'
end
print('le variateur est à '..otherdevices_svalues['Watt ventilateur' ] .." %")
end
return commandArray