MQTT Topic values like Tasmota

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
ohaldi
Normal user
Posts: 61
Joined: 31 Jan 2020, 09:10
Location: Switzerland

MQTT Topic values like Tasmota

#1 Post by ohaldi » 11 Jan 2023, 14:05

Hello,
I have some ESP who communicate with a brocker.
With Domodicz I get the Temp + Humidity + Baro
ESP_1a.png
ESP_1a.png (2.37 KiB) Viewed 1702 times
With the help of Windows APP MQTT-Explorer I don't see those values!
ESP_2.png
ESP_2.png (24.6 KiB) Viewed 1702 times
I have one ESP with TASMOTA and here every thing work well.
Do I have to add a command in the rules to get this?
Attachments
ESP_1.png
ESP_1.png (4.15 KiB) Viewed 1702 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MQTT Topic values like Tasmota

#2 Post by TD-er » 11 Jan 2023, 15:30

Not 100% what it is you're asking here.
The communications to/from Domoticz via MQTT is done via 2 topics:
domoticz/in
domoticz/out

To this topic we publish JSON formatted strings, which look like this:

Code: Select all

{"idx":250,"RSSI":10,"Battery":91,"nvalue":0,"svalue":"225.27;0.00;0.00;41208.00"}
The idx value is used by Domoticz to identify the source of the message.
As far as I know, there is no other identification or hint on how to interpret these values.

Some types need a "nvalue" and most need the "svalue" (string formatted).

Jieffe
New user
Posts: 6
Joined: 02 May 2021, 22:17

Re: MQTT Topic values like Tasmota

#3 Post by Jieffe » 11 Jan 2023, 19:19

In the "Controllers" tab, have you configured correctly the "Domoticz MQTT" protocol ? Especially the "Enabled" box at the bottom ?

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: MQTT Topic values like Tasmota

#4 Post by Ath » 11 Jan 2023, 21:08

And besides the Controller configuration, what sensor is connected and how is it configured??
/Ton (PayPal.me)

User avatar
ohaldi
Normal user
Posts: 61
Joined: 31 Jan 2020, 09:10
Location: Switzerland

Re: MQTT Topic values like Tasmota

#5 Post by ohaldi » 12 Jan 2023, 10:37

many thanks for your help.
- Yes the Domoticz MQTT Protokol is Enabled. I see the value in Domoticz.
- Yes the Controller Subscribe: Domoticz/in and Controller Publish: Domoticz/out ist ok.
I think that if I had made a mistake, I wouldn't see the values in Domoticz!
ESP_3.png
ESP_3.png (9.1 KiB) Viewed 1650 times
I also tried to add the folling lignes in the Rules:
On Rules#Timer=1 do //When Timer1 expires, do
Publish %sysname%/[PORTE_METEO#Temperature]
timerSet,1,1
endon
But also here I don't see any thing with the help of MQTT Explorer!
The ESP LOG show : 316575: ACT : Publish ESP_PORTE/8.75
My Devices:
ESP_4.png
ESP_4.png (52.1 KiB) Viewed 1650 times
What I am looking for is to have the following answer in the MQTT explorer (sample sent from TASMOTA):
ESP_5.png
ESP_5.png (2.46 KiB) Viewed 1650 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MQTT Topic values like Tasmota

#6 Post by TD-er » 12 Jan 2023, 12:32

I think Tasmota is using a different (newer) notation of publishing messages to Domoticz.
We just publish all messages to the same topic on the MQTT broker and I think it looks like you expect to see a different topic for each sensor.

It would make a lot of sense if Domoticz (apparently??) finally decided to implement this.
But for now, it is not how the data is sent using ESPEasy to Domoticz.


About your attempt to send something using a rules timer.
You must also set a timer or else this will never trigger.

Code: Select all

On Rules#Timer=1 do //When Timer1 expires, do
  Publish %sysname%/[PORTE_METEO#Temperature]
  timerSet,1,1
endon
This does set the timer again after it completed the publish command, but it will never start on its own.
So you must then also trigger it by sending this command via the command field on the Tools page:

Code: Select all

  timerSet,1,1
  

User avatar
ohaldi
Normal user
Posts: 61
Joined: 31 Jan 2020, 09:10
Location: Switzerland

Re: MQTT Topic values like Tasmota

#7 Post by ohaldi » 12 Jan 2023, 17:14

Sorry I forgot to telle you that I have the following code on the top of my Rules:

Code: Select all

on System#Boot do
timerSet,1,3
endon 
What I don't understand with ESPEasy is why I don't see any communication if I use an MQTT Viewer on my Brocker.
I see only for every ESP : status/LWT Connectet.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MQTT Topic values like Tasmota

#8 Post by TD-er » 12 Jan 2023, 19:27

It should send to the domoticz/in topic.
However it does only have the JSON I showed you, no taskname.
If you filter in MQTT explorer on the same IDX value as you use (only the nr in the filter field) then you can see the messages.

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests