Z-Way Tasmota and MQTT

Discussions about Z-Way software and Z-Wave technology in general
JohannesF
Posts: 36
Joined: 04 Jan 2021 13:20

Z-Way Tasmota and MQTT

Post by JohannesF »

Good morning and a happy new year to all!
I am Johannes and new here in the forum. Please apologize if my first question is perhaps still unclear and information is missing.

I‘m running a Raspi 3 with a Z-Wave.me module with about 15 devices for my home automation. So far everything works smoothly.

Now I have bought a few WLAN sockets and flashed them with Tasmota. I can address and switch the sockets in the browser, accessing them directly via their IP address. To integrate them into Z-Way, I created a virtual switch under the application "Dummy Device" and an instance of Robin Eggenkamp's MQTT application. This works as much as I can switch the sockets on and off with Z-Way and the power status is also indicated on the virtual switch.

Now the problem. When I press the hardware button on the WLAN socket, the socket switches and also sends the MQTT message. But I can't get the virtual switch to react and display the status change.

I hope that was understandable. Can anyone who has managed to do this please help me? Or suggest another way how I can integrate the Tasmota switches?

Thanks in advance!
Johannes
michap
Posts: 442
Joined: 26 Mar 2013 10:35
Contact:

Re: Z-Way Tasmota and MQTT

Post by michap »

Hi,

had you a look at HTTP-Device?

Here you can configure 3 URL:
URL for action On
URL for action On
URL to get value

I think it could be possible...

Michael
JohannesF
Posts: 36
Joined: 04 Jan 2021 13:20

Re: Z-Way Tasmota and MQTT

Post by JohannesF »

Hi Michael,

Thanks a lot for this valuable hint. I will definitely have a look. Although I was preferring to use a protocol that does not require polling the status of the different switches. MQTT seemed to nicely meet this criterion.

Best,
Johannes
JohannesF
Posts: 36
Joined: 04 Jan 2021 13:20

Re: Z-Way Tasmota and MQTT

Post by JohannesF »

Hi,

Thanks again for pointing me to the HTTP device. I managed to set the URLs for switching ON and OFF and to read the power status by sending
http://192.168.20.68/cm?cmnd=Power
which returns e.g.
{"POWER":"ON"}.

Could you please help me one more time with the correct inline Javascript code to update the status of the virtual device based on the above response?

Thanks in advance
Johannes
JohannesF
Posts: 36
Joined: 04 Jan 2021 13:20

Re: Z-Way Tasmota and MQTT

Post by JohannesF »

Folks,
I found a solution which I‘d like to share in case this could be useful for others.

$$.POWER === ‘ON‘ ? ‘on‘ : ‘off‘
enbemokel
Posts: 482
Joined: 08 Aug 2016 17:36

Re: Z-Way Tasmota and MQTT

Post by enbemokel »

Thanks
ridewithstyle
Posts: 155
Joined: 02 Jan 2016 01:20

Re: Z-Way Tasmota and MQTT

Post by ridewithstyle »

Hey Johannes,

I ran into the same problem with my shelly modules. The MQTT app does not fully fit the binding-naming sceme of the device.

Hence I instantiated two MQTT apps per device. One app configured to set the MQTT device and one app to catch the messages that the device publishes on status change. That results in unnecessary traffic, but it works :-)

Regards,rws
JohannesF
Posts: 36
Joined: 04 Jan 2021 13:20

Re: Z-Way Tasmota and MQTT

Post by JohannesF »

Hi rws,

I tried that as well but seem to have created a permanent loop. When the device published a status change I was able to capture that and set the UI-device, accordingly. However, this change triggered to UI-devive to fire a MQTT message to the Tasmota device which responded...

In the meantime I overcame the issue using an HTTP device. Although, I would really perfer to use MQTT. Any guidance would be very much appreciated.

Thanks
Johannes
michap
Posts: 442
Joined: 26 Mar 2013 10:35
Contact:

Re: Z-Way Tasmota and MQTT

Post by michap »

Hi,
In the meantime I overcame the issue using an HTTP device.
have you selected the option "Don't send update event if value has not changed " in HTTP Device?
If not it will be the reason for the loop...

Michael
JohannesF
Posts: 36
Joined: 04 Jan 2021 13:20

Re: Z-Way Tasmota and MQTT

Post by JohannesF »

Yes, I had tried that as well but it didn't seem to help. What I believe is happening is the following:
When the button on the tasmota is pressed to switch on, it sends a message which is used to change the status of the UI device from OFF to ON.
The UI then fires e.g. a POWER ON cmnd to the device which is already on. The Tasmota responds with a new status=ON message which shouldn't do anything to the UI device as the status doesn't change. No clue why the cycle doesn't stop.

I could imagine that I had not selected the most suitable MQTT topics. So if anyone could share a working example including the MQTT topic and prefix settings of the device that would be highly appreciated.

Regards
Johannes
Post Reply