Smart thermostat change settting

Moderator: leecollings

Post Reply
User avatar
jacobsentertainment
Posts: 223
Joined: Thursday 01 October 2020 1:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Not @ home
Contact:

Smart thermostat change settting

Post by jacobsentertainment »

Hi all,

Is it possible to change the setting of the thermostat setting in blockly? lets say if switch "121" is on then set this to economy and if switch "121" is off then to normal again.
thermostat.jpg
thermostat.jpg (81.82 KiB) Viewed 391 times
If someone can give me a push how to get it done :D

Cheers!
HvdW
Posts: 617
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Smart thermostat change settting

Post by HvdW »

I would go for dzvents
Here is an example I copied somewhere in Domoticz where action is taken when one lamp switches.
It doesn't use IDX but the 'human' name you gave to your device.

Code: Select all

-- switch-another


local pushOn1 = 'Lotek aan'
local pushOff1 = 'Lotek uit'
local pushOn2 = 'Piano aan'
local pushOff2 = 'Piano uit'
local pushOn3 = 'Bank aan'
local pushOff3 = 'Bank uit'

return
{
    on =
    {
        devices =
        {
            pushOn1,
            pushOff1,
            pushOn2,
            pushOff2,
            pushOn3,
            pushOff3,
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG, -- change to domoticz.LOG_ERROR when all OK
        marker = 'pianoLights',
    },

    execute = function(dz, item)
        --local pushOn1 = dz.devices(pushOn1)
        --local pushOff1 = dz.devices(pushOff1)
        --local sonof = dz.devices('Sonoff')

        --if item == pushOn1 and item.active then
        --    sonof.switchOn()
        --elseif item == pushOff1 and item.active then
            --sonof.switchOff()
        --end

        local pushOn2 = dz.devices(pushOn2)
        local pushOff2 = dz.devices(pushOff2)
        local Shelly_20_0 = dz.devices('Shelly 20-0')
        local Shelly_20_1 = dz.devices('Shelly 20-1')
        
        if item == pushOn2 and item.active then
            Shelly_20_0.switchOn()
            Shelly_20_1.switchOn()
        elseif item == pushOff2 and item.active then
            Shelly_20_1.switchOff()
            Shelly_20_0.switchOff()
        end

    end
}
Bugs bug me.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest