# \[APP\]\[Pro\] Tasmota MQTT

**URL:** <https://community.homey.app/t/app-pro-tasmota-mqtt/26164>\
**Category:** Apps\
**Tags:** homey-pro\
**Created:** [February 20, 2020, 6:14pm UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164 "2020-02-20T18:14:10Z")\
**Posts on this page:** 20\
**Page:** 13

<div class="post-metadata">

**Author:** ![mvanlijden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mvanlijden/32/27064_2.png) [@mvanlijden](https://community.homey.app/u/mvanlijden)\
**Post date:** [March 15, 2021, 3:56pm UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/241 "2021-03-15T15:56:35Z")

</div>

> [@pavlo](#):
>
> I checked it, it is not a good idea to use position in AND condition. Usually, the position visible to application is 2-3 seconds late (Tasmota reports with delay + delay added by MQTT delivery + processing delay). So your condition will always work with the wrong value.

Hmm I understand what you’re saying. My use case would not be that time sensitive, but I do see what pandora’s box you’re opening. I just want to do a check to see if the blind are open, half down, closed and react differently to that when the sun value changes. I don’t have to react during a movement.  
I’ll solve it by also storing the last known position in a variable then. Was hoping to avoid it 🙂

---

<div class="post-metadata">

**Author:** ![pavlo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pavlo/32/17311_2.png) [@pavlo](https://community.homey.app/u/pavlo)\
**Post date:** [March 16, 2021, 6:31am UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/242 "2021-03-16T06:31:12Z")

</div>

> [@mvanlijden](#):
>
> Any idea when you will release a testversion?

Still need to test some features, maybe in a couple of days.

> [@mvanlijden](#):
>
> But i think this is related to the 0 issue.

It looks like it.

> [@robertklep](#):
>
> No, it doesn’t. Sounds more like developer error 😅

Maybe, it was just an assumption. MQTT Client always gives an error if you are trying to send 0 as a number (but perfectly works with 1 and any other int). But works if you send 0 as a string.

> [@mvanlijden](#):
>
> I’ll solve it by also storing the last known position in a variable then. Was hoping to avoid it 🙂

If you want I can also add windowcoverings\_closed capability, there is a condition flow card related to this capability that says is shutter closed or not. But it will add an additional control element (close/open shutter button) and will not help you with a “half-closed” situation.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [March 16, 2021, 6:44am UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/243 "2021-03-16T06:44:46Z")

</div>

> [@pavlo](#):
>
> MQTT Client always gives an error if you are trying to send 0 as a number

Looks like that’s because of this line: [nl.scanno.mqtt/broker.js at 44756f365aba375db53b8593566261b3e4e07b4a · scanno/nl.scanno.mqtt · GitHub](https://github.com/scanno/nl.scanno.mqtt/blob/44756f365aba375db53b8593566261b3e4e07b4a/broker.js#L283)

Specifically the check `if (args.mqttMessage)`, which will fail if `args.mqttMessage` is the number 0.

Since MQTT is text-only anyway, it’s probably best to always pass strings.

---

<div class="post-metadata">

**Author:** ![mvanlijden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mvanlijden/32/27064_2.png) [@mvanlijden](https://community.homey.app/u/mvanlijden)\
**Post date:** [March 16, 2021, 9:45am UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/244 "2021-03-16T09:45:47Z")

</div>

> [@pavlo](#):
>
> Still need to test some features, maybe in a couple of days.

Thanks!

> [@pavlo](#):
>
> If you want I can also add windowcoverings\_closed capability, there is a condition flow card related to this capability that says is shutter closed or not. But it will add an additional control element (close/open shutter button) and will not help you with a “half-closed” situation.

Don’t think this will be very useful in real life. Thinking about usage scenario’s, after knowing if it not closed, I would still like to know more detail. So the best way might be to be able to store the value of the position in a Homey variable each time it moves. You will have more granular data but with a bit of delay there, but that’s nothing new with Homey 🤣

---

<div class="post-metadata">

**Author:** ![pavlo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pavlo/32/17311_2.png) [@pavlo](https://community.homey.app/u/pavlo)\
**Post date:** [March 18, 2021, 7:31am UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/245 "2021-03-18T07:31:50Z")

</div>

Version 0.8.7 is in beta. Now app using SDK 3 so your homey should run at least software version 5.0.0. Small fixes for device discovery, shutters, sensors. No Sonoff Zigbee bridge support yet (it will take more time than I expected). You can try it here [Tasmota MQTT App for Homey | Homey](https://homey.app/en-gb/app/com.paveld.tasmota/Tasmota-MQTT/test/)  
If no critical bugs will be found I will publish this version to release after the weekend.

---

<div class="post-metadata">

**Author:** ![mvanlijden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mvanlijden/32/27064_2.png) [@mvanlijden](https://community.homey.app/u/mvanlijden)\
**Post date:** [March 18, 2021, 8:10am UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/246 "2021-03-18T08:10:10Z")

</div>

> [@pavlo](#):
>
> using SDK 3 so your homey should run at least software version 5.0.0. Small fixes for device discovery, shutters, sensors. N

So far so good! The issues I had, are now gone. All other movements and flows also seem to be working for my shutters. Power Switch with metering also seems fine with correct values. Will test lights later, I also have an issue in Tasmota itself so that is still a bit wonky over there.

---

<div class="post-metadata">

**Author:** ![GergelyBarta](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gergelybarta/32/27187_2.png) [@GergelyBarta](https://community.homey.app/u/GergelyBarta)\
**Post date:** [March 19, 2021, 5:04pm UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/247 "2021-03-19T17:04:18Z")

</div>

Today the MQTT Client app refreshed on my Homey, and since then the devices handled by Tasmota MQTT application show ‘Device update timeout’ error and a red triangle on it’s buttons.

Anyone else facing the same problem?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [March 19, 2021, 5:12pm UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/248 "2021-03-19T17:12:17Z")

</div>

@scanno looks like there might be an issue with the fix ☹

---

<div class="post-metadata">

**Author:** ![scanno](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/scanno/32/8358_2.png) [@scanno](https://community.homey.app/u/scanno)\
**Post date:** [March 19, 2021, 5:36pm UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/249 "2021-03-19T17:36:15Z")

</div>

Bummer… what topics is it subscribing to and posting on… So some logging from the MQTT Client app would be nice @GergelyBarta . You can look at the logging from setting and retrieve the last few loglines.

---

<div class="post-metadata">

**Author:** ![scanno](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/scanno/32/8358_2.png) [@scanno](https://community.homey.app/u/scanno)\
**Post date:** [March 19, 2021, 7:02pm UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/250 "2021-03-19T19:02:58Z")

</div>

@robertklep think i found the problem

This fails:  
20210319-18:59:51 state.topic = homie/deviceid/$stats/uptime topic = homie/deviceid/$stats/uptime  
20210319-18:59:51 topic: homie/deviceid/$stats/uptime pattern: homie/deviceid/$stats/uptime  
20210319-18:59:51 regex test result: false

Hower this works:  
20210319-19:00:51 state.topic = homie/deviceid/$stats/uptime topic = homie/deviceid/+/uptime  
20210319-19:00:51 topic: homie/deviceid/$stats/uptime pattern: homie/deviceid/+/uptime  
20210319-19:00:51 regex test result: true

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [March 19, 2021, 7:36pm UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/251 "2021-03-19T19:36:00Z")

</div>

Here’s a quick fix for that:

```auto
function topicMatches(topic, pattern) {
  const regex = new RegExp('^' + pattern.replace(/([.$^*])/g, '\\\$1').replace(/\+/, '[^/]+').replace(/#/, '.+') + '$');
  return regex.test(topic);
}

```

But perhaps it’s better to use a module like [`mqtt-wildcard`](https://github.com/hobbyquaker/mqtt-wildcard), which should implement _proper_ matching instead of using a regexp hack like I did 🥴

---

<div class="post-metadata">

**Author:** ![scanno](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/scanno/32/8358_2.png) [@scanno](https://community.homey.app/u/scanno)\
**Post date:** [March 19, 2021, 8:05pm UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/252 "2021-03-19T20:05:02Z")

</div>

Well mqtt-wildcard does not completely worked, but copied the function and modified one check  
seems to work

> **[MQTT Client](https://homey.app/en-us/app/nl.scanno.mqtt/MQTT-Client/)**
>
> Subscripe to MQTT topics

If someone can check if this solves the problem?

---

<div class="post-metadata">

**Author:** ![RobvandeGoor](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robvandegoor/32/20328_2.png) [@RobvandeGoor](https://community.homey.app/u/RobvandeGoor)\
**Post date:** [March 19, 2021, 9:01pm UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/253 "2021-03-19T21:01:48Z")

</div>

For me it works. After a restart of the Tasmota app, all devices linked. No issues found.

---

<div class="post-metadata">

**Author:** ![GergelyBarta](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gergelybarta/32/27187_2.png) [@GergelyBarta](https://community.homey.app/u/GergelyBarta)\
**Post date:** [March 20, 2021, 12:05am UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/254 "2021-03-20T00:05:33Z")

</div>

@scanno upgrading to 0.8.7 solved the issue for me

---

<div class="post-metadata">

**Author:** ![mvanlijden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mvanlijden/32/27064_2.png) [@mvanlijden](https://community.homey.app/u/mvanlijden)\
**Post date:** [March 20, 2021, 7:05am UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/255 "2021-03-20T07:05:52Z")

</div>

Not completely. I’ve updates to 2.4.0 and running Tasmota MQTT 0.8.7. But still I woke up to all my devices being unavailable.  
After a reboot of Tasmota MQTT app they are back again.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [March 20, 2021, 7:14am UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/256 "2021-03-20T07:14:31Z")

</div>

Did you restart the Tasmota app after updating the MQTT Client app? When you update the latter, all connections are gone and the Tasmota app needs to be restarted to set them up again.

---

<div class="post-metadata">

**Author:** ![mvanlijden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mvanlijden/32/27064_2.png) [@mvanlijden](https://community.homey.app/u/mvanlijden)\
**Post date:** [March 20, 2021, 11:13am UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/257 "2021-03-20T11:13:48Z")

</div>

Yes I did, after restarting them again this morning same thing just happened. Now only restarted the Tasmota MQTT app, devices are back up. Will let you know if the behavior continues.  
Would any logging or report help in finding issues?

---

<div class="post-metadata">

**Author:** ![Janno](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janno/32/21757_2.png) [@Janno](https://community.homey.app/u/Janno)\
**Post date:** [March 20, 2021, 11:32am UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/258 "2021-03-20T11:32:30Z")

</div>

For me also only manual upgrade of the v0.8.7 was sufficient (I still run MQTT client v.2.3.0). I also loaded again the Tasmota devices and had to update the flows. (I have also some devices with Sonoff’s app (@robertklep ) and these were not affected). In v0.8.7, I noticed, that the power consumption values for Homey’s Energy-sheet look OK, and now also the manual power consumption values per each non-measuring device give the proper input to the Energy-sheet. Thank You!  
What I noticed during the v0.8.7 upgrade, was that all re-added devices’ thumbnails had a status as “ON” initially, and not actual real status.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [March 20, 2021, 11:43am UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/259 "2021-03-20T11:43:13Z")

</div>

My Sonoff app doesn’t use the MQTT Client app.

---

<div class="post-metadata">

**Author:** ![Janno](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janno/32/21757_2.png) [@Janno](https://community.homey.app/u/Janno)\
**Post date:** [March 20, 2021, 11:44am UTC](https://community.homey.app/t/app-pro-tasmota-mqtt/26164/260 "2021-03-20T11:44:03Z")

</div>

Yes, I remembered that… 😉

[Previous page](https://community.homey.app/t/app-pro-tasmota-mqtt/26164.md?page=12)

[Next page](https://community.homey.app/t/app-pro-tasmota-mqtt/26164.md?page=14)
