MQTT plugin gets its settings lost on restart

Discussions about Z-Way software and Z-Wave technology in general
harre
Posts: 95
Joined: 24 Nov 2020 02:22

MQTT plugin gets its settings lost on restart

Post by harre »

Not sure where to report issues, I have added some previously on the github repo and haven't gotten any response.

https://github.com/Z-Wave-Me/zwave-smarthome/issues/286

Steps to reproduce:
1. Add MQTT so it shows up at
http://pi:8083/smarthome/#/apps/local
2. Configure app and save.
It shows now on active tab too
3. restart z-way server in terminal
sudo systemctl restart z-way-server.service

The active app is now gone and MQTT reporting have stopped and I need to readd it again
User avatar
PoltoS
Posts: 7562
Joined: 26 Jan 2011 19:36

Re: MQTT plugin gets its settings lost on restart

Post by PoltoS »

We are making a native MQTT support. Will be ready soon. So may be not worth to bother the author of the old app
harre
Posts: 95
Joined: 24 Nov 2020 02:22

Re: MQTT plugin gets its settings lost on restart

Post by harre »

That's great news! Is there any beta version I can try out? :)
User avatar
PoltoS
Posts: 7562
Joined: 26 Jan 2011 19:36

Re: MQTT plugin gets its settings lost on restart

Post by PoltoS »

There is one, but with JS API only. Very soon (within two weeks) we will have the new easy configurable MQTT app made on top of this JS API.

https://storage.z-wave.me/z-way-server/ ... _armhf.deb
harre
Posts: 95
Joined: 24 Nov 2020 02:22

Re: MQTT plugin gets its settings lost on restart

Post by harre »

Thanks for quick response, What can I do with the API and how do I use it?

I'm still quite the noob with js-development, but I have been coding .net for almost 15 years, but this project is so big so it's hard for me to grasp.

Is there any commit for the MQTT-api so I easier trace how to use it?
User avatar
PoltoS
Posts: 7562
Joined: 26 Jan 2011 19:36

Re: MQTT plugin gets its settings lost on restart

Post by PoltoS »

This is as simple as:

// constructor
var m = new mqtt(server, port);

// handlers
m.onconnect = function() {};
m.onmessage = function(topic, msg) {};
m.onsubscribe = function(topic) {};
m.onclose = function() {};

// methods
m.tlsset(ca_file, ca_path, cert_file, key_file);
m.connect();
m.publish(topic, message);
m.subscribe(topic);
m.unsubscribe(topic);
m.disconnect();

inside handlers (onXXXX use `this` instead of m)
harre
Posts: 95
Joined: 24 Nov 2020 02:22

Re: MQTT plugin gets its settings lost on restart

Post by harre »

Thanks for the follow up, but I feel like before I even figure out how to put these pieces together you have already built the working MQTT solution :)

Thanks for the manual link, I'll try to get some time to get antiquated more with the system and try to write my own module
piet66
Posts: 266
Joined: 04 Feb 2017 17:00

Re: MQTT plugin gets its settings lost on restart

Post by piet66 »

I like the fact that you now provide a MQTT api.
Unfortunately it comes too late for me. I am almost finished with my own MQTT module. :(
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me ZW0700 7.20.00 07.38/1766938484 1025/257
Z-Way version v3.2.3 from 2022-04-06 04:56:23 +0300
harre
Posts: 95
Joined: 24 Nov 2020 02:22

Re: MQTT plugin gets its settings lost on restart

Post by harre »

Share the code and hopefully some parts can be incorporated :)
Post Reply