MQTT Hub/Gateway

Do use your own mosquito broker and not the internal / Homey App. This is because the internal one doesn’t support retention of payloads.

It is quite complicated to configure message exchange between your mosquitto and internal MQTT client, which you will eventually need - it’s better to connect your homey client to external mosqitto and live with just one broker.

Question, i’ve setup the connection between Home assistant and Homey. i can toggel devices and get all readings of temprature sensors. i’ve put al sensors in the respective areas and am trying to make use of the new area card Area Card - Home Assistant the lights and switches are displayed, but the temprature isnt (there are multiple temprature readings in the specific area). anybody has an clue or hint?

Since a while, I am having difficulties with MQTT in combination with Home Assistant (for dashboard purposes).

At some point HA seems to loose connection with Homey. Devices freeze in HA, cannot be switched on/off (the switch then automatically returns to it’s previous state without any change in Homey) and changes in Homey don’t come through to HA.

Only thing that helps is turning off all devices in MQTT Hub, broadcasting, switching all devices back on and broadcast again.
Previously I used the MQTT broker on my Synology NAS, but have switched now to the MQTT broker as app on my Homey: same problem.

Anyone any idea how to solve this?
I have made and send in a diagnostic report, if @HarriedeGroot would be so kind to help as well…

I’ve seen this behaviour only after restart of HA. Could be also after Homey restart (not sure about this).
In this case I have to send all devices again with a broadcast.

Seems a great tip, thx!
A Watchtower script automatically updates my Docker containers and therefor the HA container too. HA did get an update today and with manually restarting the HA container I can reproduce the error now. Triggering a new broadcast doesn’t help in that case, restarting the MQTT Hub app does.

For now I have set a mailnotification when HA is restarted (i.e. after updating) to see if that really is the problem. If so I can have HA trigger restarting the MQTT Hub in Homey.

That will eliminate the symptom, but will not eliminate the problem itself. Anyone know a solution how to make sure HA is reconnecting correctly to Homey (via MQTT) after a restart?

@Henk_Renting

Are you using the Homey internal MQTT Broker, the HA addon broker or an external broker ?

I have the same behaviour when using an external MQTT Broker (in Docker on my Synology NAS) and using the Homey MQTT broker app

OK - The Homey internal broker doesn’t support payload retention so you get this behavior of requiring a new broadcast. Your ‘external’ one I assume does so that should have fixed it.

But as said, my external Broker on my Synology NAS gives the same errors. That’s what started the problems and changing to the Homey MQTT Broker app did not solve it…
Or am I misunderstanding you?

I use the so called Birth and Last Will functionality.
So when Homey or HA comes (back) online, this gets noticed and then a broadcast is started.

Homey:

.
HA (I changed the topic to homeassistant/status)

Not sure if this flow is needed:

I have the same behaviour, fixed it with a workaround: created a virtual button in Homey which will restart MQTT Client app and MQTT Hub app (in this order). This is the flow: Gedeelde Flow | Homey

The virtual button is available in HA, created an automation to trigger this 1 minute after every HA restart. This will work, because sending commands from HA to Homey is working, only the feedback is missing.

At the moment the button is unfortunately displayed as a switch in HA, made a feature request to fix this :wink:

You mean you can operate devices from HA then? In my case I cannot operate them too. So a switch Homey wouldn’t be effective. I’d rather use a webhook for triggering the flow in Homey.
Unfortunately cannot find an option to send a webhook from HA.

I can operate from HA to Homey, however status is not broadcast from Homey to HA. Have been experimenting with birth and last will, not working for me

The same over here, Mosquitto (on docker, or the same in synology) Docker log log says:
New client connected from 192.168.2.25:43540 as homey_8b525af3 (p2, c1, k30).
Client homey_8b525af3 disconnected due to malformed packet.
Cant find any reason why suddenly this malformed packet showed up
MQTT explorer has no problem with connection to the broker.

Went back to the homey broker and everythings works as before. Something must have been changed in the latest version of Mosquitto , I will see if I can found out wihich version I used before

To everyone experiencing the same problem as me (having to rebroadcast/restart MQTT Hub after HA restart):

I now notice that this also needed (in my case at least) after a restart of Homey. I’ve made a flow for this:

Hello,

Had someone also when you restart the app some lights go on when broadcast?

Delete the app already and install back but same result…

So hope someone has any idea for this…

Thanks

Marcel

Hello,

I am struggling with the JSONPATH.
The data I am trying to read looks like follows:
tele/Garagentor/SENSOR {"Time":"2022-01-08T18:21:06","SR04":{"Distance":3.561}}

I want to read the distance, which is a HC-SR04 ultrasonic sensor measuring the position of my garage door.
So, please, what would the the right/appropriate sensor type? (it is a floating value)
And what is the correct JSONPATH?

It is a Tasmota flashed device, but the Tasmota App does not recognise my sensor. Therefore I am using MQTT Hub, just in case you where wondering.

Regards, Meta

I’ve checked my config and it seems to be ok.

HA:

Homey:

So HA should send hass/status in restart and Homey-MQTT-Hub should react on it and reconnect (or resend all device attributes.

It seems, that the MQTT Hub reacts on the HA status and is boradcasting the data:

But even with this broadcast it’s not working. The devices in HA are only refreshed if the value changes in Homey.
Example: the first valve got updated in Homey and it’s synced with HA. The others are not visible in HA after the broadcast.
grafik

To get all states visible in HA, the MQTT hub app needs to be restarted.

@HarriedeGroot
Can you give us a hint why the states are not broadcasted to HA after a HA restart?
Is there something I can test - or some settings I missed?
Many thanks.