Page 1 of 1

MQTT Topic values like Tasmota

Posted: 11 Jan 2023, 14:05
by ohaldi
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 1886 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 1886 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?

Re: MQTT Topic values like Tasmota

Posted: 11 Jan 2023, 15:30
by TD-er
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).

Re: MQTT Topic values like Tasmota

Posted: 11 Jan 2023, 19:19
by Jieffe
In the "Controllers" tab, have you configured correctly the "Domoticz MQTT" protocol ? Especially the "Enabled" box at the bottom ?

Re: MQTT Topic values like Tasmota

Posted: 11 Jan 2023, 21:08
by Ath
And besides the Controller configuration, what sensor is connected and how is it configured??

Re: MQTT Topic values like Tasmota

Posted: 12 Jan 2023, 10:37
by ohaldi
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 1834 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 1834 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 1834 times

Re: MQTT Topic values like Tasmota

Posted: 12 Jan 2023, 12:32
by TD-er
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
  

Re: MQTT Topic values like Tasmota

Posted: 12 Jan 2023, 17:14
by ohaldi
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.

Re: MQTT Topic values like Tasmota

Posted: 12 Jan 2023, 19:27
by TD-er
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.