MQTT Hub/Gateway

Is that ‘up and running’ with the ‘internal’ or an ‘external’ broker… or both ?
I would hope people could expect a trouble free time with the internal one too.

I needed to use an external Broker to have it stable, it worked with the internal but not fully since the list of devices with theirs properties in the Node-Red convention node wasn’t retained between deploys in Node-Red. I haven’t fault traced why because I don’ t have the knowledge.

Worrying - I have a second Homey with mqtt app and broker installed that I really dont use for that purpose. If I get a moment over New Year I’ll test this out because if it doesn’t retain it’s no use.

First of all, great work on the app!
I finally have everything connected correctly with an external MQTT broker.
On this server i’m experimenting with Node-Red (learning curve!)

I was wondering; the MQTT Hub sends it’s message woth QOS: 0 and no retain.
Is there an option to modify this?

Often when i flip a switch in homey, the switch flips back; i think this is because mqtt hub sends the status and reads some older status at the same time, causing the switch to revert to the read status immediatly.

Therefore i’d like the option in the hub to change the QoS and Retain settings, if possible.

Are you sure - on mine the topics are definitely retained (only the command /set topics should NOT be sent retained).

You aren’t sending those /set messages retained are you which might cause Homey to revert state to the last sent command every time …

… … as in your thinking here.

Really the only thing that might cause a Homey device that you change the state of within Homey to revert back is a new /set command (or some internal flow action in Homey), or it couldn’t actually change the state of the device.

yes, sorry, i was not awake enough :frowning:

I see the sensor-alarms-status etc on QOS:0 and no retain.

shouldn’t switches have a retain as well?
Or is it better to have everything on a QoS:1?
(would be great to experiment with if this comes available in a future update)

(ps. sorry if i sound a bit stupid, just recently started discovering MQTT :slight_smile: )

All state information should be retained - just don’t send /set commands retained
You mean onoff ?? It is…

QOS 0 or 1 is fine with homie - it was designed for either

image

image

If i toggle a light from within the homey app and monitor the MQTT channel, i see the light is switched but no retain is set, everything is QOS:0

What sometimes happens is when i toggle a light off from within the Homey app it toggles off and on again.
i have to toggle the light a couple of times before it takes.

It does not happen all the time, just occasionally.
Now, i AM working on a node-red dashboard but i have no ‘active’ functionality in there, i want to understand everything/a lot first before jumping in the deep. (and the WAF is very important here; i must not break stuff)

btw, what is that interface you’re working in from the screenshot?

It is MQTT Explorer - you should use it it’s great

QOS and retained are not connected - the messages from MQTT hub will always be QOS 0 - that is fine. Messages are always sent retained.

So sent QOS 0 and retained.

Higher QOS e.g. 1 or 2 requires retained I think as it needs to support clients that connect after the message was sent. QOS 0 is much less taxing on the broker (as it doesn’t need to know which clients received which messages). QOS 2 is particularly taxing on both the broker and the client.

There is good info here in the MQTT Essentials documents
https://www.hivemq.com/docs/4.2/hivemq/introduction.html

hmm, i installed the program and noticed something odd.

In the Hub i changed the topic from “Homey-(longID)” to “Homey” (since i only have 1)

The MQTT Explorer showed 2 homey topics under the homie topic.
I removed the Homey-(LongID) topic so perhaps this is the culprit?
image

on hindsight, it should not be a problem since it’s a different topic…blergh (don’t mind me)

They would both be showing because they are retained - if you select the top level of the one with the long ID you can delete the retained messages under that topic from the broker using the trash can icon with the red # messages indicator. Although in your screenshot there is only one homey topic showing under homie/

image

You should use homie/homey/… you can’t do away with the homie top level if you wish to be compliant with the spec. However in homey/hub/status there is just the hub status.
Of course being homie spec compliant may not important within your current nodeRED project - unless you’re using the new homie nodeRED plugin which requires compliance.

Whilst this is true … there is a caveat in the MQTT 3 and 5 specification it seems.

  • 3.3.1.3.
    If the Server receives a QoS 0 message with the RETAIN flag set to 1 it MUST discard any message previously retained for that topic. It SHOULD store the new QoS 0 message as the new retained message for that topic, but MAY choose to discard it at any time-if this happens there will be no retained message forthat topic*

So it seems it MAY discard such messages if it decides to ! So really QoS=1 is better. I guess this means if broker storage becomes a problem rather than throwing an error.

QoS=1 requires that clients acknowledge receipt of messages … (and have support for that capability)

Hi all,

when I publish my MQTT messages via Homie convention every device in openhab I link to the Items is under the group homey… Is this normal or can I change this anywhere?
Because I would like to make some different categories than Bad / Living Room Aso…

I have not been able to figure out was was going on. I have decided to uninstall the mqtt app and have moved home assistant as the mqtt client. Sorry to see I did not receive a single reply.

