Scene active/inactiv switch

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
swen
Posts: 3
Joined: Saturday 09 May 2020 14:35
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Austria
Contact:

Scene active/inactiv switch

Post by swen »

hi,
I would like to be able to switch a scene between active and inactive with a dummy switch.
I have tested this with this dzVents script:

Code: Select all

--Dummy Switch: 'Beschattung Automatik'  Idx: 4269
--Scene       : 'TestSzene'              Idx:   22

local dz        = domoticz

return {
    logging = {
        level = domoticz.LOG_INFO,
        marker = '-----'
    },

    on = {
        devices = { 'Beschattung Automatik' }
    },

   	execute = function(dz, switch)
        if (dz.devices(4269).active) then     
            dz.scenes('TestSzene').active = true
            dz.log('scene true')
        else
            dz.scenes('TestSzene').active = false
            dz.log('scene false')
        end
    end
}
But it doesn't work, the scene is always active.
The dummy switch works correct. I can see this in the log.

Does anyone know a solution?
User avatar
jvdz
Posts: 2269
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Scene active/inactiv switch

Post by jvdz »

I haven't tested it but think it should be something like this:

Code: Select all

--Dummy Switch: 'Beschattung Automatik'  Idx: 4269
--Scene       : 'TestSzene'              Idx:   22

local dz        = domoticz

return {
    logging = {
        level = domoticz.LOG_INFO,
        marker = '-----'
    },

    on = {
        devices = { 'Beschattung Automatik' }
    },

   	execute = function(dz, switch)
        if (switch.state == 'On') then
            dz.scenes('TestSzene').switchOn()
            dz.log('scene true')
        else
            dz.scenes('TestSzene').switchOff()
            dz.log('scene false')
        end
    end
}
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
swen
Posts: 3
Joined: Saturday 09 May 2020 14:35
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Austria
Contact:

Re: Scene active/inactiv switch

Post by swen »

Hi,
I've already tested it. Also after

Code: Select all

dz.scenes('TestScene').switchOff()
the timer triggers the scene.
But that's exactly what I want to prevent.
User avatar
waltervl
Posts: 5770
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Scene active/inactiv switch

Post by waltervl »

You cannot inactivate a scene. It can only be activated (switched on). A group can be switched on/off.
https://wiki.domoticz.com/Managing_Devi ... or_Groups)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
swen
Posts: 3
Joined: Saturday 09 May 2020 14:35
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Austria
Contact:

Re: Scene active/inactiv switch

Post by swen »

Hi, thanks for the info.
I did some more tests and found no other solution.
groups are also unsuitable.
So I will program my five scenes and their timers in dzVenzts.

Thanks and bye
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest