[TUTORIAL] Setting up MQTT on Homey for configuring Home Assistant for dashboard purposes

Ok, have about 200 sensors data, so will probably not be a good way of doing it. Is there anyway you can export it easier back to Homey, like HA are doing with auto discovery?

200 sensorsā€¦ damn, thats a lot!!! :crazy_face:

Hehe, yes, its about 120 zwave, 80 zigbee, 200 modbus, 250 on API (Airthings and Disruptive Technologies, did not start on this yet) and about 100 others. So i will really stress test HomeyšŸ™ˆ

@tommyhagenes yes you can use the MQTT Hub for this. Install the beta version and choose ā€˜homie discoveryā€™ when adding a new device. It should be able to auto discover all your 200 devices/sensors from OpenHAB.
From these you can create MQTT devices with a single click. Thatā€™s the theory :slight_smile:. Let me know if this works for you!

Perfekt, i will try.
Thank you :+1::grinning:

So i did what the guide said.
Now iā€™m guessing i need to go to Devices next? Or how did you get to this page? I cant find MQTT Hub under devices, just under settings, and there you just set up the connection right?

Just one week into Homey, so sorry for this question.

@tommyhagenes You need to install the test (beta) version: https://homey.app/nl-nl/app/nl.hdg.mqtt/MQTT-Hub/test/

Ahh, perfect! Now i can find the discovery, and i have veryfied that my pie is sending alot.

Tried to discover saying /BN/# without anyluck. Also /# and mosquitto/# as there is a mosquitto broker on the openhab.

What am i doing wrong? Again, thanks for the quick responses, if this works, all my wishes with Homey are there and i can really do everything i could do with Openhab :smiley:

@tommyhagenes Is your OpenHAB configured to communicate using the ā€˜Homie protocolā€™?
See: https://www.openhab.org/addons/bindings/mqtt.homie/

You probably need to install the latest OpenHAB version (beta; v2.5?) to get it running smoothly.

Ahh, thats why. The new binding for MQTT on 2.4 is to buggy, so still is using V1.
Should it be possible to add it manually with MQTT device? How would that look?

This is my settings.

mqtt:mosquitto.url=tcp://192.168.86.92:1883
mqtt:mosquitto.clientId=BN
mqtt:mosquitto.retain=true
mqtt-eventbus:broker=mosquitto
mqtt-eventbus:statePublishTopic=/BN/out/{item}/state mqtt-eventbus:commandSubscribeTopic=/BN/in/{item}/command

This is the name of one item:
Number Nettanalysator_voltL1 (Nettanalysator) { modbus=ā€œholding4:2ā€ }

If i would to do it in Openhab itwould look like this:
{ mqtt="<[mosquito:/BN/out/Nettanalysator_voltL1/state:state:default]" }

Should it be something like this: /BN/out/Nettanalysator_volt1/state

Does not work by the way, just guessing :slight_smile:

@HarriedeGroot if i convert everything to nodered will that work? Do it need to be a local node red, or can i use nodered in cloud like fred.sensetecnic.com?

Could this topic be moved to Tutorials section?

@tommyhagenes.

The homie MQTT protocol is closely linked and maintained with openHAB - however surprisingly they have not implemented it as an ā€˜outputā€™ protocol from OH. They do support it in 2.5 as an input protocol. So unless OH2.5 which is due for release today has now added such a feature, I donā€™t believe youā€™ll be able to ā€˜discoverā€™ all your sensors easily in Homey.

What you should be able to do using NodeRED is republish standard MQTT reporting of the sensors from OH into a ā€˜homieā€™ template format that Homey will then discover. If they are all ā€˜sensorsā€™ i.e. just reporting data values and not bidirectional that should be workable. You would have no need for control via an associated ā€¦/set topic

NodeRED is ideal for accomplishing this intermediary massaging of topics and payloads

Thanks for the reply.

Used FRED for node red and everything is no working. Did not use auto discover but i belive thats because the pallets im using is not supporting homie.

You will have to create the flow in NodeRED that subscribe to all your HA ā€˜sensor outputā€™ MQTT payloads and copy them to a ā€˜fake/basicā€™ homie topic (name and value) .This will also require you add a few static topics/payloads to meet the homie spec.

Itā€™s not going to be plug and play but it should be do-able as one flow that handles all of your 200 sensors, rather than manually creating each one. It will require you to be familiar with NodeRED.

Hmm, ok. I already did 50 of them manually but will try in the holiday.
But IĀ“m missing a few sensors in the MQTT hub app. I want to add Radon, VOC, push button, data time button, and maybe it should be a ā€œanalog sensorā€ so you can just have universal. How can I add that @HarriedeGroot, or is that something you need to do in the app?

@tommyhagenes create virtual devices for them?

Hmm, dont really understand.
But i think i explaned poorly :slight_smile:

If you look at this pictureScreenshot_20191223_114510_app.homey
You can see that i had to use gas instead of Radon, and CO instead of VOC. It works but its wrong.

Also when i added my meetering system witch measure volt and amper on L1, L2 and L3 i had to use just random values

as when you choose volt, ā€œyou use it upā€, but i need it three times here.

I also tried to change it in the topics, but i just get timeout. Even to fix just a letter because of typo i get timeout. Any idea what i can do?

@tommyhagenes

  1. Only default capabilities are supported.
  2. Using the same capability more then once (see docs) isnā€™t implemented.
  3. The timeout BUG is a strange (known?) Homey issue. I didnā€™t find the reason and that message is all debugging information I haveā€¦

Thanks for the quick answer.
Could it be possible to use measure_voltage 3 times if i edit the topics?
Any thought how i could go on to debug this? Have tried reboot, stop MQTT hub and client without any luck.

Im pretty sure i could do this when i first testet. I think it was before 3.2.0