[Beta] MQTT beta 3d (released 5th July)

I have some shades running off of a nodemcu that is subscribed to MQTT. right now i can control it from HA but i prefer to have one system to control with so i'd prefer to use HT. i did find a guy who wrote a specific driver for shades like this. i can mess with that. it is sending to mqtt now but the topic is wrong. it seemed to concatenate my device id and the word driver. at least it is speaking to mqtt though. ultimately i just want a button "open shade" on my dashboard so i can click from there and not have to do it in ha.

Actually you should be able to do this with the MQTT app although it's one of the more complex aspects

Thanks. I was kinda hoping you would have said "oh that is one of the easier aspects"....

It just becomes more awkward when there are custom topics and payloads, it can probably be done depending on how the topic and payload is actually constructed to differentiate between blinds, and more challenging if there is a json payload involved.

If you want have a go I'll try and help by PM . We would need to start with examples of the mqtt topics and payloads that show both status reporting and also what commands are available to control (payloads / topics).

You'll likely need to use the current beta3e version.

I want to thank @kevin for his help here. deleting the child device, rebooting and adding back fixed my issue. along with some assistance.

I am new to the Hubitat world (but not to home automation, ZigBee, Z-Wave and so on).
I am trying to install MQTT but I am having problems.
I have imported the app code and the two drivers code.
If I do then App-->Install New User App, everything hangs and nothing is installed.
I have deleted the device and reboot the Hub by without success.
Any hints?

Thanks
Marco

The app takes a few seconds to install after clicking - does it not appear in the listed apps ?

Does anything get into the logs at all?

No, it is not listed. Also a soft reset did not help.
In logs I see entries related to MQTT.
But I also tried to install a built-in app and I have the same behavior

I don’t think this is related to the MQTT app as such then if built in apps don’t install either

Yes, now I am also sure it is not related to MQTT.
Any chance to debug?

Hi, I'm trying to implement a simple temperature sensor read by another homgrown device into HE. I can't seem to find a way to feed the temperature through mqtt and have it display on a dashboard.

I'm new to hubitat, but not new to mqtt or home automation in general I usually write my own stuff, but a friend convinced me to invest in a hubitat due to the radios it supports.

Are there any instructions anywhere on how to do this. The temperature is read by a device that then sends it to a raspberry pi which can do an mqtt publish to my in-house server. I can match any topic because I control what it sends. I have mqtt-explorer and know how to use it. Most of the devices in my house use mqtt to communicate with each other through various techniques.

I tried a virtual temperature sensor, but it didn't work. I tried a real sensor, it didn't work either. I basically want to send data to HE and I know this code will support it, but haven't found out how yet.

Pointers on where to look anyone??

The HE driver here expects a defined topic and payload structure. Either Homie or Home Assistant. If I remember correctly, there are some issues with one or both for temperature. You can search the forum for that.

I wrote my own mqtt drivers for Hubitat because my devices didn't fit the standards at that time, such as they are. It's pretty simple code. You can PM me if you want the github url for them. Not good enough for cut/paste/forget but a decent enough example. You just have find the right Hubitat device/event to map the incoming mqtt payload to.

You can map any arbitrary mqtt topic to a device attribute that you can see in HE. It does not require a defined payload structure unless you are using discovery. You can then display that in a dashboard.

Although the beta 3d version is being refined to a beta 3e it has few issues, so this should work. Did you work through the read me section f) on adhoc topics ?

f) Enable MQTT devices* to be 'mirrored' as virtual devices and controlled within HE.

If so can you do me a screen capture of the virtual temperature sensor device from HE 'devices' that you created within the MQTT app, including the data topics that appear at the bottom of the device and also paste an example screenshot of the MQTT topic/payload where the data is published.

Thanks to both of you for responding so quickly.

