It is currently April 26th, 2024, 7:30 pm

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

Post by Pimmetje »

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

Post by fvanroie »

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

Post by Pimmetje »

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

Re: Monitor MQTT topic's

Post by fvanroie »

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

Post by Pimmetje »

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

Post by fvanroie »

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.