Je partage mon script de thermostat simple avec interrupteur pour activer ou désactiver.
Je laisse l'entête du créateur du script car c'est basé de ce script.
A vous d'adapter le niveau de l'interrupteur du chauffage ( Pilote ou On/Off ) :
Il faut préalablement créer un interrupteur virtuel On/Off pour activer ou désactiver le thermostat , et éventuellement un interrupteur de type "Consigne de thermostat".
-- Alexandre DUBOIS - 2014
-- This script allows to maintain the temperatue between 19°C et 21°C when virtual
-- 'Thermostat salon' is ON.
--------------------------------
------ Start of edit section ------
--------------------------------
local consigne = 'Thermostat Salon' -- Température de thermostat
local hysteresis = 0.5 --Valeur seuil pour éviter que le relai ne cesse de commuter dans les 2 sens
local sonde = 'Home : Salon' --Nom de la sonde de température
local thermostat = 'Interrupteur Thermostat Salon' --Nom de l'interrupteur virtuel du thermostat
local radiateur = 'Chauffage Salon' --Nom du radiateur à allumer/éteindre
--------------------------------
-- End of edit section --
--------------------------------
local temp_consign = tonumber(otherdevices_svalues[consigne])
commandArray = {}
--Oregon sensor 'Salon' send temperature every 40s. This will be the execution frequency of this script.
if (devicechanged[sonde]) then
local temperature = devicechanged[string.format('%s_Temperature', sonde)] --Temperature relevée dans le salon
--On n'agit que si le "Thermostat" est actif
if (otherdevices[thermostat]=='On') then
print('-- Gestion du thermostat pour le salon --')
if (temperature < (temp_consign - hysteresis) ) then
print('Allumage du chauffage dans le salon')
commandArray[radiateur]='Set Level 30'
elseif (temperature > (temp_consign + hysteresis)) then
print('Extinction du chauffage dans le salon')
commandArray[radiateur]='Off'
end
end
end
return commandArray
commandArray = {}
if (devicechanged[sonde]) then
local temperature = devicechanged[string.format('%s_Temperature', sonde)]
-- là tu fais fonctionner ton script à chaque fois que la valeur change. Est ce qu'on s'en fiche pas un peu si le thermostat est sur Off ?
if (otherdevices[thermostat]=='On') then
print('-- Gestion du thermostat pour le salon --')
if (temperature < (temp_consign - hysteresis) ) then
print('Allumage du chauffage dans le salon')
commandArray[radiateur]='Set Level 30'
elseif (temperature > (temp_consign + hysteresis)) then
print('Extinction du chauffage dans le salon')
commandArray[radiateur]='Off'
end
end
end
return commandArray
commandArray = {}
if (devicechanged[sonde]) and otherdevices[thermostat]=='On' then
local temperature = devicechanged[string.format('%s_Temperature', sonde)]
print('-- Gestion du thermostat pour le salon --')
if (temperature < (temp_consign - hysteresis) ) then
print('Allumage du chauffage dans le salon')
commandArray[radiateur]='Set Level 30'
elseif (temperature > (temp_consign + hysteresis))
print('Extinction du chauffage dans le salon')
commandArray[radiateur]='Off'
end
end
return commandArray
Rpi3 Domoticz v3.9389 - RFX433e - Kira128
Odroid C2/OpenPHT/ Pour le salon
Rpi3/Rasplex/ Pour la chambre
Rpi2/Runeaudio/ Pour le salon + terrasse
Rpi2 hifiberry AMP+/Runeaudio/ pour la sdb
commandArray = {}
if (devicechanged[sonde]) then
local temperature = devicechanged[string.format('%s_Temperature', sonde)]
-- là tu fais fonctionner ton script à chaque fois que la valeur change. Est ce qu'on s'en fiche pas un peu si le thermostat est sur Off ?
if (otherdevices[thermostat]=='On') then
print('-- Gestion du thermostat pour le salon --')
if (temperature < (temp_consign - hysteresis) ) then
print('Allumage du chauffage dans le salon')
commandArray[radiateur]='Set Level 30'
elseif (temperature > (temp_consign + hysteresis)) then
print('Extinction du chauffage dans le salon')
commandArray[radiateur]='Off'
end
end
end
return commandArray
commandArray = {}
if (devicechanged[sonde]) and otherdevices[thermostat]=='On' then
local temperature = devicechanged[string.format('%s_Temperature', sonde)]
print('-- Gestion du thermostat pour le salon --')
if (temperature < (temp_consign - hysteresis) ) then
print('Allumage du chauffage dans le salon')
commandArray[radiateur]='Set Level 30'
elseif (temperature > (temp_consign + hysteresis))
print('Extinction du chauffage dans le salon')
commandArray[radiateur]='Off'
end
end
return commandArray
Pas faux , ca fais tourner le script même si l'interrupteur est en OFF !