Scene / Group as trigger Topic is solved

Moderator: leecollings

Post Reply
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Scene / Group as trigger

Post 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
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: Scene / Group as trigger

Post 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
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Scene / Group as trigger

Post 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
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest