Integration Solutions using MQTT

@taustin,

I apologize for not explaining better.

I have bunch of mqtt supporting devices and mqtt broker in local lan which I have been using. I wanted to use your MQTT discovery driver to add into Smartthings.

Regarding the MQTT Handler/Discovery driver, have you read the README instructions?

Yes, I followed it in installed the driver. Scan for available devices and found MQTT discovery which is in ‘N9 room assigned’ assigned room.

saying you can’t even open up the MQTT Discovery device? Not sure what you mean by ‘nothing happens’, but if you can’t see the Controls screen or go into device settings to configure your broker, then that’s an app issue. Try exiting the SmartThings app and restarting it. Hopefully that will clear things up.

Yes, absolutely nothing happens when I click on MQTT Discovery icon. It does not open control screen, so no place for me to add my mqtt broker ip and Auth details.

I have rebooted hub multiple times and restarted device 2 times already.

1 Like

@nayelyz Could use your help on this one; see post above where device is not opening to the Controls screen.

Maybe a little off-topic (I apologize) but hopefully Todd or someone can point me in the right direction. BTW, this MQTT deployment AND the vEdge device creator is outstanding!

As mentioned above, I too use Node-Red as sort of the “Grand Central Station” for integrating devices into ST. I have audio devices that are controlled serially via hex and/or ascii and it has worked perfectly using Node-Red Smartthings webhook and the Node-Red serialport palette. But I fear that the Node-Red ST webhook may be disappearing shortly since it is a smartapp. This week I noticed that the momentary buttons stopped working. My first of the Four Horsemen of the Apocolypse?

Any suggestions on how I can get ST to send serialport commands either directly or through Node_Red in the event the Node-Red webhook app disappears?

Appreciate any insight anyone may have.

Here are my experiences of three days MQTT Devices driver’s testing.
Everything works great!

Two temperature measurements from MQTT broker to SmartThings are operating. Temperature measurements are updated every 15 minutes.

Two Zigbee temperature measurements from SmartThings to MQTT broker are operating. Temperature measurements are updated every time the measurement value changes in SmartThings’ hub. This is implemented using Rules API.

Switch from SmartThings to MQTT broker is operating.

@TAustin Can you also add humidity device to MQTT Devices driver.

1 Like

Yes I’ll add humidity device to the list for the next update.

Thanks for the report!

3 Likes

Would you mind sharing your Rule? Might be of interest to others how you send periodic updates for your zigbee sensors.

2 Likes

Rules API for Zigbee to MQTT sending (when Zigbee temperature measurement changes):

{
  "name": "Temperature Changes - MQTT",
  "actions": [
    {
      "if": {
		"not": {
			"equals": {
			"left": {
            "device": {
              "devices": [
                "id zigbee device"
				],
				"component": "main",
				"capability": "temperatureMeasurement",
				"attribute": "temperature"
				}
			},
			"right": {
            "device": {
              "devices": [
                "id mqtt device"
				],
				"component": "main",
				"capability": "temperatureMeasurement",
				"attribute": "temperature"
				}			
			}
			}
        },
        "then": [
          {
            "command": {
              "devices": [
                "id mqtt device"
              ],
              "commands": [
                {
                  "component": "main",
                  "capability": "partyvoice23922.vtempset",
                  "command": "setvTemp",
                  "arguments": [
                    {
                      "device": {
                        "devices": [
                          "id zigbee device"
                        ],
                        "component": "main",
                        "capability": "temperatureMeasurement",
                        "attribute": "temperature"
                      }
                    }
                  ]
                }
              ]
            }
          }
        ]
	}
	}
	]
}

Copy rule and just change device ids. Don’t change anything else.

3 Likes

Thanks for the hard work! I am running your drivers talking to an local instance of Home Assistant and it works great.

A request if it is possible, can you add a generic string/message device? I have serveral sensors that publish a timestamp and I track that to determine if a sensor has failed/not reporting. So I was looking for a device that could display a string of text.

Thanks again, fantastic driver and really breathed new life into my SmartThings hub.

1 Like

Welcome to the community. And I got a chuckle over your ID :slight_smile:

I’m wondering what kind of automation testing you needed to build around it. As you probably know, you’re a bit limited with what you can do with free form fields like that. Are you sure you’ll be able to actually do something the timestamp in an automation routine or Rule? If you’re confident you can do what you need to do, this shouldn’t be difficult to add. I’ll try to get to it sometime next week.

Rules API for Zigbee to MQTT sending (periodic updates):

{
  "name": "Every 10 min copy temp - MQTT",
  "actions": [
        {
            "every": {
                "interval": {
                    "value": {
                        "integer": 10
                    },
                    "unit": "Minute"
                  },
			  "actions": [
						 {
						"command": {
						  "devices": [
							"id mqtt device"
						  ],
						  "commands": [
							{
							  "component": "main",
							  "capability": "partyvoice23922.vtempset",
							  "command": "setvTemp",
							  "arguments": [
								{
								  "device": {
									"devices": [
									  "id zigbee device"
									],
									"component": "main",
									"capability": "temperatureMeasurement",
									"attribute": "temperature"
								  }
								}
							  ]
							}
						  ]
						}
					  }
					]
	         }
	     }
	]
}

Copy rule and just change device ids. Don’t change anything else.

Zigbee temperature measurement from SmartThings to MQTT broker is also operating using periodic updates.

3 Likes

hi how do i add this to smartthings ?
any help would be great
thanks
martin

Rules API Getting started
Create Automations via computer - Apps & Clients / Features & Feedback - SmartThings Community

More instructions
FAQ: Getting Started with the new Rules API - Developer Programs / Rules API - SmartThings Community

2 Likes

thanks the only bit im stuck on is this bit whats partyvoice23922

we need a mirror routine , would be eisier for less technically minded like me
ie - mirror temperature of zigbee sensor send as mqtt

Todd’s devices’ non standard capabilities’ names begins with partyvoice…

1 Like

or a tile that shows more than 7 days temperature readings
martin

I think that Rules API is only way to make mirror routine for temperature.

1 Like

4 posts were split to a new topic: Help needed with rule JSON for mqtt integration

Community-developed drivers often use “custom capabilities” (i.e. fields or controls) when there is no stock SmartThings capability that meets the need. SmartThngs assigns a random ID to developers that is used to create and identify their custom capabilities. My assigned ID happens to be ‘partyvoice23922’, so for devices created by my drivers, you’ll often find they contain some custom capabilities that include this name.

A quick tip for finding out what these capabilities are for any given device is to use my API Browser+ app. From the Devices menu, you can select the device of interest from the devices list, then tap the Status button and it will show all the components, capabilities, and attributes defined in the device. So you can quickly see what you need to include in your Rule definition.

2 Likes

thanks ,
i see i can create rules in the api browser+