Hi
I really like the idé of this app. I installed it 3 days ago and it worked for about 1 day. After that my Homey got Offline and I had to reboot it by pulling the plug. After som testing I found that as soon as this app starts the Homey goes offline. There is no time to change what devices I want mqtt hub to update because Homey hangs directly. I tried to uninstall it yesterday and after that my Homey worked as usual. Today I tried to reinstall the app to be able to change the settings and try to just transfer the most important devices only, but as soon the app has started after installation the Homey get offline.
I alse looked at memory and CPU usage of the app and found the memory to be about 30-35mb.
I´m not sure what I can do more to get this app working.

I have a std Homey (2016) with latest stable firmware.

//Peter

@HarriedeGroot ^^

I’ve never seen this. Do you have a lot of apps installed using a lot of CPU - at startup (only) MQTT Hub uses a lot too. I assume you waited a bit too ? Does your MQTT tree start populating with anything from Homey ?

Did you uninstall , reboot and reinstall the MQTT Client too (just as an extra option) ?

It sounds like maybe a retained settings issue - I believe if you have the ‘release’ version of MQTT Hub and then install the ‘beta’ it wipes settings, and vica versa - that’s maybe another option to try. Do reboot after uninstalling.

Try disabling your MQTT server and reboot homey. In my case the MQTT traffic is quite intense and can interfere with the startup of homey, resulting in homey going offline. “Reconnecting…”

i’m building a NodeRed dashboard (or at least trying to) and i’d like to put a small graph on the interface depicting my power usage (youless p1 monitor) and my solar production (App: Solar Panels)
I added a device to homey (SolarEdge device) and i was in the assumption that MQTT Hub would pick it up and blast it on the MQTT channel.

However, the device is not in the devices list so i’m unable to broadcast the values.

(Now, i could check with the solaredge api directly but…they have a 300x api request/day limit and when querying from both homey and NodeRed i reach the limit quickly :frowning:)

For me it works, my mqtt is running on a pi. And hub is publishing data from homey enelogic app.

Anternative can be the nodered youless library (add as panel) used to read the ls120 direct.

I have been trying to recreate something similar… So the Tradri E27 RBGW with a node red dashboard RGB wheel. However, i cant seem to find the correct way to send topics. I have tried several options, but none is working. Last one based on HSV command. Could anyone help me on this?

Last option was based on splitting, joining and generating a correct format. Tried RGB and HSV.
Tried sending to homie/homey-topic/rgbwe27eettafel/color/hsv but didnt seem to work.
also tried to seperate all MQTT sequences, into homie/homey-topic/rgbwe27eettafel/color/H … etc.

Not 100% sure if this should be here or on the Node red page - appologies for this if incorrect.

[{"id":"dad6cc35.7253d","type":"split","z":"6838f0de.4c5c","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":510,"y":220,"wires":[["bb1a1120.e115a"]]},{"id":"bb1a1120.e115a","type":"join","z":"6838f0de.4c5c","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":720,"y":220,"wires":[["8bb4f88d.b87528"]]},{"id":"760c9a30.0ae344","type":"ui_colour_picker","z":"6838f0de.4c5c","name":"","label":"TESTES","group":"31f2e637.9d73ea","format":"hsv","outformat":"object","showSwatch":true,"showPicker":false,"showValue":false,"showHue":false,"showAlpha":false,"showLightness":true,"square":"false","dynOutput":"false","order":3,"width":0,"height":0,"passthru":true,"topic":"","x":290,"y":220,"wires":[["dad6cc35.7253d"]]},{"id":"8bb4f88d.b87528","type":"function","z":"6838f0de.4c5c","name":"rare opmaak maker","func":"var h\nvar s\nvar v\n\nh = msg.payload[0]\ns = msg.payload[1]\nv = msg.payload[2]\n\nmsg.payload = \"{\" + \"\\\"h\\\":\" + h + \",\" + \"\\\"s\\\":\" + s + \",\" + \"\\\"v\\\":\" + v + \"}\"\n\nreturn msg;\n\n//{\"r\":255,\"g\":0,\"b\":0}","outputs":1,"noerr":0,"x":890,"y":220,"wires":[["aca376a2.8a3278","7794178a.07cd28"]]},{"id":"aca376a2.8a3278","type":"debug","z":"6838f0de.4c5c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1090,"y":220,"wires":[]},{"id":"7794178a.07cd28","type":"mqtt out","z":"6838f0de.4c5c","name":"","topic":"homie/homey-topic/rgbwe27eettafel/color/hsv","qos":"","retain":"","broker":"84b6add6.23c45","x":910,"y":360,"wires":[]},{"id":"31f2e637.9d73ea","type":"ui_group","z":"","name":"test","tab":"f182df50.a047c","disp":true,"width":"4","collapse":false},{"id":"84b6add6.23c45","type":"mqtt-broker","z":"","name":"Homey MQTT","broker":"192.168.1.118","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"f182df50.a047c","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]