Group thermostats

Moderator: leecollings

Post Reply
anasazi
Posts: 43
Joined: Saturday 06 August 2016 9:53
Target OS: Windows
Domoticz version:
Location: Sweden
Contact:

Group thermostats

Post by anasazi »

Hi,

Version: 3.8153
Platform: Windows Server 2012 R2
Hardware: Z-Stick gen 5

In my home I have 9 Danfoss LC-13 thermostats and 3 of them are in the same room.
I need your help to figure out how to group these 3 thermostat so that I only controll one (or a dummy) and the other 2 updates to the same setpoint.
My goal is to be able to change the setpoint both trough the webgui, ios app and on the thermostats itself.

I want to use Lua for this and I have tried some script but none is working the way I want.
I have tried to convert this script to Lua but I can not control it on the thermostats without creating a loop:

http://www.domoticz.com/forum/viewtopic ... om#p107929

Code: Select all

if($s['livingZ'] !=$RSetliving)
{
    lg('Danfoss livingZ was '.$s['livingZ'].',nieuw='.$RSetliving);
    ud($i['livingZ'], 0,$RSetliving,'RlivingZ',2000000);
}
if($s['livingZZ']!=$RSetliving)
{
    lg('Danfoss livingZZ was '.$s['livingZZ'].',nieuw='.$RSetliving);
    ud($i['livingZZ'],0,$RSetliving,'RlivingZZ',2000000);
}
if($s['livingZE']!=$RSetliving)
{
    lg('Danfoss livingZE was '.$s['kamerZ'].',nieuw='.$RSetliving);
    ud($i['livingZE'],0,$RSetliving,'RlivingZE',2000000);
}



And this script: viewtopic.php?f=6&t=4347&start=40

Code: Select all

sp1Name    = 'SP Bagni'     -- Nome set Point Virtuale
spR1       = 23                      -- Valvola Fisica 1
spR2       = 82                      -- Valvola Fisica 2
T1         = otherdevices[sp1Name]   -- Lettura Temperatura SetPoint Virtuale

commandArray = {}
   if devicechanged[sp1Name] then
      commandArray[#commandArray + 1] = {['UpdateDevice']=spR1..'|0|'..tostring(T1)}
      commandArray[#commandArray + 1] = {['UpdateDevice']=spR2..'|0|'..tostring(T1)}
   end
return commandArray

Has someone been able to group thermostat and control the setpoint from gui, ios and on the thermostat?
Any help with this would be appreciated...
Thanks!
User avatar
heggink
Posts: 977
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Group thermostats

Post by heggink »

Kind of. I had a challenge in that my nest thermostat wasn't as smart as Google envisaged. It switched on whenever it felt like it. What I did was to create a dummy thermostat with its own schedule. Whenever it changes, a script triggers the real thermostat to copy its settings. Also, when I return home, it sets the nest to the dummy temp. I think you can do something similar. I did run into some issues where the script would not trigger on the dummy change but dzvents and blockly works fine.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
anasazi
Posts: 43
Joined: Saturday 06 August 2016 9:53
Target OS: Windows
Domoticz version:
Location: Sweden
Contact:

Re: Group thermostats

Post by anasazi »

Hi,

Is it possible for you to share the code for dzvents and image of the Blockly code?

Thanks!
mivo
Posts: 80
Joined: Friday 21 April 2017 8:58
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Czechia
Contact:

Re: Group thermostats

Post by mivo »

Hi,

I am using this dzVents script for thermostats control by master virtual setpoint device:

Code: Select all

local LOGGING = true

local devicesSlave = { -- List of slave thermostat devices
    'setpoint 1',
    'setpoint 2'
}

return {
    active = true,
    on = {
        devices = {
            'Virtual Setpoint' -- Setpoint virtual master device
        }
    },
    execute = function(domoticz, device, triggerInfo)
  
        -- variables
        local newSetpoint = device.setPoint -- get new setpoint
    
        if LOGGING then
            -- debug logging
            domoticz.log('New Setpoint: ' .. newSetpoint)
        end
    
        -- iterate and change setpoint of devices in list 
        for idx, dev in pairs(devicesSlave) do
            -- assign device to variable 
            local deviceSet = domoticz.devices(dev)

            -- check if not already set
            if deviceSet.setPoint ~= newSetpoint then
                domoticz.log(dev .. ' setting to: ' .. tostring(newSetpoint))
                deviceSet.updateSetPoint(newSetpoint)
            else
                domoticz.log(dev .. ' already set: ' .. tostring(newSetpoint))
            end
        end
    
    end
}
My toys:
Raspberry Pi 3 + UPS PIco HV3.0 A Stack
Minibian (Raspbian Jessie) + Domoticz beta
RFLink 433 Gateway, 1wire DS18B20 temp sensors (GPIO)
RaZberry module + 2x Comet Z-Wave + Z-wave socket
---
Plugins: WeMo Switch, UPS PIco HV3.0A on GitHub
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest