Mqtt_client on ubiquiti mpower pro does not communicate with openhab 2.5.4 and openhab 3.0

Hi everyone
I have problems with following guide:

First, the script that does not work for me:

mkdir /var/etc/persistent/mqtt
wget --no-check-certificate -q https://raw.githubusercontent.com/magcode/mpower-tools/master/mqtt/client/install-client.sh -O /var/etc/persistent/mqtt/install-client.sh;chmod 755 /var/etc/persistent/mqtt/install-client.sh;/var/etc/persistent/mqtt/install-client.sh

So I copied and pasted manually every single file in the folder:
mqtt/client

save
reboot

After that i started mqtt with this below command:

/var/etc/persistent/mqtt/client/mqrun.sh

this output gives me back:

MF.v2.1.11# /var/etc/persistent/mqtt/client/mqrun.sh
mqtt: killing old instances
killall: mqsub.sh: no process killed
mqtt: Using temp file /tmp/mqtmp.XXXX33WiDi
mqtt: starting pub and sub scripts
MF.v2.1.11# mqtt: Found 6 ports.
mqtt: MQTT listening...
mqtt: Publishing to 10.1.10.1 with topic homie/mFi-bedroom

Now, if i do well until here ,I’m definitely blocked after this command below:

MF.v2.1.11# tail -f /var/log/messages
Jan 1 14:23:34 mFi-bedroom user.err syslog: ace_reporter.reporter_fail(): initial contact failed [#3](https://github.com/magcode/mpower-tools/issues/3), url=http://mfi:6080/inform, rc=3
Jan 1 14:24:04 mFi-bedroom user.debug syslog: ace_reporter.reporter_timedout(): Connect(http://mfi:6080/inform) has timed out
Jan 1 14:24:04 mFi-bedroom user.err syslog: ace_reporter.reporter_fail(): server unreachable
Jan 1 14:24:04 mFi-bedroom user.err syslog: ace_reporter.reporter_fail(): initial contact failed [#4](https://github.com/magcode/mpower-tools/issues/4), url=http://mfi:6080/inform, rc=3
Jan 1 14:24:34 mFi-bedroom user.debug syslog: ace_reporter.reporter_timedout(): Connect(http://mfi:6080/inform) has timed out
Jan 1 14:24:34 mFi-bedroom user.err syslog: ace_reporter.reporter_fail(): server unreachable
Jan 1 14:24:34 mFi-bedroom user.err syslog: ace_reporter.reporter_fail(): initial contact failed [#5](https://github.com/magcode/mpower-tools/pull/5), url=http://mfi:6080/inform, rc=3
Jan 1 14:25:04 mFi-bedroom user.debug syslog: ace_reporter.reporter_timedout(): Connect(http://mfi:6080/inform) has timed out
Jan 1 14:25:04 mFi-bedroom user.err syslog: ace_reporter.reporter_fail(): server unreachable
Jan 1 14:25:04 mFi-bedroom user.err syslog: ace_reporter.reporter_fail(): initial contact failed [#6](https://github.com/magcode/mpower-tools/pull/6), url=http://mfi:6080/inform, rc=3
Jan 1 14:25:34 mFi-bedroom user.debug syslog: ace_reporter.reporter_timedout(): Connect(http://mfi:6080/inform) has timed out
Jan 1 14:25:34 mFi-bedroom user.err syslog: ace_reporter.reporter_fail(): server unreachable
Jan 1 14:25:34 mFi-bedroom user.err syslog: ace_reporter.reporter_fail(): initial contact failed [#7](https://github.com/magcode/mpower-tools/issues/7), url=http://mfi:6080/inform, rc=3

What is the command to have output on your guide?

homie/mpower-1/port1/relay=0
homie/mpower-1/port2/relay=1
homie/mpower-1/port3/relay=0
homie/mpower-1/port1/power=0.0
homie/mpower-1/port2/power=7.2
homie/mpower-1/port3/power=0.0
homie/mpower-1/port1/energy=0
homie/mpower-1/port2/energy=4
homie/mpower-1/port3/energy=8
homie/mpower-1/port1/voltage=0.0
homie/mpower-1/port2/voltage=234.9
homie/mpower-1/port3/voltage=0.0

And this below:

homie/mpower-1/$homie=2.1.0
homie/mpower-1/$name=mpower-1
homie/mpower-1/$fw/version=MF.v2.1.11-mq-0.2
homie/mpower-1/$fw/name=mPower=MQTT
homie/mpower-1/$localip=192.168.1.26
homie/mpower-1/$nodes=port1,port2,port3
homie/mpower-1/$stats/uptime=2589629.67
homie/mpower-1/port1/relay/$settable=true
homie/mpower-1/port2/relay/$settable=true
homie/mpower-1/port3/relay/$settable=true
homie/mpower-1/port1/lock/$settable=true
homie/mpower-1/port2/lock/$settable=true
homie/mpower-1/port3/lock/$settable=true

Control socket via MQTT

1 - You can control the sockets by sending 0 or 1 to the topic /port/relay/set

2 - You can lock the sockets by sending 0 or 1 to the topic /port/lock/set

Can you better explain these two point above? Also with referral links if you want

And then the last point in the guide:
Integration in openHAB
Where should I write this example of the script below?

Switch switchmp "My mpower switch" { mqtt=">[mosquitto:homie/mpower1/port1/relay/set:command:ON:1],>[mosquitto:homie/mpower1/port1/relay/set:command:OFF:0],<[mosquitto:homie/mpower1/port1/relay:state:MAP(mpowerrelay.map)]"}
Number energymp "Energy consumption [%d Wh]" { mqtt="<[mosquitto:homie/mpower1/port1/energy:state:default]" }
Number powermp "Current power [%.1f W]" { mqtt="<[mosquitto:homie/mpower1/port1/power:state:default]" }

I have installed openhab 2.5.4 on Ubuntu 18.04 server,I installed mosquitto and after, I created mqtt binding and mqtt broker by web browser but i 'm not able to get openhab to communicate with mpower pro.
I also installed an mqtt explorer on my ubuntu desktop pc but also with last one tool it seems there is no communication between mpower pro and the openhab server.

What are my issues?

IMHO the problem seems to be this mqtt-client you are using. Please check with the creators.

For sure the posted openHAB items will not work with OH3, since they are using the version 1 mqtt binding syntax. In OH3 you need the actual MQTT binding with uses things and channels

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.