Page 1 of 5

MQTT Export - Added Build 3071

Posted: Tue 24 Mar 2020 11:08 am
by Vossenberg
I currently run CumulusMX on a Raspberry Pi, and I would like it to export my current weather data to an MQTT connection.
Since from this I would like to have HomeAssistant get weather data from my own weatherstation.

Does anybody have information, or already created an MQTT link with CumulusMX? Thank you in advance!

Re: MQTT Export

Posted: Tue 24 Mar 2020 8:06 pm
by mcrossley
I don't know if anybody has used it - I seem to recall it being discussed in the past - but it is on my to-do list for a built-in function, I have a version of the Climatica console that uses MQTT.

Re: MQTT Export

Posted: Tue 24 Mar 2020 10:11 pm
by Vossenberg
Thanks! Nice to know that it is a feature to be considered.
If you need somebody to test, i''ll be around!

Re: MQTT Export

Posted: Wed 25 Mar 2020 12:31 pm
by mcrossley
Vossenberg wrote: Tue 24 Mar 2020 10:11 pm If you need somebody to test, i''ll be around!
Noted.

Re: MQTT Export

Posted: Tue 31 Mar 2020 12:55 pm
by mcrossley
PM'd

Also if anybody else is interested in testing an MQTT feature, let me know.

Re: MQTT Export - Added Build 3071

Posted: Sat 11 Apr 2020 9:29 am
by Sadgit
me me me me me me me me

I am using the latest version with mqtt but nothing is being passed to my mqtt server. I am checking using mqtt explorer and my config is this
[MQTT]
Server=192.168.x.x
Port=1883
UseTLS=0
Username=
Password=
EnableDataUpdate=0
UpdateTopic=CumulusMX/DataUpdate
UpdateTemplate=DataUpdateTemplate.txt
EnableInterval=1
IntervalTime=15
IntervalTopic=CumulusMX/Interval
IntervalTemplate=IntervalTemplate.txt


log errors
2020-04-11 10:51:18.036 Error: MQTT disconnected from the server
2020-04-11 10:51:18.040 MQTT Error: failed to connect to the host
2020-04-11 10:51:18.045 The AddressFamily InterNetworkV6 is not valid for the System.Net.IPEndPoint end point, use InterNetwork instead.
Parameter name: socketAddress
2020-04-11 10:51:23.063 Error: MQTT disconnected from the server
2020-04-11 10:51:23.065 MQTT Error: failed to connect to the host
2020-04-11 10:51:23.069 The AddressFamily InterNetworkV6 is not valid for the System.Net.IPEndPoint end point, use InterNetwork instead.
Parameter name: socketAddress

Re: MQTT Export - Added Build 3071

Posted: Sat 11 Apr 2020 10:57 am
by mcrossley
That's odd, those messages would imply it is trying to use IPv6 to make the connection rather than the IPv4 address you have supplied.

Are you using anonymous authentication on your server or have blanked out the user name and password?

Re: MQTT Export - Added Build 3071

Posted: Sat 11 Apr 2020 11:08 am
by Sadgit
yeah I know looks like it is trying ipv6 and I currently have no u/p on my mqtt server for various reasons (at the moment)

trying a different mono version to see if it is that

Re: MQTT Export - Added Build 3071

Posted: Sat 11 Apr 2020 11:57 am
by mcrossley
OK, I've done some digging in the API, you can specify to use IPv4 or IPv6 explicitly. By default it should pick itself.

I think there may be an issue with anonymous access - I tried it against my mosquitto server with null u/p and it fails, but I have a password file specified, to remove that to test I need to restart the service - maybe later....

Re: MQTT Export - Added Build 3071

Posted: Mon 13 Apr 2020 12:37 pm
by Vossenberg
Thanks just got to the moment to test it. I can see it sends messages however the messages are empty.
Great development already! Thanks!

Re: MQTT Export - Added Build 3071

Posted: Mon 13 Apr 2020 12:46 pm
by mcrossley
Sorry, yes, there are some issues with v3.5.1, they are fixed and awaiting the release of v3.5.2 (soon).

Re: MQTT Export - Added Build 3071

Posted: Fri 01 May 2020 1:01 am
by kocher
I am very interested in MQTT, because I use a template (skin Belchertown) in WEEWX that can be updated in 5 minute cycles (reading the data from the Davis console), or in near real time with this MQTT technique:

http://kocher.es/weewx/

https://obrienlabs.net/belchertownweath ... for-weewx/

https://github.com/poblabs/weewx-belchertown

But the truth is that I don't quite understand MQTT, its configuration seems a bit complex to me.
  Could the new MQTT option in cumulusMX be used to send data every xx seconds to weewx?

I have installed the version: Cumulus [MX] 3.5.4 (build: 3075)

Re: MQTT Export - Added Build 3071

Posted: Fri 01 May 2020 5:13 am
by Sadgit
MQTT is dead easy to be honest.You configure a topic in CMX and period to send the update, then on the MQTT server side configure it to listen to the topic and payload (configured in the CMX mqtt text files) away you go..

I just skimmed that weewx skin and you will still need to setup a mqtt server. You can setup you own in a docker in seconds. I use
https://github.com/toke/docker-mosquitto

Or there are free online servers, https://www.cloudmqtt.com/ is one.

Basically your broker (server) listens for the topics, you configure the client to send them to the broker, then in this case you would point weewx to the connect to the broker to pull the topics/payload. You could send every 5 seconds, I only ever send 15-30 second updates not to swamp the broker. Saying that (I just checked) I have 40+ iot devices sending various updates to the broker, power usage, on/off, etc and I have zero issues, so if you are just wanting CMX 5 seconds will be fine and dandy

I hope this ramble helps

Re: MQTT Export - Added Build 3071

Posted: Sun 03 May 2020 7:27 am
by kocher
Thank you very much for the information. :clap:

I will study it carefully.

Greetings from San Sebastian

Re: MQTT Export - Added Build 3071

Posted: Mon 11 May 2020 1:32 pm
by mediacj
I just want to thank you Mark for the MQTT function it works perfect!

Keep up the good work :clap: