If I had a generic analog device that let you provide a number and a unit in separate JSON keys, they would also either have to be displayed in separate fields in the app, or displayed concatenated in a text field. But the latter wouldn’t let you perform numeric compares in automations. So would it be acceptable to have the two separate fields?
I think you are getting this confused with a separate driver - the MQTT Discovery driver. That one does require the top-level topic to be ‘smartthings’. But the MQTT Devices driver is completely configurable.
MQTT Devices driver:
Is it possible to add retain flag (selectable in the settings) to temperature and humidity measurements’ publishing?
When I use periodic publishing the SmartThing’s history is full of these rule executed events.
If the driver supports retain flag it’s possible to use rule that is executed only when measurement changes.
I’m trying to import my electricity price into smartthings.
I have setup a python script that sends out a mqtt message every hour with the latest price.
I’m able to get the data using your mqtt test driver, but I’m not able to make any rules using this. Eg if value is below 0.4 or above 1.3
Do you have any idea if it is possible to do this?
Hi. I’d recommend you use my MQTT Devices driver. You need to be using a device that supports a floating point values so to can do numeric comparisons in automations. Right now you can use the temperature type device. But I will be adding a generic numeric device.
Hi Again …
Regarding the generic device, yes I believe this is actually a better approach (separate value and unit).
Thanks !!
And one final (I hope) question:
I see where it is possible to actually publish a message. But to me it looks like it takes a reading from the broker and (re) publishes it somewhere else.
Is it possible to publish the value of a virtual device to the broker ?
Thanks Pinky.
Thanks for your reply. Much appreciated.
Okay, I will try with the temperature sensor. Although I tried with prices in MWh, and it said the values are too high (More than 100), which makes sense if it’s a temperature sensor. I’ll try and devide them before importing them into smartthings, but a generic sensor, where you could choose the unit type would be awesome, if you have time at some point
I use a Dimmer for the same purpose, rounding up the values to the nearest integer, and making sure I put 0 when the electricity price is negative and 100 when it’s above $1. For my goals, if it’s below, let’s say, 5 cents, I don’t care if it’s 4.9 or 4.1
Thanks TapioX,
But there I see you’re publishing one of the devices configured using the MQTT driver.
I’m trying to publish a value, say from a virtual switch created from the vdev controller, groovy IDE, or similar.
Thanks
Pinky
Yep, managed to get it going. Thanks!
Actually I didn’t know that an mqtt device doesn’t need to subscribe to anything and can just publish … So can make an easy switch (without automation and virtual device).
Pinky
It will not echo back out received messages - only messages initiated within SmartThings (via app Control screen or automation). So yes if you want, for example to publish the value of a switch changing, then just turn that option on in settings and provide the topic you want it to go out under. Only devices with user controls have that feature.
Is there a chance you can add a window treatment option? Looks like Alexa doesn’t like when I ask her to open/close a switch, and “turn on the Living Room Shades” sounds unnatural
I noticed you added an on/off capability for the dimmer, but looks like it only sends the value update commands, not the on/off ones. Is there some limitation or can you add it? For now I can use a workaround, add a switch device publishing to the same topic and just follow the dimmer one via an ST automation, but I’m curious if it can be updated.
@TAustin, your GitHub page for the MQTT SmartApp has a limited list of currently supported devices. I was wondering if it currently supports temperature and humidity sensors, and if it doesn’t if support for these types of devices could be added. Thanks!