Highlighted
Ubiquiti Employee
Posts: 627
Registered: ‎06-27-2012
Kudos: 375
Solutions: 31
Contributions: 6

mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

Alpha "Over the air" multi-way dimming and switching is supported in firmware version 2.1 and later.  It operates using the user's WiFi network, so it is dependent on the reliability and configuration of that network.  When in dimming mode, the dim level is pushed between the devices allowing real time dimming from one or more remote dimmers.  It operates without the need for a controller.

 

Status

 

This is an "Alpha" feature.  It has been tested in the lab, and some Beta users have tested it in the real world.  

 

Wiring

 

The main switch is wired to the load.  The load wires (red) on the other switches do not need to be connected to anything (they should be terminated with a wire nut).

 

Configuration

 

To enable the feature, in /tmp/system.cfg add the line:

m2m.status=enabled

 

Then access the Machine tab of the device's web interface.  There will be a new configuration section at the bottom.

 

Devices 'push' their state to other devices.  Each remote mFi Switch would be configured to push it's state to a common main switch that is connected to the load.

 

Switches can also push their state to ports of mPower strips or mFi In-Wall outlets, such as when the user wants a wall switch to also control a floor lamp.

 

There are 2 configuration actions: 'push' and 'sync'.  Both push their state.  'Sync' also returns the state, specifically to get the status LEDs to match.  A basic rule is to use 'sync' with switches so the LEDs of the remote switches can reflect the correct state, while using 'push' from a switch to an In-Wall Outlet or mPower strip.  If unsure, use 'push'.

 

Once the feature moves out of Alpha, we will make the configuration panel avaiable without modifying /tmp/systyem.cfg

 

Optional Name Support

 

Using device names instead of IP address is double-Alpha, since it's leveraging 2 new features (P2P and multicast DNS naming).

 

To support situations where IP addresses can change, devices can be referenced by name (be careful regarding spaces and special characters in device names - it's best to stick to just letters and numbers without spaces).  A regular DNS lookup is first performed, and then integrated multicast DNS (Bonjour) is performed if the DNS didn't succeed.  Multicast DNS client and server are integrated into the mFi firmware, so external equipement isn't needed.  But it only operates over a layer 2 (Ethernet/WiFi) network and could be blocked if an access point or switch is filtering multicast traffic or has client isolation enabled.

 

Since multi-way switching and multicast DNS support is new, it is recommended that only static IP addresses are used at first.

 

Example

 

This example has 2 mFi Switches in dimmer mode - one attached to a hard-wired wall light and the other switch acting as a remote control.  And there is an In-Wall outlet with a floor lamp connected.

 

The wall lights can be dimmed from either switch, and the wall outlet state follows the on/off state of the light.

 

The remote mFi Switch syncs its state with the main mFi Switch (so the device status LEDs match).  Both switches push their state to the floor lamp (note: it would also work if just the main switch pushed it's state to the outlet, since the remote switch is syncing to the main switch - but it's one less hop if the remote switch pushes directly to the outlet)

 multiway-example.png

SuperUser
Posts: 15,123
Registered: ‎08-07-2008
Kudos: 7335
Solutions: 415
Contributions: 1

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

I works good. I'm using it on 2 dimmers in switch mode.

Walks in, tells it like it is, walks out , milks a cow
Established Member
Posts: 893
Registered: ‎04-24-2014
Kudos: 500
Solutions: 17

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

thank you so much.

 

ill play with this tomorrow.

Matt W
Established Member
Posts: 1,601
Registered: ‎05-15-2013
Kudos: 632
Solutions: 19

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

@UBNT-Randy Is this article still accurate given the last few firmware releases? Specifcally, the config update to m2m...this is in teh GUI of each device now, yes?

SuperUser
Posts: 15,123
Registered: ‎08-07-2008
Kudos: 7335
Solutions: 415
Contributions: 1

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

I believe it is, yes.

I have not installed any more in 3 way clone mode since the first pair I did.

Walks in, tells it like it is, walks out , milks a cow
New Member
Posts: 1
Registered: ‎02-03-2014

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

Can someone please explain to me how to do this

To enable the feature, in /tmp/system.cfg add the line:

m2m.status=enabled

SuperUser
Posts: 15,123
Registered: ‎08-07-2008
Kudos: 7335
Solutions: 415
Contributions: 1

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

On a windows computer I use winscp. (google that)

Open the program , choose scp for the protocol .

Enter the ip of the dimmer switch.

Then user and PW when prompted.

You can then navigate to the tmp folder and open the file system.cfg  Add that line to the bottom of the file as a new line.

 

Walks in, tells it like it is, walks out , milks a cow
New Member
Posts: 13
Registered: ‎01-28-2014
Solutions: 1

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

Thank you!

Emerging Member
Posts: 53
Registered: ‎08-25-2011
Kudos: 7
Solutions: 2

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

Alternatively use vi, a native text editor to save having to move files around and potentially overwriting something you shouldn't

"vi /tmp/system.cfg"

"i" to enter "insert mode" and edit the contents of the file

Esc key to leave insert mode

":wq" to "write quit" or save and quit or ":q!" to quit without saving

Emerging Member
Posts: 96
Registered: ‎07-18-2013
Kudos: 9
Solutions: 1

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

[ Edited ]

I've tried to get this functionality working to no avail. I first tried with 2.1.8 and then upgraded to 2.1.11.

I haven't yet tried the "standard" multi-way switching/dimming, though if I can get this functionality working I'll definitely be changing out more switches which are in a true/standard multi-pole switching configuration. In the mean-time I just wanted to try having a switch control other things.

I edited the system.cfg and got the new UI elements. I first wanted to see if I could have 2 dimmer switches, which each are driving different/independent loads to control each other (basically I wanted the porch lights to turn on when I turned the rest of the outside lights on and vice versa). So on each switch I enabled a rule to do a sync with the other. No matter what I did, I couldn't seem to get one to control the other. I tried restarting each of them several times to no avail. So then, wondering if maybe it's because I had it setup bi-directionally, it was confusing itself because each was trying to sync state with the other. So I changed it so only one of them would sync with the other. I still couldn't get it to work.

I tried ssh'ing into each device and pinging the other to make sure they had good connectivity to the other device (and both have over 90% wifi signal so should be quite solid). No obvious issues there. Then I tried using curl and the http API to try and drive each switch and I successfully did that.

Then I tried using "push" instead of sync. Still no difference. I tried using 3 different methods for turning things on/off: 1) the switch itself 2) the web interface on the switch 3) the controller interface.