I did manage to make it work, but I had to use the thermostat virtual device. I wasn't able to set the temperature on the temperature sensor device. There was an exception because of a null pointer, but the log got away from me and I didn't manage to capture it. I did note that it was on line 7240 in the app though. I followed the instructions in paragraph f several times doing this. It has become muscle memory for me now. (hee hee)

I am using the homie structure as output, because that was easy to select, and I could read it pretty easily. I don't mind that at all. The thermostat gave me trouble though because it wouldn't let me set temperatures below 70 on any of the temp attributes except measure-temperature. That somehow got mapped from the temperature on the virtual thermostat. Since this is a temperature measurement, and I live in Arizona, Going above 100 and below freezing is important.

I do wish I had managed to make the virtual temperature sensor work though. That is the device that makes the most sense.

Edit: I just realized that I can create another virtual temp sensor and mess with it since I have the thermostat hacked in to work right now, this will just be another one. Maybe I can get the problem to show up that way.

OK, I created a new virtual temperature sensor device. The device looked OK under devices, but not under mqtt virtual device edit. Mqtt app seems to think it's a thermostat and created these errors in the log

Here is the device from the mqtt virtual edit menu

And the sidebar menu for devices

Does this help any?

An HE virtual device published with a measure-temperature topic is likely to be a sensor i.e. read only - set will therefore not be applicable.
$settable = false
This is assuming you mean set the temperature from HE.

The virtual thermostat has smarts in that it is a device that acts as a thermostat and will manage itself - I am not sure that is what you want is it ?

Did you create that within the MQTT app or from HE ? It does not seem to have any MQTT data in that screenshot so I'm guessing from HE which won't be useful to me. It needs to be created within my app and have the appropriate topic in the data section for the status

Please clarify what type of device you are trying to bring in from MQTT is it a temperature sensor (in which case it isn't settable from HE).

I also have a device driver for an MQTT remote thermostat.. it is just like a virtual thermostat but totally dumb - just has the attribute fields and all the logic happens remotely - is that more use ? Not if you only want temperature sensor I guess. In this device measure-temperature is $settable = true
i.e. .../measure-temperature/set

image

Those errors are weird - are you trying to use the subscribe command without a topic to subscribe to (a zero length topic) ?

Please

It is created with mqtt using the virtual creation and edit that you put there. This was after a reboot as well.

A virtual temperature sensor does not have hardware to sense temperature, therefore something has to set it. If the hubitat restricts that, it makes no sense to me. If you have an alien temperature sensor that is not supported natively on the hubitat, yet you want it on the dashboard like all your other sensors, mqtt is THE way to go. Heck, that's what it was designed for and what a lot of people use the hubitat for. They export it out to some other software on some other machine so they can have it on their dashboard.

I want to use the hubitat as the main device because the fact that it doesn't need the internet to exist is compelling when you live in the sticks out in the desert where internet is dicey at best and often gone entirely.

I will try anything you want me to for this problem. Let me do it again, I'll delete the device, remove anything I can find in mqtt about it and then create it there again. Let's see what happens

I will get you going but I need you to provide the information I asked for...

A remote temperature sensor can NOT typically be set by HE - it is the remote temperature. However it can be read from MQTT by HE and populated into a display field or used in rules as a test value.

If it is not a remote sensor but a remote setpoint then that should be settable by HE as that is a writeable value. You describe it as a remote temperature sensor though.

By all means we can go to PM on this .. I am around for a couple of hours now

You responde while I was editing my last. So you may not have seen the last couple of lines.

Let's not get hung up in semantics. This device hangs on a wall and measures temperature. It sends it via radio back to a little machine that displays it. I capture that, convert it to mqtt and record it to a database through that channel. I call that a temperature sensor. I'm not clear on what a temperature setpoint is. To me that would be something that you set with a temperature and when the point is passed something happens.

Think of this as a thermometer on the wall that sends mqtt to me telling me the temperature. I can use that message to format another one to any mqtt topic I want.

Now to delete this particular device and do another so you can see what I get.