Wemos thermostat, tasmota.

For heating/cooling related questions in Domoticz

Moderator: leecollings

Post Reply
User avatar
frank666
Posts: 17
Joined: Monday 07 December 2020 10:11
Target OS: Linux
Domoticz version: 2024.7
Location: San Marino

Wemos thermostat, tasmota.

Post 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.
Domoticz running on Docker,Orange Pi Zero Plus
kimot
Posts: 104
Joined: Saturday 25 November 2017 17:18
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Czech Rep.
Contact:

Re: Wemos thermostat, tasmota.

Post 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 695 times
RPi2 Domoticz v 4.10717
10 x Sonoff Basic - ESPeasy
1 x Wemos D1 - ESPeasy
1 x Shelly Plus Plug S
1 x Sonoff S26 - ESPeasy
1 x Shelly 1
1 x MySensors HC-SR04
1 x MySenosrs wifi gateway
1 x RFLink
4x Cam IPC-T240H
User avatar
frank666
Posts: 17
Joined: Monday 07 December 2020 10:11
Target OS: Linux
Domoticz version: 2024.7
Location: San Marino

Re: Wemos thermostat, tasmota.

Post 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?
Domoticz running on Docker,Orange Pi Zero Plus
User avatar
frank666
Posts: 17
Joined: Monday 07 December 2020 10:11
Target OS: Linux
Domoticz version: 2024.7
Location: San Marino

Re: Wemos thermostat, tasmota.

Post 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
Domoticz running on Docker,Orange Pi Zero Plus
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests