MQTT Client

Questions and comments specific to a particular plugin should go here.
ToxMox
Posts: 14
Joined: Fri Aug 04, 2017 7:39 pm

Re: MQTT Client

Post by ToxMox » Mon Aug 14, 2017 2:52 pm

krambriw wrote:I suspect I made a bug

I was not able to reproduce the error but I think I found what could cause the problem. I have modified the plugin (new version 1.2.1)
It no longer hangs EG anymore. I couldn't get my cert for beebotte to work in brief testing. You mentioned moving the paho folder to the lib27/site-packages folder. On EG 4.x it should be the lib26/site-packages folder right? Or do I need to create a lib27 folder?

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: MQTT Client

Post by krambriw » Mon Aug 14, 2017 3:00 pm

On EG 4.x it should be the lib26/site-packages folder right?
Correct (and you obviously have to change the port to the one used by beebotte as well)

How many certificates are you using? If one, add it as the CA-cert. Does it require username and password as well?

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: MQTT Client

Post by krambriw » Mon Aug 14, 2017 4:15 pm

it works fine with beebotte, as example below using the token. You could instead use the secret key. It's described pretty well here:
https://beebotte.com/docs/mqtt
When I publish something to EG/EG it is shown in the EG log

It seems not possible to upload files to the forum anylonger so here is a link instead

http://krambriw.net/BB.png

ToxMox
Posts: 14
Joined: Fri Aug 04, 2017 7:39 pm

Re: MQTT Client

Post by ToxMox » Mon Aug 14, 2017 4:17 pm

krambriw wrote:
On EG 4.x it should be the lib26/site-packages folder right?
Correct (and you obviously have to change the port to the one used by beebotte as well)

How many certificates are you using? If one, add it as the CA-cert. Does it require username and password as well?
Yup changed the port to 8883. And yes added as a CA cert. It requires a username but not a password. I'm passing my secret key as a username. Here is the info on their end if you are curious: https://beebotte.com/docs/mqtt
In the EG log I just get

Code: Select all

MQTT Client: Trying to reconnect with..<my topic> mqtt.beebotte.com
over and over again.

I have successfully connected using the cert with node-red btw. Not sure if that helps at all but thought I'd mention it.

ToxMox
Posts: 14
Joined: Fri Aug 04, 2017 7:39 pm

Re: MQTT Client

Post by ToxMox » Mon Aug 14, 2017 4:21 pm

I see you posted while I was writing my post above. I'm going to try EG 5.x again as maybe this is an EG 4.x issue?

ToxMox
Posts: 14
Joined: Fri Aug 04, 2017 7:39 pm

Re: MQTT Client

Post by ToxMox » Mon Aug 14, 2017 4:35 pm

Ok works fine with EG 0.5.0-rc4. Thanks for fixing this!

User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Re: MQTT Client

Post by Saxtus » Mon Aug 28, 2017 7:20 pm

Hello,

When starting a new MQTT subscription, how can I change the client ID?

I see that it's got a random one assigned, but if I copy/paste the EG action, so I can modify only the subscription topic, the client ID gets preserved, and that is causing conflict to the broker.

Thank you for the great plugin!

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: MQTT Client

Post by krambriw » Tue Aug 29, 2017 5:55 am

Hello Saxtus, thank You,

Currently there is no input field for client id as you have seen. A work around for your use case is not to copy and paste directly, instead paste to a text editor in between and make the change, then copy and paste the html into the EG tree

1) For each action, copy the action from the EG tree
2) Paste into a text editor, change the client id in the html text
3) Copy the html text and paste into EG tree

Alternatively you could directly edit the whole EG tree file when you have copy & pasted all your actions

Snowbird
Experienced User
Posts: 342
Joined: Fri Jul 03, 2009 10:04 am

Re: MQTT Client

Post by Snowbird » Wed Sep 06, 2017 8:03 am

Hi krambriw,

I just want to let you know that the mqtt dialog boxes are too big to fit on small resolution screen (1280x800), I know it's not today's standard but they still exist for some people ! :)

Here's a screen shot of how it looks like, look at the black bar at the very bottom, it's my Windows 10 tasks bar, and as you can see I'm not able to see all the fields (others are located below the black bar) :

Image

I have checked the code, and was able to rearrange things to fit everything inside but in case of a plugin upgrade I have to redo it all over again, do you think you can rearrange the fields so the dialog box takes less place in height (less than 700px for example ) ? If you want, I can do the modification on my end and I will send it to you so you can include it in the source code, this way in case of an upgrade this part won't change. Let me know.

Thank you.

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: MQTT Client

Post by krambriw » Fri Sep 08, 2017 4:27 am

Hello Snowbird,
Yes, agree, this can be (or is) a problem. I would like to accept your suggestion, are your modifications based on the latest version (1.2.1)?

Best regards, Walter

Snowbird
Experienced User
Posts: 342
Joined: Fri Jul 03, 2009 10:04 am

Re: MQTT Client

Post by Snowbird » Fri Sep 08, 2017 6:24 am

Hi,

Yes I'm using your latest version 1.2.1 and I made the modification on it. I have just modified this file :
%ProgramData%\EventGhost\plugins\MQTT Client\__init__.py

I did my best to make it look pretty but it's not easy when you don't have much room :) Feel free to readjusted a little bit if needed.

Thank you again for this great plugin !!
Attachments
__init__.py
Plugin MQTT v1.2.1
dialog box reduced in height to fit on small screen resolution (800px height)
(64.28 KiB) Downloaded 79 times

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: MQTT Client

Post by krambriw » Sat Sep 09, 2017 2:15 pm

Hello, so now I have re-arranged the gui parts accordingly, should be fine and fit most screens
Version 1.2.2

Snowbird
Experienced User
Posts: 342
Joined: Fri Jul 03, 2009 10:04 am

Re: MQTT Client

Post by Snowbird » Sat Sep 09, 2017 3:22 pm

Thank you Walter ! it looks amazing now, much better than what I did ! and most of all it fits my screen perfectly now ;)
you're the man !

Septik
Posts: 39
Joined: Sun Feb 15, 2015 1:29 pm

Re: MQTT Client

Post by Septik » Wed Oct 18, 2017 6:26 pm

I'm having a few issues with this plugin. Mainly, I am unable to subscribe to more than one broker. I was hoping to be able to subscribe to several specific topics from Home Assistant's MQTT Statestream component. The broker publishes all state changes in a topic with this format:

Code: Select all

homeassistant/domain/entity/state
Since there are several domains and countless entities in my configuration, I don't want to subscribe to "homeassistant/#". That gives me probably 60 events immediately, most of which I don't want. Therefore it's more practical for me to subscribe to a few individual topics, like so:

Code: Select all

homeassistant/sensor/temp_inside/state
homeassistant/sensor/temp_outside/state
homeassistant/climate/thermostat/temperature
homeassistant/lights/light_living_room/state
...and so on. However, once I add a second broker to my configuration in EventGhost, it overwrites the previous one. I also tried adding a public broker to see if it had to do with the IP being identical, but that too overwrote my previous subscription.

Any ideas?

In short: I can't subscribe to more than a single topic.

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: MQTT Client

Post by krambriw » Thu Oct 19, 2017 5:29 pm

Hi there, yeah it is easy to forget minor details,

I think it will work for you but you have to give each subscription a unique name. Like in this example, they are simply named 1,2,3,4 and all are connected to an external broker

Hope this helps,
Kind regards, Walter
Namnlöst_1.png
Namnlöst_2.png

Post Reply