Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification on the guide /mqtt/client #19

Open
spyrito79 opened this issue Feb 26, 2021 · 3 comments
Open

Clarification on the guide /mqtt/client #19

spyrito79 opened this issue Feb 26, 2021 · 3 comments

Comments

@spyrito79
Copy link

spyrito79 commented Feb 26, 2021

I openend a new topic to better explain my problem.
I haven't given you all the information on my real problems and I'm sorry.

For instance:
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 your last point in your 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 and I created mqtt binding and mqtt broker by web browser but i 'm not able to get openhab to communicate with mpower pro.
What are my issue?

@spyrito79 spyrito79 changed the title Caprificarono on the guide /mqtt/client Clarification on the guide /mqtt/client Feb 26, 2021
@udo1toni
Copy link

udo1toni commented Feb 28, 2021

If you are using openHAB2.5.4, you're probably using the mqtt2 binding. My complete mfi thing (6ch):

     Thing topic mFi "mFi" @ "mqtt" {
          Type number : ch1Power "Leistung" [ stateTopic="homie/Steckdosen/port1/power" ]
          Type number : ch1Volt  "Spannung" [ stateTopic="homie/Steckdosen/port1/voltage" ]
          Type number : ch1Energy  "Energy" [ stateTopic="homie/Steckdosen/port1/energy" ]

          Type number : ch2Power "Leistung" [ stateTopic="homie/Steckdosen/port2/power" ]
          Type number : ch2Volt  "Spannung" [ stateTopic="homie/Steckdosen/port2/voltage" ]
          Type number : ch2Energy  "Energy" [ stateTopic="homie/Steckdosen/port2/energy" ]

          Type number : ch3Power "Leistung" [ stateTopic="homie/Steckdosen/port3/power" ]
          Type number : ch3Volt  "Spannung" [ stateTopic="homie/Steckdosen/port3/voltage" ]
          Type number : ch3Energy  "Energy" [ stateTopic="homie/Steckdosen/port3/energy" ]

          Type number : ch4Power "Leistung" [ stateTopic="homie/Steckdosen/port4/power" ]
          Type number : ch4Volt  "Spannung" [ stateTopic="homie/Steckdosen/port4/voltage" ]
          Type number : ch4Energy  "Energy" [ stateTopic="homie/Steckdosen/port4/energy" ]

          Type number : ch5Power "Leistung" [ stateTopic="homie/Steckdosen/port5/power" ]
          Type number : ch5Volt  "Spannung" [ stateTopic="homie/Steckdosen/port5/voltage" ]
          Type number : ch5Energy  "Energy" [ stateTopic="homie/Steckdosen/port5/energy" ]

          Type number : ch6Power "Leistung" [ stateTopic="homie/Steckdosen/port6/power" ]
          Type number : ch6Volt  "Spannung" [ stateTopic="homie/Steckdosen/port6/voltage" ]
          Type number : ch6Energy  "Energy" [ stateTopic="homie/Steckdosen/port6/energy" ]
      }

As I don't want to switch the sockets at all, I' did'nt create switch channels, but that would be

Type switch : ch1Switch "Schalter" [ commandTopic="homie/Steckdosen/port1/relay/set", stateTopic="homie/Steckdosen/port1/relay",on="1",off="0" ]
Type switch : ch1Lock "Sperre" [ commandTopic="homie/Steckdosen/port1/lock/set", stateTopic="homie/Steckdosen/port1/lock",on="1",off="0" ]

The lock is to disable switching at all. I have set this to ON to prevent unwanted poweroff for connected devices (as these are my servers... I'm using the mfi only for measurement)

@spyrito79
Copy link
Author

Hi
thanks for your reply.
I tried to copy your configuration on the folder things of openhab 2.5.4 but when i have entered in openhab GUI via web browser i didn't found your configuration. Anyway I set the mqtt binding and mqtt broker first but i don't know how to go on because , as I told you, the folder of your "things" didn't appear.
In the end I also installed openhab 3.0 but the result is the same.
May you help me with Openhab and mpower configurations with a teamwiever session?
Obviously I'm going to pay for your disturb.
If you are interest send me an email on [email protected]
or write me via telegram looking for @root_toor

@udo1toni
Copy link

udo1toni commented Mar 5, 2021

Maybe better to change to the official openHAB community: https://community.openhab.org/ mpower is not that special ;) in the end it's just another mqtt device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants