waaren wrote: ↑Saturday 01 May 2021 19:36
gschmidt wrote: ↑Saturday 01 May 2021 10:58
Hi,
How can I check in dzVents if a Group Scene is activated?
Is it like this:
Code: Select all
local TV = dz.groups('Ziggo TV')
if TV.state == 'On' then blabla
or else?
Yes something like that
Code: Select all
return
{
on =
{
groups =
{
'Ziggo TV',
},
},
logging = {
level = domoticz.LOG_INFO,
marker = 'groupState',
},
execute = function(dz, item)
dz.groups().forEach(function(group)
dz.log('Group ' .. group.name .. '; State: ' .. group.state .. '; Active: ' .. dz.utils.toStr(group.active))
end)
if item.state == 'On' then
dz.log('\n\nGroup ' .. item.name.. ' is On')
end
end
}
Thanx, this is working indeed.
However I am not sure if this is the approach for solving my problem.
To control my AV System (TV, Yamaha Receiver and Ziggo Next Box) I have created 11 Scenes.
Scene 1: Turns On Receiver, TV and Ziggo Next (to the correct outputs)
Scene 2: Turns Off: Receiver, TV and Ziggo Next
The other 9 Scenes are not using Ziggo Next so they also turn Off the Ziggo Next e.g. Watching Netflix with TV App:

- Netflix.JPG (43.42 KiB) Viewed 833 times
The problem is that the Ziggo Next Remote has a Toggle On/Off button.
So the Virtual On/Off Switch in domoticz, which controls the Ziggo Next box via Node-Red is actually a toggle On/Off button.
Now if I switch from Scene 1 to Scene 3 (Netflix) the Ziggo Next Box turns off correctly.
But when I switch from Scene 3 to one of the other Scenes (Except Scene 1), those Scenes also want to Turn Off the Ziggo Next...but it is already Turned Off by switching from Scene 1 to Scene 3, As a result the Ziggo Next is turned On (the Off Command in the group has no effect) again because it is a Toggle Button.
How can I solve this problem with dzVents?
Note: I also have created a Virtual Switch in Domoticz, which keeps track of the online/offline status of the Ziggo Next Box. (maybe this can be of use?)