MQTT Hub/Gateway

This is a pure HA error? Maybe the home assistant community can help you with that particular error?

Does the HA system log contain some additional info? If not, I would try to enable debug logging for the HA mqtt integration.

Did you restart both Homey apps? Client & Hub?
What is the version of the MQTT Cliënt app?

thanks for helping troubleshoot. i’m running v3.0.0 of the Client app and have tried restarting both hub and client several times (as well as HA and the MQTT Broker on HA)

It’s weird because it seems like it connects for a couple mins but then everything just dies out. and i’m not sure which log to check.

Here’s from the log in the MQTT client:

20210428-18:33:48 received ‘Master Bedroom (Julie) - Turned on’ on ‘homie/homey/master-bedroom-julie/onoff/$name’
20210428-18:33:48 MQTT Offline
20210428-18:33:48 The MQTT broker is UNAVAILABLE
20210428-18:33:48 Broker State: DISCONNECTED
20210428-18:33:48 MQTT Closed
20210428-18:33:48 Broker State: DISCONNECTED
20210428-18:33:48 Failed to unsubscribe from topic homie/homey/#
20210428-18:33:48 Error: Connection closed
20210428-18:33:48 Failed to unsubscribe from topic homie/$broadcast/#
20210428-18:33:48 Error: Connection closed
20210428-18:33:48 Failed to unsubscribe from topic homey/$command
20210428-18:33:48 Error: Connection closed
20210428-18:33:48 failed to subscribe to topic homey/$command
20210428-18:33:48 Error: Connection closed
20210428-18:33:48 Failed to unsubscribe from topic homeassistant/status
20210428-18:33:48 Error: Connection closed
20210428-18:33:48 failed to subscribe to topic homie/homey/#
20210428-18:33:48 Error: Connection closed
20210428-18:33:48 failed to subscribe to topic homie/$broadcast/#
20210428-18:33:48 Error: Connection closed
20210428-18:33:48 Failed to unsubscribe from topic homey/$command
20210428-18:33:48 Error: Connection closed
20210428-18:33:48 Failed to unsubscribe from topic homie/homey/#
20210428-18:33:48 Error: Connection closed
20210428-18:33:48 failed to subscribe to topic homie/homey/#
20210428-18:33:48 Error: Connection closed
20210428-18:33:48 Failed to unsubscribe from topic homie/$broadcast/#
20210428-18:33:48 Error: Connection closed
20210428-18:33:48 failed to subscribe to topic homie/$broadcast/#
20210428-18:33:48 Error: Connection closed
20210428-18:33:48 Start topic subscription homie/homey/#
20210428-18:33:48 Start topic subscription homie/$broadcast/#
20210428-18:33:48 Start topic subscription homey/$command
20210428-18:33:48 Start topic subscription homeassistant/status
20210428-18:33:48 Start topic subscription homey/$command
20210428-18:33:48 Start topic subscription homie/homey/#
20210428-18:33:48 Start topic subscription homie/$broadcast/#
20210428-18:33:48 successfully subscribed to topic homie/homey/#
20210428-18:33:48 successfully subscribed to topic homie/$broadcast/#
20210428-18:33:48 successfully subscribed to topic homey/$command
20210428-18:33:48 successfully subscribed to topic homie/homey/#
20210428-18:33:48 successfully subscribed to topic homie/$broadcast/#
20210428-18:33:49 MQTT Reconnect
20210428-18:33:49 Broker State: RECONNECTING
20210428-18:33:49 The MQTT broker is AVAILABLE again
20210428-18:33:49 MQTT client connected
20210428-18:33:49 Broker State: CONNECTED
20210428-18:33:49 successfully subscribed to topic homey/$command
20210428-18:33:50 successfully subscribed to topic homeassistant/status
20210428-18:34:50 getLogLines called

I would first try to figure out if it’s a Homey or HA issue. Don’t know for sure because of the error in HA and the PTP of Homey. Maybe send some messages using MQTT explorer to test which system doesn’t respond?

The log says you get disconnected from the broker. Meaning the problem is MQTT client <-> HA broker.
Can be instable Homey wifi…?
Some people report issues with the usb cable/power connector, but no clue if that’s of any influence here.

Restart your router (you never know…)

hmm, i mean homey seems to be working like normal. now i just wish i hadn’t pulled the plug! everything was working great and i could live without the BLE beacon.

yeah will give it a go :crossed_fingers:

ok! a restart of the router seems to have helped. devices are connecting to and are controllable through HA again. I’m having an odd issue where when i click a toggle in HA it will, for instance, turn a light off but then the toggle will revert back to its original position and i have to double click it in order to turn the light on again. could this be related?

I cannot think of any reason how those issues can be related, but who knows…

Great you’re up-and-running again!
Have fun.

yeah. who knows :man_shrugging: just glad that it’s back up and running in some capacity. will trouble shoot some more tomorrow. thanks for your help, much appreciated :slight_smile:

@HarriedeGroot:
I am a bit of a MQTT-newbie, so I hope I answer your questions correctly… :slight_smile:

This is what is shown in MQTT explorer:
MQTT_Explorer
Value color set = 420 is set by HA. But does not pass through to Homey.
When I change color temperature in Homey, nothing in MQTT Explorer seems to change.

I hope you mean this (?):

Hmm, if I only knew how… :-/

Just an idea/suggestion. It would be really nice if it was possible to post (BetterLogic/Logic) tags to mqtt, with HA auto discovery functionality.

I have a lot of BetterLogic booleans that I would like to export to HA as switches, and strings that I would like to export as sensors. Ideally it would be possible to create a MQTT device and choose what HA domain it would have and then just choose what tag to use, and it would automatically send data when the tag is updated.

@Henk_Renting Your screenshot of the topic tree in mqtt explorer only shows the properties ‘onoff’ and ‘dim’.
What capabilities are available for this device?
This info can be found here: Homey Developer
Is there a ‘color’ capability?

@rindler you can create a MQTT Device or Virtual Device and update the capabilities using a flow?

  1. If logic tag changed => set device capability value.
  2. If device capability changed => update better logic tag.

Virtual (mqtt) devices are available for HA discovery. The values will be automatically send over mqtt by the Hub in both directions.

In general: (correct me if I’m wrong) tags are part of the Homey flow system. Devices/apps operate on their own tags, but have no knowledge of tags of other apps.

Do you know any other app with the ability of selecting (better logic) tags when adding a new device?

Is it possible for an app to get a list of all tags? And also be able to listen to changes & update the value?

@Henk_Renting I don’t know for sure if this is the correct formula for the color temp calculation:
Homey color temp = (({value_from_ha} / 100) * (500 - 153)) + 153

Does it (still) work for Philips Hue bulbs?
Probably the min & max mired values of the IKEA bulbs differ from the values of the Hue bulbs?

The correct calculations can probably be found here:

@HarriedeGroot
Thanks for the extensive answer. Hopefully the following information is helping?

These are the capabilities in the developer site. I guess the one you are referring to is “light_temperature”

Unfortunately I have no Hue (or other) bulbs to test; sorry.
Perhaps there is another Community member who can help us out there?

It seems max color temperature in Homey ranges from 0 (most white/cold) to 1 (most yellow/warm).
In Home Assistant these ranges are from 153 (most white/cold) to 500 (most yellow/warm).
So I suppose you are right that the calculations are incorrect or at least the values don’t seem to correspond.

‘light_temperature’ is indeed the capability we’re looking for. The strange part: this capability isn’t provided as a mqtt homie propery for your light (mqtt explorer screenshot).

Dank je Harrie. Ik wou dat ik kon programmeren… Ik vind het geweldig dat er vrijwilligers zoals jij zijn die het voor iedereen beter maken. Top!