This page last changed on Feb 08, 2015 by nbright83.

I have just acquired a controllable plug made by Ubiquiti. I was curious if any of you have tested any of this mFi stuff with Openremote. It runs some sort of dumbed down version of linux, with BusyBox, and can be ssh'd into, and can also take some http commands. It can provide you with seperate plug switching as well as stats about power factor, voltage, amps, as well as kwh. They have free controller software, but I got ahold of this thing with the intention of using only Openremote. They also have a bunch of sensors and a lighting dimmer with similar features. Seems like it could be a great way to go... Anybody out there?

Nick, I've got a few mFi units and I'm pretty confident they're working as anticipated at this point, so I'm looking to do the same as you.

I'd like to get status (on/off), load (power consumption), and control (on/off) of the various ports.

I'm just barely advanced enough to grab stuff from a web site or telnet session if I get really lucky with a regex.

So far, I've gathered that there is an HTTP option described here: https://community.ubnt.com/t5/mFi/mPower-mFi-Switch-and-mFi-In-Wall-Outlet-HTTP-API/m-p/1076449#U1076449

and there's the option to telnet directly to each device to gather data

and there's this script that seems to help make the telnet option work a little better: https://community.ubnt.com/t5/mFi/mPower-mFi-Switch-and-mFi-In-Wall-Outlet-HTTP-API/m-p/1076449#U1076449

I have yet to successfully get anything to work. But I'm confident that a better techy than I would have no problems doing so. I'm currently trying to launch the script above as a "Shell execution protocol" in the controller with parameters that work from the command line of my controller. So far, no luck.

FTR, I'm going that direction because the mFi HTTP/REST setup requires a separate login from the commands and I have /no/ idea how to do that. So... I figured it would be start with direct telnet and/or script. I'm unable to get telnet to work because it involves multiple steps (so far), so... we'll see.

Posted by gregoryx at Aug 22, 2015 21:39

Gregory, I have yet to document my use of shell scripts and mFi. You can expect me to post it here this week. Basically I have also been using she'll execution protocol to call scripts that ssh into mpower and mports to get information and set outputs. I have not tested this functionality in depth with mfi controller running to see what conflicts may arise, though I suspect it will cause some issues with any mfi rules you may have in place. It seems the ideal thing for openremote to do would be to edit mongodb as if mfi had made the change, as well as read data from the database without using shell scripts and ssh. My time on this project has been limited lately, but I really like ubiquiti and their products and would like to further develop the functionality of it with openremote since it seems mfi has taken a back burner with its developers.

I will post some links later this week, but if you're impatient then search mfi forums for ssh commands, there are some nuggets of great value hidden there.

Posted by nbright at Aug 23, 2015 00:37

Sounds great, Nick.

I can confirm (suspect?) that direct control of the relays seems to work fine with the mFi controller, as I'm using an Android app to do just that and it seems to be fine so far.

If you could just post a sample of how you're calling the shell script(s), I'd be really grateful. I'm having no success with that.

That script for controlling all the devices looks really promising to me. Having a single file to store all the device information and being able to return everything I want already in the OR controller seems like a great short-cut. I suspect I can make it work if I keep messing with it. I can't find any logs for telnet or TCP/IP commands, so I'm shooting in the dark so far.

Thanks!

Posted by gregoryx at Aug 23, 2015 00:55
Document generated by Confluence on Jun 05, 2016 09:39