master switch not following slave switch

Post Reply
rrozema
Posts: 54
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: Delft
Contact:

master switch not following slave switch

Post by rrozema » Saturday 25 November 2017 15:41

Hi, I'm in a transition period moving away from X10 devices to all z-wave. I have mochad installed to control my x10 devices through a CM15Pro/CM19A bridge, and razberry to control all z-wave devices. I have a small key fob device for x10 that used to control my living room devices. The X10 switches on these living room devices have just been replaced by Z-Wave devices. I want the same lights respond to the X10 keyfob as they used to be, however the switches now no longer respond to the keyfob directly. I've still got the X10 switch configured in Domoticz, which still responds to the keyfob.

I have setup my new Z-Wave switches in Domoticz and the lights can be controlled from domoticz. Next I've configured the x10 switch to be a sub/slave device for these switches. Now what happens is that if I switch the lights on or off using the keyfob, in Domoticz the status of all switches is updated correctly, both the X10 switch changes and the status for the zwave switch follows. However the physical lights (on the z-wave switch) do not follow!

From this thread viewtopic.php?f=11&t=12816 I understand this behavior is by design. It is however not what I need. Can anyone please tell me how I can make the z-wave switch follow the X10 switch?

User avatar
mrf68
Posts: 248
Joined: Monday 23 February 2015 13:45
Target OS: Windows
Domoticz version: 3.4834
Location: Netherlands
Contact:

Re: master switch not following slave switch

Post by mrf68 » Sunday 26 November 2017 10:19

Hi,

this sub/slave scenario is not what you need. With Blockly or LUA you can get it working. Create a blockly like “If device A is On then set device B is On”. Create a second one but then when turning it off. You can create this in one blockly with the “elseif”, but it can be tricky when troubleshooting.
----------
3x RPi
1x W2k12 (vm)
3x RFXcom433e
1x Razberry board
KAKU: 9x APA3-1500R, 2x ACDB-7000C, 3x AMST-606, 1x APIR-2150, 1x AWS-3500, 1x ATMT-502
Z-wave: 8x Everspring AN145
Misc: 2x wireless doorbells

rrozema
Posts: 54
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi
Domoticz version: beta
Location: Delft
Contact:

Re: master switch not following slave switch

Post by rrozema » Tuesday 05 December 2017 23:24

I've done like you suggested, in a Lua device script:

Code: Select all

commandArray = {}

sw1 = 'SW Keuken Aanrechtverlichting'
sw2 = 'Aanrechtverlichting'

-- loop through all the changed devices
for deviceName,deviceValue in pairs(devicechanged) do
    if (deviceName == sw1) then
        if (deviceValue ~= otherdevices[sw2]) then
            commandArray[sw2] = deviceValue
        end
    elseif (deviceName == sw2) then
        if (deviceValue ~= otherdevices[sw1]) then
            commandArray[sw1] = deviceValue
        end
    end
end

return commandArray
Sometimes there's a small delay, but most of the times the response pretty direct. This always keeps both switches in sync: no matter which switch is operated, the other follows.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest