[RELEASE] Hubitat MQTT Link

Hmm, can you try removing the devices from MQTT Link and re-adding them?

I have not experienced this problem so it is hard to troubleshoot.

I love Shelly's! I have 25 installed in my house but I use either the Shelly mobile app or Home Assistant to control them.

MQTT Link is meant to allow control of devices installed in Hubitat, not for controlling external devices. There could be a Shelly HE driver out there but I have not used it. Even if there is one, I'm not sure the driver would communicate with a Shelly via MQTT or their REST api.

What I actually would like to do is to get my Shelly 2 (which is already installed on my HE) to get the power consumption reported when it changes. The drivers for Shelly only updates when a switch is toggled or on a fixed time starting from 1 minute.
I was hoping that I could be able to get values as they change reported to my HE over MQTT. Do you think that’s posible?

That's made HE push updated values to MQTT as they happen. Some devices update when I do a publish to switch, others don't. One's that respond to switch, don't to level though. Something odd going on. They're all hueBridgeGroup devices.

Would I have the ability to view or possibly control a device in HA through Hubitat? Meaning a device that is setup on the HA side would have a mirror or copy in Hubitat similar to HubConnect?

@toby yes this is exactly why I use MQTT Link. My HE devices report to my MQTT broker and HA listens for those events. They can also be controlled from HA as well.

It really depends on how the HE driver reports the changes so if it is limited by time or event then you're stuck with that.

What exactly are you trying to do that requires you to get energy monitoring in real time? An alternative might be to ditch HE altogether and just use Shelly's built in MQTT support.

I'm actually looking for the reverse direction. I have devices in HA that I would like to see/change from Hubitat

1 Like

Sorry, MQTT Link reports HE events outbound and controls inbound. I am not sure of any tool that allows the other way around.

The (my) MQTT app supports this using HAStatestream to discover and import devices from HA via MQTT. It doesn't support all devices but it does handle the common ones.

(HA doesn't support the HA MQTT Discovery protocol for exposing it's own devices)

Is there something which controls the speed at which it publishes to MQTT? I can see the topics being written to, but there is a significant delay it sends the updates. Am I missing something with a setting?

I'm hoping for something near-realtime to send the messages to MQTT so I can feed those updates into a node-RED workflow and trigger some other action to then be picked up by a virtual device in Hubitat for processing.

It should be near instantaneous when a device changes state. There is also a 60 second refresh to pick up state that hasn't changed.

I downloaded your MQTT LInk and added a three sensors to the app and one of the sensor that is not working is the Zigbee Light and I'm using the switch portion to switch off and on in the link app. On the hub when I go to the device page of the light and switch it off/on I can see the change in the MQTT Explorer, however if I'm using the node red flow I can see the change in MQTT Explorer but for some reason unknown to me it isn't passing it to the hub and revert back to what the hub is set t at the time whether it's off or on?

I have basically three items in the MQTT Link 1 Zigbee outlet, 1 Virtual Switch and 1 Zigbee Bulb all are working except for the Zigbee bulb? Is there something that I can do or change to get the bulb working? Thanks

@leeonestop I have not used NodeRed but, as long as it is able to receive from and publish to the MQTT broker then it should work.

Try going back into the MQTT Link app and removing the bulb from the selected devices. After it is removed, go back in and re-add it.

If you are using the switch to turn the bulb on / off then you'll need to publish either an on or off message to the switch action similar to this

hubitat/home-hub-000d/zigbee-bulb-1121/switch

In MQTT Explorer, go to the Publish area, specify the full topic, set the payload type to raw then enter one of the string values either on or off.

@tpc77 Thanks for getting back to me yes, I have done all you have suggested before I wrote and again after suggested it. I still haven't had any luck with that light. It is not a big deal I was just curious if there was something that I wasn't doing as I'm new to the MQTT. I have try in the past but no luck but with app I can control the other sensor and I'm going to more. Thanks

@leeonestop I have a few more questions:

What driver (type) are you using to define the device?
Are you able to turn on / off the bulb from device page in HE?
What is reported in MQTT Express when you turn on / off the bulb (screenshot)?

Sure here is the info. Here is how I set it up in the Mqtt Link App.

and here is the driver on the device page.

When I turn off/on the bulb from the device page it show corrected in the Mqtt Explorer and makes the changes. When I turn off/on the bulb in node red I see the change in the MQTT Explorer but around 30 seconds it flip back to the last setting from the device page? I'm unsure why it dosen't pass the info to the Hubitat Hub device like the other two does which is a Zigbee switch and a Virtual switch.

@leeonestop You can check to see if the MQTT Link driver is receiving the message and passing it to the MQTT Link app. If that communication is happening successfully then it could be something within the Generic ZigBee RGBW Light driver.

  1. Open up the MQTT Link app and on the first page ensure that Enable debug logging is turned ON.
  2. From MQTT Explorer try to send an on / off message to the bulb
  3. In HE under Advanced on the left hand menu click Logs then click the Show Past Logs button then choose MQTT Link for the list at the top.

There should be two entries at the top that looks similar to this.

[mqttLinkHandler] MQTT incoming target action: [device:zig-light-1123, type:switch, value:on, action:actionOnOff]
[mqttLinkHandler] Received inbound device event from MQTT Link Driver: [device:zig-light-1123, type:switch, value:on]

The bottom item will confirm that the MQTT Link driver properly communicated the incoming message from the broker to the MQTT app.

The top item will confirm that the device type and action were located in the lookup table and that the proper value was passed to the appropriate action method.

Once the action is called, it's up to the device driver to field the native HE event that gets triggered by the MQTT Link app.

Feel free to paste what shows up in your log and I can help translate.

Here the log. I turn it on and off about three times? I don't see it in the logs?

@leeonestop That is strange. Seems as though the message is not being relayed to the app.

Can you open the list of apps and click the gear icon to the left of the MQTT Link entry

image

Can you take a screenshot of what it shows for the bulb under the Settings area and a second screenshot showing what is listed under the Event Subscriptions?