Page 1 of 1
Scene / Group as trigger
Posted: Sunday 07 May 2017 10:45
by poudenes
Hi all,
I didn't find it here, so ask for it.
Can i use Scene or Group as trigger? like:
When > sunset and < sunrise and group "daytime" = on then group "eventing" to on
In blocky you can't use scene or group as a value trigger. But can you do it in LUA?
Thanks Peter
Re: Scene / Group as trigger
Posted: Tuesday 09 May 2017 9:20
by poudenes
Tried this but test variable won't change.
The group Movie show "Mixed" when its on and also try it in script =='Mixed" but also not working.
Maybe i do something wrong
Code: Select all
commandArray = {}
if devicechanged ['Group:Movie'] == 'On'
commandArray['Variable:Morning'] = '5'
end
if devicechanged ['Group:Movie'] == 'Off' then
commandArray['Variable:Morning'] = '3'
end
return commandArray
Re: Scene / Group as trigger
Posted: Tuesday 13 June 2017 12:11
by zicht
poudenes wrote:Hi all,
I didn't find it here, so ask for it.
Can i use Scene or Group as trigger? like:
When > sunset and < sunrise and group "daytime" = on then group "eventing" to on
In blocky you can't use scene or group as a value trigger. But can you do it in LUA?
Thanks Peter
This MIXED means that in your group some switches are on and some are Off.
So there is no real ON or OFF position in that case.
As soon as all in the group are on or all in the group are off the status will change from mixed to on or off
I propose a work around as i do not know the status right away to check against.
Code: Select all
if devicechanged ['Group:Movie'] == 'On' then commandArray['Variable:Morning'] = '5' end
if devicechanged ['Group:Movie'] ~= 'On' and devicechanged ['Group:Movie'] ~= 'Off' then commandArray['Variable:Morning'] = '4' end
if devicechanged ['Group:Movie'] == 'Off' then commandArray['Variable:Morning'] = '3' end
end
You could do a print(otherdevices ['Group:Movie']) to see in the log what the actual status is to check against

but the above should work