MQTT Client Plugin

I had the same issue. You may have the same problem I had…

The messages it sends are not persistent. You have to action something on the Vera while being subscribed to the MQTT topic so you can see it as the message is published.

[quote=“stefaanbolle, post:20, topic:190658”]I installed the dependencies and the plugin file and created the device.
The device state is ‘connected’ and I’ve selected a couple of parameters to monitor.
However, when subscribing to Vera/# I do not see any messages.
Any idea where I can troubleshoot/see logs for this plugin?[/quote]

You can see the last published message on the Plugin Settings tab.
You can also monitor Vera’s log or your MQTT Broker’s log.

[quote=“Snaxmuppet, post:21, topic:190658”]I had the same issue. You may have the same problem I had…

The messages it sends are not persistent. You have to action something on the Vera while being subscribed to the MQTT topic so you can see it as the message is published.[/quote]

Yeah that’s correct, thanks Snaxmuppet

Thanks, I’ll check it out

I am finding that the messages are sent for a while and then they stop. Right now I left it half an hour and then switched on the monitored device and the MQTT message wasn’t sent. Tried several times. Checked the Last Message on Setting on the device and the last message was from half an hour ago so it isn’t sending the message.

However, while I am writing this I checked the watchdog and resaved it and then I switched it again and now it is working.

All a bit strange.

bit strange, I haven’t experienced any problems so far.
What type of device are we talking about?

It is a TZ88E Power Meter Socket.

What Variables are you monitoring (that wasn’t published to MQTT)?
I do have a few TKB on the bench that I’m using for testing purposes and haven’t seen any problems so far…haven’t tried with Power Meter though, only status changes.
Bottom line is I’m using variable watches and when something changes then it has to be triggered unless there’s something wrong with the code in which case an error should be logged

Only monitoring urn:upnp-org:serviceId:SwitchPower1 with the Status variable.

It is working… just intermittently it seems although it seems pretty stable and consistent at the moment. It was just that long gap between switching that seemed to put it to sleep.

[quote=“Snaxmuppet, post:29, topic:190658”]Only monitoring urn:upnp-org:serviceId:SwitchPower1 with the Status variable.

It is working… just intermittently it seems although it seems pretty stable and consistent at the moment. It was just that long gap between switching that seemed to put it to sleep.[/quote]

Not really sure what to say TBH, that never happened to me even though i just tested it in a system that wasn’t “touched” for two days.

Fair enough… I shall monitor it now it is working (and still working) :slight_smile:

Hi,

Well done for publishing this. I shall give it a try this weekend. Just wondering if you plan to add support for subscribing to a topic at some time , for updates into Vera , or if the solution already meets your needs ?

To be honest that doesn’t sound like something I would need since I’m moving all my logic away from Vera but I may take a look at it when and if I have the time…of course if any one wants to jump in and do it that would be great!

I have actually worked on an MQTT client for my Caseta Connect plugin (based on a newer version of the paho client than yout plugin uses)… The Caseta Smartbridge uses an MQTT broker for status notifications. The problem is that to get timely subscription notifications (ie: instant status), you need asynchronous IO, not polled IO. I solved this by rewriting the paho client to use the Vera IO subsystem…

You are welcome to take a look at the Caseta Connect plugin to see how this was done… The Client is embedded in the L_CasetaConnect.lua file… and the incoming IO is in the I_CasetaConnect.xml file…

Great - I’ll take a look this weekend hopefully

I implemented an asynchronous TCP socket handler for my Vera xAP plugin - so I had that in my toolbox, but if you’ve already got that integrated with the paho client that makes it so much easier…

Kevin

Really great work creating this!

Any plans to be able to control via MQTT a device on Vera?

[quote=“gregl, post:36, topic:190658”]Really great work creating this!

Any plans to be able to control via MQTT a device on Vera?[/quote]

Not for now…still deciding on how to move forward

Hello SchattenMann,
I’m discovering Node-red and MQTT.

I’ve played a little with “Node-red” and found that it’s a bit hard to describe complex scenarios without coding it in functions.
Besides it seems that it’s difficult to identify the Vera’s devices in the UI when a lot are involved in a flow.

Can you make us a return on the use of MQTT with Node-red ?

[quote=“SchattenMann, post:37, topic:190658”][quote=“gregl, post:36, topic:190658”]Really great work creating this!

Any plans to be able to control via MQTT a device on Vera?[/quote]

Not for now…still deciding on how to move forward[/quote]

you can call action URL on device, or create a handler in your plugin to emulate a webservice (you will have more possibilities)

My MQTT broker requires username / password authentication.
Would it be possible to add a username and password variable so authentication parameters can be passed to the broker for publishing messages?

Not sure I understood what you meant

Hmm yes, I’d completely forgot about that…need to take a look at it