It is currently December 15th, 2019, 6:31 am

Monitor MQTT topic's

Get help with installing and using Rainmeter.
Pimmetje
Posts: 3
Joined: March 26th, 2019, 7:13 am

Monitor MQTT topic's

Pimmetje » March 26th, 2019, 7:23 am

Is it possible to monitor a MQTT topic? I think it would be fun to connect widgets to a existing domotica system like home-assistant.

I am a new user, i googled it. But apologize if i missed something
User avatar
fvanroie
Posts: 3
Joined: September 22nd, 2019, 10:38 pm

Re: Monitor MQTT topic's

fvanroie » September 22nd, 2019, 10:41 pm

Hey Pimmetje,

I’m in the process of creating an Mqtt rainmeter plugin for this purpose.
Let me know if you are still interested in this.

Mvg,
fvanroie
Pimmetje
Posts: 3
Joined: March 26th, 2019, 7:13 am

Re: Monitor MQTT topic's

Pimmetje » September 23rd, 2019, 8:24 pm

Yes i am :)
User avatar
fvanroie
Posts: 3
Joined: September 22nd, 2019, 10:38 pm

Re: Monitor MQTT topic's

fvanroie » September 24th, 2019, 5:52 pm

So far, I've coupled the Rainmeter API ParentChild example to the Paho M2Mqtt.Net library. When both dll's are installed, Rainmeter can indeed communicate with an MQTT broker. :cheers:

You define an MQTT broker and Topics in the config like this:

Code: Select all

[mqttServer]
Measure=Plugin
Plugin=MqttPlugin.dll
Server=192.168.1.1
#Username=
#Password=

[mqttTopic1]
Measure=Plugin
Plugin=MqttPlugin.dll
ParentName=mqttServer
Topic=stat/doorbell/ringer
Qos=1

[mqttTopic2]
Measure=Plugin
Plugin=MqttPlugin.dll
ParentName=mqttServer
Topic=tele/sonoffPow/SENSOR
Qos=0
I'm already using it to read the topic from a powermeter flashed with Tasmota firmware. For simple things it's functional, but I'm not sure how well it'll perform with lots of Meters. Also, only subcribe is implemented. Publishing data to a topic will be added later on...

I can publish the code on github if you want to give it a try yourself.
Pimmetje
Posts: 3
Joined: March 26th, 2019, 7:13 am

Re: Monitor MQTT topic's

Pimmetje » September 24th, 2019, 7:53 pm

I can only say Github "Yes please" :D
User avatar
fvanroie
Posts: 3
Joined: September 22nd, 2019, 10:38 pm

Re: Monitor MQTT topic's

fvanroie » September 24th, 2019, 10:59 pm

You can check it out here: https://github.com/fvanroie/MqttClientPlugin. If you have any questions, don't hesitate to ask!
Any feedback will be much appreciated.