Page 1 of 1

Virtual switch with auto revert option

Posted: Monday 11 January 2016 9:10
by aseelert
Hej Folks,

I do have maybe a dump question, but I couldn't found any solution / workaround for my problem.

1. I have a dummy switch which is called Laundry (means, if laundry is in the room, we enable the switch "Entfeuchter" so dehumidifier is switched ON for 6 hours only)
2. the Main switch Laundry should also revert back after 6h, but this is not working as the Switch is On (seems like double set ON is not working)

Problem, this script or even with Blockly the dehumidifiers switch is switched off after 6h, but the device Laundry itself is still ON, so after 6h again the dehumidifiers will be started for next 6h.
It would be nice to get a feature for on time click switch (if switch is on, revert back to off in 6h, like in the Lua script below, which is not working)

Code: Select all

commandArray = {}
if (devicechanged['Laundry'] == 'On' and otherdevices['Entfeuchter'] == 'Off') then
print('Waescheprogram wurde gestartet fuer 6 Stunden')
commandArray['Laundry']='On FOR 360'
commandArray['Entfeuchter']='On FOR 360'
end
return commandArray

Re: Virtual switch with auto revert option

Posted: Monday 11 January 2016 9:26
by tozzke
Set an Off delay of 21600 (or a bit less to prevent 'Entfeuchter' from triggering again) @ switch 'Laundry' should do the trick I guess?

Re: Virtual switch with auto revert option

Posted: Monday 11 January 2016 13:10
by aseelert
Hej,

I tried:

Code: Select all

commandArray = {}
if (devicechanged['Laundry'] == 'On' and otherdevices['Entfeuchter'] == 'Off') then
print('Waescheprogram wurde gestartet fuer 6 Stunden')
--commandArray['Laundry']='On FOR 360'
commandArray['Laundry']='Off AFTER 21600'
commandArray['Entfeuchter']='On FOR 360'
end
return commandArray
which seems to be fine now! Of course it would be nice to have feature like "auto timer" for virtual/dummy switches.
in case you want to enable a switch, it should switch to another state after X Minutes. Hopefully this is implemented in Domoticz.

Like a SCENE switch. You can have a main switch, like "Light_ALL_6h" then you just set this to ON, and after 6h its Off again. Like a timer.

But Lets hope, for now I have to life with this Workaround

Re: Virtual switch with auto revert option

Posted: Monday 11 January 2016 17:12
by tozzke
aseelert wrote:Hej,

I tried:

Code: Select all

commandArray = {}
if (devicechanged['Laundry'] == 'On' and otherdevices['Entfeuchter'] == 'Off') then
print('Waescheprogram wurde gestartet fuer 6 Stunden')
--commandArray['Laundry']='On FOR 360'
commandArray['Laundry']='Off AFTER 21600'
commandArray['Entfeuchter']='On FOR 360'
end
return commandArray
which seems to be fine now! Of course it would be nice to have feature like "auto timer" for virtual/dummy switches.
in case you want to enable a switch, it should switch to another state after X Minutes. Hopefully this is implemented in Domoticz.

Like a SCENE switch. You can have a main switch, like "Light_ALL_6h" then you just set this to ON, and after 6h its Off again. Like a timer.

But Lets hope, for now I have to life with this Workaround
You mean the Off delay you can set @ each switch? :)
Image