Page 1 of 1

Wemos thermostat, tasmota.

Posted: Saturday 27 February 2021 14:54
by frank666
Good morning everyone,
I have a wemosD1mini with tasmota with thermostat function, is set by tasmota console with 6 temperatures during 6 periods of the day and works very well.
I ask, is there a way with domoticz to manage it graphically?
PS I tried to use the thermostat option already present in domotictz but it seems not to know the wemos device.

Re: Wemos thermostat, tasmota.

Posted: Thursday 04 March 2021 22:30
by kimot
I use Setpoint timer feature for sending scheduled value to my ESP thermostat:


2021-03-04-222559_1920x1080_scrot.png
2021-03-04-222559_1920x1080_scrot.png (166.39 KiB) Viewed 817 times

Re: Wemos thermostat, tasmota.

Posted: Tuesday 09 March 2021 15:22
by frank666
hi kimot ,
I didn't receive the notification from the forum, I'm replying now.
I ask you , did you use a script to make a virtual thermostat or did you directly configure an idx and a gpio on the wemos?

Re: Wemos thermostat, tasmota.

Posted: Saturday 13 March 2021 9:20
by frank666
using the setpoint function and the thermostat script, I noticed these two difficulties:
firstly, the timer function only allows you to refer to a temperature at sunrise or sunset and not to a time of day.
second, if there is a power failure or a restart of domoticz the temperature remains set to the last value and does not adjust until a new timer action .
How could you modify the script below, so that it always updates to the periods set by the timer?
Spoiler: show

Code: Select all

--
-- Domoticz passes information to scripts through a number of global tables
--
--
-- 
--
-- https://www.iot4.eu/wiki

local heating_probe = 'temperatura soggiorno' -- inserire il sensore di temperatura
local thermostat_setpoint = 'Thermo' --va creato un sensore dummy con il dispositivo thermo
local heating_unit = 'relè temperatura soggiorno'   -- inserire il dispositivo attuatore

-- Use when a combined sensor (e.g. temperature and humidity) is used
-- Replace in "otherdevices[heating_probe]" to "otherdevices[heating_probe]" by "temp_only" (in the 2nd "if" and in the "elseif".
-- Remove the -- in the next two lines: 

--local naartekst = (tostring (otherdevices[heating_probe]))
--local temp_only = (string.sub(naartekst,1,4)) -- the digits (1,4) do point out what characters of the string are needed.


local hysteresis = 0.1

commandArray = {}


-- loop through all the devices
for deviceName,deviceValue in pairs(otherdevices) do
    if (deviceName== thermostat_setpoint ) then

        if tonumber(deviceValue) < tonumber (otherdevices[heating_probe]-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[heating_probe]+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

-- loop through all the variables
for variableName,variableValue in pairs(uservariables) do

end

return commandArray