Integration Solutions using MQTT

@fooktheta @dime

If the create button doesn’t clear up for you after restarting the app, then you may have to delete the device creator device and re-create with an Add device / Scan for nearby devices. DO NOT delete your other MQTT devices - just the device creator. Once it is recreated, and you re-enter your broker authentication and IP, it should be ok.

I’m sorry for the trouble; I just have not found a reliable way to update a list selection button to an existing device…

Deleting and readding did the trick!

Don’t you dare apologize! I will delete and readd as many times as I need to this is such a game changer

1 Like

Overall
Here’s some feedback after even more testing - as I’ve said before, my excitement level for this is an 11 out of 10 so you’ll have to forgive me for wanting to do whatever I can to help make this possibly THE most useful edge driver out there. By no means are these nitpicks or criticisms, I just don’t want to leave any stone unturned and hope others will chime in with great suggestions and ideas. And most of all, my feedback is filled with a huge sense of gratitude.

From a functionality standpoint, I would suggest removing all max character limits from every field. I’ve documented below the devices that have limits as well as a few ideas to enhance the great work that you’ve already done. Without further ado…

Switch
Has character limits for subscribe, switch on, switch off and publish topic

Dimmer
There doesn’t seem to be a quick on/off toggle on the tile or on the second level page like the Matt switch has

Possible enhancement - allow for an adjustable max level since some dimmers can only go to 99 while others use a 0-254 scale. A huge annoyance since my dimmer goes to 99, so I have to carefully slide the slider over to 99 - if I go too fast and swipe to 100…it just reverts back to whatever it was pre-swipe.

Possible enhancement with either defined (0,25,50,75,100) quick buttons or user customizable quick preset buttons (maybe I want to have a 69% preset for some reason)

Momentary Button
Has character limits for subscribe, button pressed, button held, button double, button triple and publish topic

Contact Sensor
Has character limits for subscribe, contact open and contact closed

Motion Sensor
Has character limits for subscribe, motion active and motion inactive

Alarm
Has character limits for subscribe, alarm off, alarm siren, alarm strobe, alarm siren+strobe, and publish topic

Possible enhancement with a separate top level status field that would display if Arming, Armed Away, Armed Home, Armed Night, Armed Vacation, Disarmed, Pending, Triggered (these are what the amazing Alarmo add-on for Home Assistant uses for example)

Possible enhancement with single button at the top for quick arm away

Possible enhancement with single button at the top for quick disarm

If you’re taking requests, my priority devices that I’d like to see included would be:

  • Lock
  • Regular non-dimmer light
  • Water leak sensor
  • Presence sensor
  • Vibration sensor

Edit
After testing the contact and motion, it appears my json payloads are coming in as booleans (true/false) which for some reason aren’t triggering the mqtt devices I created. I rebuilt the payloads in node-red to come in as “true” and “false” and that did properly trigger the mqtt device in SmartThings. Is there anyway to allow for boolean json payloads as well?

1 Like

Awesome feedback! I very much appreciate it and the spirit in which it’s given.

The subscribe topic character limits should have been removed in this last update. You might still see them in existing devices, but any new devices shouldn’t have them

Dimmer: well I guess we got our wires crossed; I thought I understood that you didn’t want a switch included in the dimmer.

I can look at the dimmer scale. The problem is going to be that the SmartThings capability is 0-100 and doesn’t allow for anything different. I could possibly map other scales like 0-254 to 0-100 so that they would still work within that range. But setting a max 99 should be doable.

Alarm - you are really looking for a customized security panel :slight_smile:

Your priority device types is very helpful.

Boolean JSON values: I should be able to make that work.

1 Like

Wow!!! MQTT Device Creator is pretty solid. I’ve been playing with this along with ring-mqtt and it is a very promising integration option for my Ring alarm sensors and Ring lighting devices! I tested it with a ring landscape light controller and a motion sensor and successfully got state updates as well as the ability to turn the landscape lights on and off. I’m definitely following this to see where it goes.

I did have to create a copy of the github repo locally to get around the character limits and use the CLI to install in my hub. In my case at least, the topics fields default to 32 characters. I specified a 255 character limit in my case and that got me what I needed to test! With this one change, everything that is here seems to work really well!

Looking forward to seeing how this evolves. I think you have a winner here.

1 Like

Is there a reference or resource you followed to do this? I’d like to do the same to test a few things out as well

@foxxyben
I really thought I fixed this topic character limit already! I’ll double check shortly and get a driver update out if needed.

UPDATE: Please make sure you are installing the driver from this channel, and not my alternate test channel. I just removed an earlier version from that alternate test channel so as not to cause confusion.

Also please confirm that you have driver version: 2022-10-21T02:01:51.252609927. I have double checked, and the topic character limitation should be removed from any newly created devices.

1 Like

I just confirmed I’ve been testing with the correct version. I’m on iOS in case that is a factor:


That’s really weird. I’m going to push out a driver update to see if that helps.

@foxxyben @fooktheta - I’ve changed the name of the device profiles to try and force an update. The new driver version is 2022-10-27T04:46:22.233738194, so please confirm you’ve gotten this update, then create a new device and see if the character limits are gone in device settings. (Existing devices may still have the character limits).

Thanks.

1 Like

That update has worked for me!! Thanks a ton. This is going to be gold.

2 Likes

hi would it be posible to have a mqtt sound sensor device .
thanks
martin

At first, I was thinking, sure, but if there were such a capability in SmartThings. Then I looked and there is!! It’s a simple detected vs. not detected sensor; is that sufficient?

hi the only problem i think is the sensor produces a lot of msg’s the payload being the higher the number the louder the sound .
ie-
2022/10/27 23:41:39Z INFO [msg] {“topic”:“sound_sensor”,“payload”:11,“qos”:0,“retain”:false,“_msgid”:“66c511c50270c278”}
2022/10/27 23:41:39Z INFO [msg] {“topic”:“sound_sensor”,“payload”:8,“qos”:0,“retain”:false,“_msgid”:“8ad526c89fa3a7ec”}
2022/10/27 23:41:39Z INFO [msg] {“topic”:“sound_sensor”,“payload”:5,“qos”:0,“retain”:false,“_msgid”:“e267d2078326d28f”}
2022/10/27 23:41:39Z INFO [msg] {“topic”:“sound_sensor”,“payload”:2,“qos”:0,“retain”:false,“_msgid”:“87a32af3fb4eb3f0”}
2022/10/27 23:41:39Z INFO [msg] {“topic”:“sound_sensor”,“payload”:5,“qos”:0,“retain”:false,“_msgid”:“b8faf0d3ab585026”}
2022/10/27 23:41:39Z INFO [msg] {“topic”:“sound_sensor”,“payload”:8,“qos”:0,“retain”:false,“_msgid”:“0ced26fa1e6a515a”}
2022/10/27 23:41:39Z INFO [msg] {“topic”:“sound_sensor”,“payload”:12,“qos”:0,“retain”:false,“_msgid”:“acd6b7945b7f409d”}
2022/10/27 23:41:40Z INFO [msg] {“topic”:“sound_sensor”,“payload”:8,“qos”:0,“retain”:false,“_msgid”:“0a9771e412d4e1e7”}
2022/10/27 23:41:40Z INFO [msg] {“topic”:“sound_sensor”,“payload”:4,“qos”:0,“retain”:false,“_msgid”:“e886024384eeb695”}
2022/10/27 23:41:40Z INFO [msg] {“topic”:“sound_sensor”,“payload”:7,“qos”:0,“retain”:false,“_msgid”:“75ef602168e714f0”}
2022/10/27 23:41:40Z INFO [msg] {“topic”:“sound_sensor”,“payload”:10,“qos”:0,“retain”:false,“_msgid”:“e687e3922b6d4720”}
2022/10/27 23:41:41Z INFO [msg] {“topic”:“sound_sensor”,“payload”:7,“qos”:0,“retain”:false,“_msgid”:“40455858b48e1d7e”}
2022/10/27 23:41:42Z INFO [msg] {“topic”:“sound_sensor”,“payload”:10,“qos”:0,“retain”:false,“_msgid”:“6b19052430bddac9”}
2022/10/27 23:41:42Z INFO [msg] {“topic”:“sound_sensor”,“payload”:7,“qos”:0,“retain”:false,“_msgid”:“0d9b2bee17eead8c”}
2022/10/27 23:41:42Z INFO [msg] {“topic”:“sound_sensor”,“payload”:4,“qos”:0,“retain”:false,“_msgid”:“259b8ebf10a81937”}
2022/10/27 23:41:42Z INFO [msg] {“topic”:“sound_sensor”,“payload”:8,“qos”:0,“retain”:false,“_msgid”:“0eef823455b93b45”}
2022/10/27 23:41:43Z INFO [msg] {“topic”:“sound_sensor”,“payload”:11,“qos”:0,“retain”:false,“_msgid”:“3ef6e8824dc74639”}
2022/10/27 23:41:43Z INFO [msg] {“topic”:“sound_sensor”,“payload”:14,“qos”:0,“retain”:false,“_msgid”:“24c27d2816db742d”}
2022/10/27 23:41:44Z INFO [msg] {“topic”:“sound_sensor”,“payload”:11,“qos”:0,“retain”:false,“_msgid”:“cbd70c60d16e7813”}
2022/10/27 23:41:44Z INFO [msg] {“topic”:“sound_sensor”,“payload”:7,“qos”:0,“retain”:false,“_msgid”:“2a49fa406c261957”}
2022/10/27 23:41:44Z INFO [msg] {“topic”:“sound_sensor”,“payload”:3,“qos”:0,“retain”:false,“_msgid”:“151d5af6b4d9faac”}
2022/10/27 23:41:44Z INFO [msg] {“topic”:“sound_sensor”,“payload”:6,“qos”:0,“retain”:false,“_msgid”:“5e7e7b12321e51a9”}
2022/10/27 23:41:44Z INFO [msg] {“topic”:“sound_sensor”,“payload”:9,“qos”:0,“retain”:false,“_msgid”:“74f7a11f05d75dc2”}
2022/10/27 23:41:44Z INFO [msg] {“topic”:“sound_sensor”,“payload”:12,“qos”:0,“retain”:false,“_msgid”:“c73fae72bdb9be4f”}

would it be posible to set it to turn on if the payload is say between 4 and 10 or something like that.
if i put its ip address in my browser i get this

if i add :8000 to the ip address i get ( This is a Websocket server only!)so is it websocket also?
im confused

Do you know what the max value could be?

The question I would have is would you want to capture the value as an attribute of the device, or are you only interested in defining a range for “detected” vs “not detected”?

Maybe- or just a simple http page. A device can provide both MQTT messages and a web interface.

So wanted to share a little of what I was able to get set up with this and my Ring devices for anyone interested in what could be done here. It is a little work to get it all going, but all the major use cases are covered!

For my setup, I’m using ring-mqtt for connecting to ring and Mosquitto for my MQTT broker. By watching the mqtt-ring logs, you can easily figure out what topic to use for each Ring device. Using that and extra documentation here, it’s pretty easy to figure out what to configure for listening to state changes and sending commands and such to control devices from SmartThings.

For my setup, I have the following (more than once in some cases):

Ring Landscape light controller: Works great with MQTT switch. Integration is bi-directional.

Ring Motion sensor: Works great with MQTT motion. Updates are pretty instantaneous.

Ring Contact sensor (windows and doors): Works great with MQTT contact device. Updates are pretty instantaneous.

Ring Smoke/CO sensor: I used the MQTT contact device, since there isn’t a device yet for Smoke/CO. I did have to create 2 devices for a single Smoke/CO sensor, one for smoke and the other for CO to get the full functionality.

Z-Wave door Lock: I have my Z-Wave lock connected to Ring. I set up an MQTT contact sensor to monitor the door lock state. I currently do not have it set up so the SmartThings can send lock/unlock commands to the door lock, although it could be done with an MQTT switch. One observation is that for locks, the state values are different from the command values (eg. Locked vs Lock), so getting state and sending commands is not currently available using a single device.

Ring Alarm: The existing MQTT alarm didn’t really fit the Ring alarm use case very well. Instead I created 2 MQTT switches. One switch turns on Arm_Away and the other turns on Arm_Home. Turning off either will disarm Ring. Like the locks, the state values are different from the command values (eg. armed_home vs arm_home). @fooktheta illustrated a pretty solid use case for Abode a few posts up around state that is also applicable to Ring. Anyways, the two switch setup works just fine for me for the time being!

Overall I am super happy with this! Getting my Ring devices to work inside SmartThings has been a much better solution than making a bunch of virtual switches for Alexa, or setting up a homebridge instance! @TAustin Definitely appreciate all the work that has gone into this!!

2 Likes

Yes working well on that aspect!

Couldn’t agree more…

2 Likes

i think its 100.
not sure what value as an attribute of the device is exactly but could it be shown so i could see in the tile the current sound level so i could set a range or something like that … thanks
martin