Integration Solutions using MQTT

I can provide support for just about any device type that you need. A basic light is just a switch, so you could always create a switch device and change its icon to be a light :slight_smile:

1 Like

is anyone using this with home assistant? and if so how? has anyone installed a mosquitto broker or do you need a separate device? and then how do you see your devices from st in ha? does it work both ways? or is it just ha see states change of st devices?

i have managed to recreate it myself lol, i was making a backup of my pi sd card , after trying the new card and putting the old card back in the mqtt on smartthings is not working again.
? Select a driver. 7
2022-11-22T16:13:56.430896124+00:00 TRACE MQTT Devices V1 Received event with handler capability
2022-11-22T16:13:56.442244582+00:00 INFO MQTT Devices V1 <Device: 1a06768e-78d0-4029-982e-16135905efd6 (MQTT Device Creator V1)> received command: {“args”:{},“capability”:“partyvoice23922.refresh”,“command”:“push”,“component”:“main”,“positional_args”:{}}
2022-11-22T16:13:56.445644290+00:00 TRACE MQTT Devices V1 Found CapabilityCommandDispatcher handler in MQTT Devices
2022-11-22T16:13:56.448573415+00:00 INFO MQTT Devices V1 Refresh requested
2022-11-22T16:13:56.452546582+00:00 ERROR MQTT Devices V1 MQTT Device Creator V1 thread encountered error: [string “st/dispatcher.lua”]:233: Error encountered while processing event for <Device: 1a06768e-78d0-4029-982e-16135905efd6 (MQTT Device Creator V1)>:
arg1: table: 0x1f03b98
[string “cmdhandlers.lua”]:50: attempt to call a nil value (global ‘init_mqtt’)
listening for logs… done

C:\Users\monty>

Thanks. This one looks like a different issue from the one you posted earlier.

In this post, it looks like the driver was no longer connected to the broker and so when it was trying to publish messages, they were failing.

In this more recent log there is a driver error which I could have sworn I already fixed!

I checked the channel and it was still showing the previous driver version(!), so I’m thinking that somehow my last update didn’t get pushed out. I just submitted it again: Version 2022-11-20T02:05:26.759176946, so please confirm that you get it, and let me know if you continue to see any errors.

just updated the driver and no errors at all .
thank you
martin

Hi Robert - as no one has responded, let me offer a couple thoughts even though I’m not familiar with HA:

  1. I don’t know if Mosquitto comes with HA or is possibly an add-on. Regardless, installing the Mosquitto broker is very simple. You could probably install it on whatever you are running HA on (Raspberry Pi)? Or you could put it on a separate machine. You just need something that is going to be online all the time.

  2. If you have an IOT device that published MQTT messages, you could have both HA and SmartThings act on those messages simultaneously.

  3. If you set up an MQTT device in SmartThings using my driver, then those devices can publish MQTT messages whenever a command is issued (switch on/off, etc.). If you have a driver/plugin/or whatever they are called in HA, that can be configured to look for certain MQTT topics, then this is one way you could have HA “see” your SmartThings MQTT devices.

  4. Conversely, if you have HA devices that publish MQTT message to a certain topic, then you could configure a SmartThings MQTT device to also look for those messages and act on them.

The net is that as long as something is publishing MQTT messages, then you can generally configure an MQTT-enabled app to receive and act on those messages. MQTT messages are all sent using a “topic” which is basically a structured way to categorize messages. You just need to know what topic is being used for the messages you are interested in.

EDIT: There is one more scenario I’ll mention but it may involved more than you want to get into: I have a SmartApp that can run on a local machine that can publish MQTT messages for just about ANY SmartThings device. They don’t have to be specifically MQTT enabled. It works by subscribing to whatever device types you choose and whenever a state change happens it publishes an MQTT message on a particular topic. Again, if you have an HA function that can be configured to look for certain MQTT topics, then this is another way to integrate ANY SmartThings device. The downsides are that it involves more setup and it relies on the Cloud, so is not 100% local.

2 Likes

Hey Todd, sorry, have been flat out at work so unable to respond earlier. That last update has seemed to work perfectly. I have one last issue that you may not be able to help with. Devices created with MQTT Devices app are not visible to ActionTiles but I’m assuming this is an ActionTiles issue because another legacy smartapp, WebCore can see them fine. If I find an ActionTiles solution I’ll post it here in case anyone has the same issue. Thanks again.

Yes I’ve heard of similar problems with ActionTiles and hopefully they’ll be updating their app to the new platform. In the meantime I think they will recognize devices with certain capabilities so there are some things you can do to make devices visible.

I was wondering if it had anything to do with how AT saw contact sensors so I created a vEdge device as a contact sensor and AT sees it just fine. Conclusion was that AT sees contact sensors OK.

But went one step further and created a ST routine that when MQTT contact device is open, then set vEdge contact device to “On”. I noticed in routine set-up the vEdge device shows states as On/Off, not Open/Closed as a contact sensor would despite setting it up as a contact sensor.

So maybe AT does have an issue with contact sensors since the vEdge device is acting more like a switch in ST than a contact sensor. I’ll open a case with AT to see if they can comment.

The vEdge contact device has a switch to control the state of the contact. That’s the only way to affect the open/closed state of the contact device. And the switch is the only control that appears for automations, but it will automatically sync the contact.

Hi @TAustin , where can i get my hands on the source code for your MQTT Test driver? I dont see it in your github repository.