It will be very useful for me to have hide/unhide method for deices in dzVents.
For example: if i turn off my heating system (by dummy switch), i want hide my boiler devices, pumps, boiler temp and pressure control, etc from control panel. And when i switch it on - unhide.
I can do it now via string parsing and $ symbol, but it is a lot of code.
DzVents hide/unhide method request [Solved]
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: DzVents hide/unhide method request [Solved]
You can do this by adding all heating related devices to group heating and use this script.
Code: Select all
return
{
on =
{
devices = { "dummy switch" },
},
logging =
{
level = domoticz.LOG_DEBUG, -- set to Error when script executes without problems
},
execute = function(dz,item)
_G.logMarker = _G.moduleLabel
heatingGroup = dz.groups('heating')
local function hideGroupDevices(group)
group.devices().forEach(function(dv)
if dv.name:sub(1,1) ~= '$' then
dv.rename('$' .. dv.name) -- rename method available in dzVents >= 2.4.24 (domoticz >= V4.10927)
end
end)
end
local function unHideGroupDevices(group)
group.devices().forEach(function(dv)
if dv.name:sub(1,1) == '$' then
dv.rename(dv.name:sub(2))
end
end)
end
if item.active then
unHideGroupDevices(heatingGroup)
else
hideGroupDevices(heatingGroup)
end
end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: No registered users and 1 guest