Then I tried having it control one of my mPowers instead. I couldn't get that to work either. Then, wondering if maybe it's because it was in dimmer mode, I switched it to switch mode. Still no go.

I've about run out of things I can think of try. Any ideas what I might be missing and/or how to debug this further?

Also note that I'm using static ip addresses.

 

SuperUser
Posts: 15,123
Registered: ‎08-07-2008
Kudos: 7335
Solutions: 415
Contributions: 1

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

I would try resetting both switches.

Enable  sync on ONE only set the IP of the other switch /user and password.

I have 2 switches for my 2nd floor light. 1 is wired to the load the other is not. I only enabled sync on ONE of them.

Maybe by doing both it got messed up somehow.

 

Walks in, tells it like it is, walks out , milks a cow
Emerging Member
Posts: 96
Registered: ‎07-18-2013
Kudos: 9
Solutions: 1

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

I'll try resetting in a little bit.  And the setup you describe is what I'm going to do when I put switches in for my true multipole configuration. 

 

For now I'm just trying to have the switch control an mPower port to avoid any sync issues.  I'm looking at the logs, and here's what I see from the switch's log:

 

May 11 11:18:29 PorchDimmer user.info syslog: websocket: peer changed output port 1, now 0 (fd = 6)
May 11 11:18:29 PorchDimmer user.debug syslog: ace_reporter.dev_event(): ################### driver event detected (3)
May 11 11:18:29 PorchDimmer user.err syslog: ace_reporter.dev_event(): MFI_EVENT_OUTPUT_POWER (1)
May 11 11:18:29 PorchDimmer user.err syslog: ace_reporter.dev_event(): dev_event: read() port = 1, len = 1, val = 0
May 11 11:18:29 PorchDimmer user.err syslog: ace_reporter.dev_event(): dev_event: not clearing output timer on port = 1, since timer is 0
May 11 11:18:29 PorchDimmer user.info syslog: websocket: output changed, client 172.16.0.156/172.16.0.156 sending json --> { "sensors": [ { "port": 3, "output": 0 } ] }
May 11 11:18:29 PorchDimmer user.info syslog: ws-client: -1 = libwebsocket_write(0x454dc8, <buf>, 46, 0)
May 11 11:18:29 PorchDimmer daemon.info init: process '/bin/ws-client -o "username=admin&password=<deleted>" 172.16.0.156 -S 1 -D 3 -M "2>&1"' (pid 1707) exited. Schedulin
May 11 11:18:29 PorchDimmer daemon.info init: starting pid 1957, tty '/dev/null': '/bin/ws-client -o "username=admin&password=<deleted>" 172.16.0.156 -S 1 -D 3 -M "2>&1"'

 

 So it certainly appears that it's trying to do the right thing.  But I don't see anything in the mPower's log.

