Re: Thermostat sur Domoticz
Publié : 25 mars 2020, 08:40
Salut,
Ta sonde ne doit pas relever l'humidité.
Temp_only = température seulement
Ta sonde ne doit pas relever l'humidité.
Temp_only = température seulement
Reprenez le contrôle de votre domotique
https://easydomoticz.com/forum/
23.10;36.00;0
Code : Tout sélectionner
local temp_only = 'Température chambre Lihore'
local thermostat_setpoint = 'Test thermostat'
local heating_unit = 'Ventilateur Chauffage Lihore'
local hysteresis = 0.5
commandArray = {}
if devicechanged[temp_only] then
--for deviceName,deviceValue in pairs(otherdevices) do
--if (deviceName== thermostat_setpoint) then
print('temp_only:'..otherdevices[temp_only])
print('thermostat_setpoint:'..otherdevices[thermostat_setpoint])
if tonumber(deviceValue) < tonumber(otherdevices[temp_only]-hysteresis) then
if (otherdevices[heating_unit] == "On") then
--commandArray['SendNotification']='Heating is off'
commandArray[heating_unit]='Off'
print("Heating is Off")
end
elseif tonumber(deviceValue) > tonumber(otherdevices[temp_only]+hysteresis) then
if (otherdevices[heating_unit] == "Off") then
commandArray[heating_unit]='On'
--commandArray['SendNotification']='Heating is on'
print("Heating is On")
end
end
--end
end
return commandArrayCode : Tout sélectionner
local temp = 'Température chambre Lihore'
local thermostat_setpoint = 'Test thermostat'
local heating_unit = 'Ventilateur Chauffage Lihore'
local hysteresis = 0.5
commandArray = {}
if devicechanged[temp] then
print('temp:'..otherdevices_temperature[temp])
print('thermostat_setpoint:'..otherdevices_svalues[thermostat_setpoint])
if tonumber(otherdevices_svalues[thermostat_setpoint]) < tonumber(otherdevices_temperature[temp]-hysteresis) then
if (otherdevices[heating_unit] == "On") then
commandArray[heating_unit]='Off'
print("Heating is Off")
end
elseif tonumber(otherdevices_svalues[thermostat_setpoint]) > tonumber(otherdevices_temperature[temp]+hysteresis) then
if (otherdevices[heating_unit] == "Off") then
commandArray[heating_unit]='On'
print("Heating is On")
end
end
end
return commandArray
Ce n'est pas parce que la variable s'appelle temp_only qu'elle ne va remonter que la température, mais bien quelle ne doit remonter que la température.Cedric59 a écrit : 25 mars 2020, 13:05 @vil1driver vue comme cela tu as raison mais dans le code c'est déjà indiqué temp_onlyCode : Tout sélectionner
local temp_only = 'Température chambre Lihore'