Hi,
I have created a Virtual Dummy On/Off Switch to set, with a blockly script, a Group (of 4 switches) On-Off for voice control in Google Home.
I used a Virtual Dummy Switch because the wife keeps saying ON-OFF instead of activate/deactivate (Which is for Groups and Scenes)....arrrghhh!
However I also have a KAKU remote which also controls the Switches.
Now the Following Happens:
Turning the Virtual Dummy Switch On/Off With Voice Control and Domoticz buttons is working nicely.
When I turn off/on the 4 Switches with the remote, only the Group and the corresponding Switches nicely are switched On/Off
But the Virtual Switch does not respond offcourse!
How can I set the Virtual Switch to On/Off when the lights are switched on/off by the remote with a Script (Blockly or dzVents)?
Greetzzz,
Gerben
If group is On-Off set Switch On-Off [Solved]
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: If group is On-Off set Switch On-Off
If I understand you correctly, you could use the learn mode in the switch tab to create a new switch that will be triggered by your remote and use that switch also in your Blockly.gschmidt wrote: Sunday 13 January 2019 12:01 How can I set the Virtual Switch to On/Off when the lights are switched on/off by the remote with a Script (Blockly or dzVents)?
Gerben
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
-
gschmidt
- Posts: 200
- Joined: Thursday 20 December 2018 11:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: If group is On-Off set Switch On-Off
I have 4 lights programmed to the remote: 3 buttons to 3 kaku (433) devices, which transmit to the 3 kaku receivers and one button to a learned on/off switch which turns on/off my virtual dimmer switch Yeelight LED RGBWW with a blockly script.So I don't have any buttons left on the remote....
Instead I have put all 4 lights into a group which is triggered by a virtual switch with a blockly script.
I want to tell this virtual switch that if the 4 lights are turned off with the remote (instead of voice or domoticz because this is already working), this virtual switch has to switch to off, beacause all the 4 lights are off...
Is that possible with a dzVents or Blockly script?
Instead I have put all 4 lights into a group which is triggered by a virtual switch with a blockly script.
I want to tell this virtual switch that if the 4 lights are turned off with the remote (instead of voice or domoticz because this is already working), this virtual switch has to switch to off, beacause all the 4 lights are off...
Is that possible with a dzVents or Blockly script?
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: If group is On-Off set Switch On-Off [Solved]
Like this ?
Code: Select all
local lights = {"switch1","switch2","switch3","switch4"}
return {
on = { devices = lights}, -- Triggers on any of the above switches
execute = function(dz)
local atLeastOneLightOn
local groupSwitch = dz.devices("groupSwitch")
for index,lightName in ipairs(lights) do
if dz.devices(lightName).state == "On" then atLeastOneLightOn = true end
end
if atLeastOneLightOn then
groupSwitch.switchOn().checkFirst().silent()
else
groupSwitch.switchOff().checkFirst().silent() -- If all switches are Off
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
-
gschmidt
- Posts: 200
- Joined: Thursday 20 December 2018 11:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: If group is On-Off set Switch On-Off
Correctomundo...Working
Thanx man!
Thanx man!
Who is online
Users browsing this forum: No registered users and 1 guest