Page 1 of 1

Blocky problem, want to "copy" a switch

Posted: Sunday 09 April 2017 13:05
by Zuikkis
I'm trying to copy state of "Takkahuone Tellstick" to "Takkahuone".

The attached blocky creates error "Error: EventSystem: Malformed action sequence!"

Maybe I need to do separate check for On/Off and then set to On or Off? Not copy switch state like that. But it's weird that direct copy doesn't work, don't you think?

Re: Blocky problem, want to "copy" a switch

Posted: Sunday 09 April 2017 19:46
by Zuikkis
Ended up doing it in lua instead:

Code: Select all

commandArray = {}
if (devicechanged['Takkahuone'] == 'On' and otherdevices['Takkahuone Tellstick'] == 'Off') then
        commandArray['Takkahuone Tellstick']='On'
elseif (devicechanged['Takkahuone'] == 'Off' and otherdevices['Takkahuone Tellstick'] == 'On') then
        commandArray['Takkahuone Tellstick']='Off'
elseif (devicechanged['Takkahuone Tellstick'] == 'On' and otherdevices['Takkahuone'] == 'Off') then
        commandArray['Takkahuone']='On'
elseif (devicechanged['Takkahuone Tellstick'] == 'Off' and otherdevices['Takkahuone'] == 'On') then
        commandArray['Takkahuone']='Off'
end

return commandArray
Works fine, and works in both directions.