Launching scene withe timer from script

Moderator: leecollings

Post Reply
tootai
Posts: 2
Joined: Thursday 22 September 2016 10:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Alsace - France
Contact:

Launching scene withe timer from script

Post by tootai »

Hi all,

I created a virtual switch for which I want that if ON, it activate a scene having Timers "After Sunset" type and not default activated. This scene has few devices configured with "On Delay" and "Off delay" but has no activation device. Devices are looking like this

Name Cmd level On delay Off delay
Radio On 100 % 600 1800

My script is activated by [ON|OFF] Action from the virtual switch and is looking like this

#!/usr/bin/lua

-- Début du Script --
commandArray = {}

tc = next(devicechanged)
gestionVie_switch = tostring(tc)

if (devicechanged[gestionVie_switch] == 'On') then
commandArray['Scene:Effets Interieur'] = 'Active'
print('Activation du module gestion de VIE !')
elseif devicechanged[gestionVie_switch] == 'Off' then
commandArray['Scene:Effets Interieur'] = 'Inactive'
print(':(Désactivation du module gestion de VIE')
end

return commandArray

What I see is that in Timers from the scene, when virtual switch is ON, activation goes from NO to YES which is OK. But that's all, scene is never played.

What am I missing ? Is this feasable ?

Thanks for any hint

Daniel
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest