Integration Solutions using MQTT

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+

i tried uploading the json and got a hhtp error 422 the request is malformed ,

Yes! I should have mentioned that. It might be a bit easier than using the CLI. But it doesn’t help you with the actual creation of the JSON file itself. Just with the submission to SmartThings.

2 posts were merged into an existing topic: Help needed with rule JSON for mqtt integration

all we need now is a rule to send send mqtt payloads so you dont need a virtual device
thanks
martin

ps it was realy easy to add the json to the hub with API BROWSER+
thanks
@TAustin

A very basic question. I created an MQTT momentary button as smartthings/momentary/radio/state. I can see it in MQTT Explorer but the state always shows as “push”. I would expect to see maybe “standby” or “pressed” but it always remains unchanged as “push”.

Any thoughts on what I may have done wrong?

Edit: Figured it out. Simply wasn’t the behavior I expected. “State” doesn’t change despite the message being received.

I’m not sure I’m following you. An MQTT button device created with the MQTT Devices driver, should have a one of 4 states: pressed, double pressed, held, or pressed 3 times. When not activated, you would see ‘Standby’ showing in the Control screen for the device.

The button state should absolutely change to one of the values above as long as you are sending the right message payload in the MQTT message and you have it configured in the device Settings screen.

EDIT: I think I know what you are looking at; if you look at the button attribute using the API (via CLI or other tools) then yes, the state shown there is whatever the last value was emitted for the button. So yes, from that perspective the state doesn’t go back to standby.

1 Like

Yes. In the same way that the app has a quick change of status: standby - pressed - standby, I expected to see the same behavior in MQTT Explorer. But instead of “standby” or “pressed”, I would only see “push” regardless of whether I pressed the button. I attached an action (Node-Red) to the receipt of the mqtt button-press and it works perfectly. Sorry for the false alarm.

Unfortunately, just like the mqtt contacts I set up previously, the mqtt momentary device is not recognized by ActionTiles either. I “really” have to open a case with AT.

One last note I stumbled upon in the event anyone else has this issue. I set up my mqtt contacts several weeks ago and they all work great. Then I began setting up these mqtt momentary buttons and whenever I went to create a new mqtt device it would spin until I got a network or server error. Tried all the usual cures: re-start ST, delete and re-install ST app, etc with no luck. I checked the driver for the MQTT creator and I was at the latest version which had updated since creating my original devices. By deleting the MQTT Creator app and re-installing, it worked fine. It almost seems as if I had to delete and reinstall the MQTT App to have it work with the new driver. I’m probably wrong but that’s what fixed it for me.

EDIT: Updated ActionTiles today and mqtt devices now visible.

Any idea why my mqtt switch requires a refresh every two days to keep working? Could it be my settings see below

When this happens again, can you check to verify that messages are still coming through from MQTT? You can use the mosquitto client to subscribe to topics and monitor messages:

mosquitto_sub -v -h <brokerIP> -t <topic> -u <username> -P <password>

Try this BEFORE you hit the refresh button in the SmartThings device.

When you are pressing the Refresh button to get it working again, are you pressing the button in the device or in the MQTT Device Creator?

yeah I monitored the messages and they are still coming through before I hit the refresh button.
I am pressing the refresh button only on the one in the device NOT the one in the mqtt device creator.

1 Like

Can you try and determine exactly when your SmartThings device stops updating? You had mentioned every 2 days. Is this consistent over the course of a week?

I could add a periodic routine to resubscribe, but I wonder why this would be needed?

Do you have anything other than standard broker configuration options? Are you using Mosquitto?

It seems to be inconsistent and disconnecting a lot


Yes I’m using mosquito broker, I think I have a standard setup, do these settings seem ok?