Emerging Member
Posts: 96
Registered: ‎07-18-2013
Kudos: 9
Solutions: 1

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

OK, I did try resetting both of the switches to factory defaults and then re-configuring and re-adopting them. 

 

And then I tried configuring just one switch to control my mPower.  Same result.  So then I tried configuring the switch to push to the other switch.  Same Result.

 

The logs seem to me to be indicating that whenever it tries to write the json data, it's causing ws-client to exit with a -1, which then also causes it to restart ws-client. 

 

I think I've configured everything correctly, and I think I've done everything indicated in the first post of this thread.  So I'm a bit baffled as to why it's not working. 

 

 

Established Member
Posts: 1,043
Registered: ‎02-17-2014
Kudos: 386
Solutions: 40

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

@UBNT-Randy,

Has there been any thought to allow the output of the wall switch to be disassociated from it's input?

 

For examply....

If a second switch is being used as a remote switch, use the output from the second switch to be controlled via another device or the mFi controller directly.

Let's say that a house has a kitchen with one switch entering the kitchen from the living room controlling the kitchen light.  The kitchen also has a back door to the outside with a single switch controlling the porch light by that door, but no switch for the kitchen light.  Install 2 switches (one at each location) and program both to control the kitchen light.  Then use the mFi controller to control the porch light via a schedule through the second switches output.

New Member
Posts: 13
Registered: ‎04-15-2015
Kudos: 7

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

Will be switches and outlets accessible in EU version (230V) in 2016?

Member
Posts: 134
Registered: ‎12-23-2014
Kudos: 6
Solutions: 1

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

I had enabled m2m.enabled=true in the /tmp/system.cfg file. Now recently we had a power failure, and this feature gor deleted because it is in the /tmp/ folder. Is there any way we can fix this? I have to rewrite in the system.cfg file. This area is prone to power flickers in spring and fall. Now how can I get around other than the controller?

SuperUser
Posts: 15,123
Registered: ‎08-07-2008
Kudos: 7335
Solutions: 415
Contributions: 1

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

Deleted.  ? I have had this working for well over a year. Must have had 60 some power drops. Still works.  I'm wondering if it didn't save the first time.  The file is not deleted after power loss, and it can't be edited either during a power loss / boot up. 

 

Allan

Walks in, tells it like it is, walks out , milks a cow
Member
Posts: 134
Registered: ‎12-23-2014
Kudos: 6
Solutions: 1

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

Yes, it got deleted. I have reentered the line on some of them. But funny thing on the others is the line will not become active until load is activated first. Then it will push or sync and alert the other switches. I have seen like rebooting thing on the other switches. But this did not happen to all of them. Still I have to track the garage light, whcih can be switched either in the house or in the garage itself. Inside the garage is the main and it syncs with the other switch. May be I am wrong, but this is what happening.

New Member
Posts: 37
Registered: ‎09-16-2015
Kudos: 28

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

After editing the file, you could try typing in "save" at the command line. Reboot and check to see if the line is still there.

 

Note that after the reboot, your edited line won't be in the same part of the file. It should appear between the lines for iptables.status and netconf.1.autoip.status.

 

 

 

 

Member
Posts: 134
Registered: ‎12-23-2014
Kudos: 6
Solutions: 1

Re: mFi Alpha Feature: Multi-way Switching/Dimmer and mPower/Outlet Sync

Hi,

 

How to type "save"? I am using vi by ssh connection from windows computer. When you are coming out of vi editor, you type "wq!" which means it saves and exit. I have rebooted the switch several times.

 

But now new thing is happening, whenever the power recovers back from outage, one or two times I have to actuate the load side switch and then I can use other switch to operate the light. Sometimes it takes long time to get load switch activated.

 

Anyway I will try this.

 

Thanks