I’m quite new to openhab/raspi/linux and run openhab3 and openWB (Software for Wallboxes) on two separate Raspis since a few days. They’re supposed to communicate via MQTT with each other.
I installed Mosquitto via the openhab config/setup-tool, the binding/broker and a thing (channel/string to show text). Then I tested the connection with MQTT.fx with success. If I enter a text in MQTT and publish it, it’s shown in openhab.
My problem is that I don’t know how to get the data from openWB to Mosquitto. It’s supposed to be quite simple. I “only” need to (correctly) fill out the data (see screenshot which might clarify things)
I could imagine that these are the sources of my problems:
wrong prefix: What’s this about? So that openWB can find the mqtt-database? If so, what to enter (I don’t know where it is on my raspi)
TLS: I have to enter something in openWB. But when I activate it in MQTT.fx, it doesn’t work.
However, possibly this is not relevant; maybe openWB finds the database through the ip-address and/or changes the TLS settings itself? I have no idea … But if so, how can I access the data in openhab? →
the subscription codes for openWB are listed here: MQTT - openWB Forum in my test I used the one for “house consumption”: openWB/global/WHouseConsumption 4368
This is the thing-channel-code I created, maybe there’s a mistake here?:
Furthermore, here’s (OpenWB mit MQTT in OpenHAB - openWB Forum) a thread which addresses the connection between openWB and openhab. But it focuses on openhab and not on what to do to get the data into mqtt.
Although this might be considered more a mqtt or openWB question, maybe someone can tell me how to solve the issue?
Given that openHAB works and openwb doesn’t, and I suspect there are very very few, if any, users on this forum who have even heard of openwb, you will probably have better luck asking on an openwb forum.
What ever is meant by “prefix” is defined by openwb. MQTT itself has no concept of a “prefix”. Perhaps it is the first part of a topic structure.
There is nothing in the mosquitto database that you need to be concerned about. It’s an internal thing that mosquitto uses when configured to to maintain retained messages and QOS 1 and QOS 2 messages that haven’t been delivered.
thank you for your help.
“Can you connect your openwb and mqtt fx to your Mosquitto Broker?” ← That’s exactly what I don’t know, openwb doesn’t give any information on that.
When I subscribe in mqtt fx with “#” I get nothing and scanning doesn’t get any results. MQTT-Explorer shows something, but I can’t really interpret it or tell if it’s from openwb. Anywhere in particular I could check?
Hi,
OpenWB has it’s own MQTT server.
So you can either configure a second MQTT Broker thing in Openhab (what I did), or use Mosqitto as an MQTT bridge. Then, you will get the payload via Mosquitto. But this needs configuration in Mosquitto.
For OpenWB MQTT data see OpenWB MQTT forum thread
I got it running within minutes.
Joerg
@Ursusprimus,
With regards to your configuration in OpenWB: This is only necessary for option 2.
If you use OpenWB as in option 1 (own MQTT broker), you just need to configure the broker thing in OpenHAB with the IP-address of your openWB and port 1883.
And the same for MQTT.fx.
IP,port and subscribe to “OpenWB/#” because all topics start with “OpenWB” as visible in the link above.
Joerg
THANK YOU SO MUCH, Jörg!
I spent several frustrating hours with that and the solution - as most of the time, once you know it … - is quite simple. I didn’t know that openhab stored its data in its own mqtt-database with its same IP-address. Well, now I do
Made my afternoon
I have a similar problem. After I figured out, that in openHAB I need a MQTT broker and a generic MQTT Thing I was able to add channels and read stuff out of the openWB MQTT.
But even more important for me is the possibility to write data to the openWB trough openHAB (via MQTT).
I figured out, that I am able to write to openWB/set/pv/W using MQTT Explorer. But if I try to send my PV current production to the openWB from openHAB it wont work.
I linked the item that holds my current production but it does not send anything to the openWB. I don’t know what I am doing wrong or how to even debug it, because I can not see anything in the logs.
I tried nearly all combinations of the settings, without any effect.
How are you doing that? To send an MQTT payload to a channel’s commandTopic requires you to send an openHAB command to the linked Item. A state update doesn’t count here.
Start from where your data is coming from. Is that arriving in the form of an update to an Item? From some other binding, via a channel,perhaps?
There’s a number of ways.
You can write a rule that listens for updates to your Item, and sends commands to some other Item linked to the MQTT channel you’ve shown us.
Or, you can write a rule that listens for updates to your Item and sends MQTT messages directly, as @Joerg_Schreiner suggests.
You might find those methods convenient if you have to massage or encode the state in any way before sending.
Or,you can link your MQTT channel to the original Item, but using the special “follow” profile, which effectively listens for Item state changes and sends them as commands to the MQTT binding.