"Generic - MQTT Import" problem

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
Andrew Mamohin
Normal user
Posts: 95
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

"Generic - MQTT Import" problem

#1 Post by Andrew Mamohin » 12 Jun 2020, 16:47

I would like to transfer data from nodered over MQTT to my ESPeasy device.
I can not configure this.
I configured Controller, and I saw in mosquitto_sub how ESP sends data.
AxO3fXmXXu.png
AxO3fXmXXu.png (23.35 KiB) Viewed 10295 times
"
Client mosqsub|11803-orange received PUBLISH (d0, q0, r1, m0, 'cellar/status/LWT', ... (9 bytes))
Connected
Client mosqsub|11803-orange received PUBLISH (d0, q0, r1, m0, 'cellar/out/LWT', ... (9 bytes))
"
My data that I want to receive in ESP is as follows:
"
Client mosqsub|11803-orange received PUBLISH (d0, q0, r0, m0, 'cellar/in', ... (59 bytes))
{"idx":10,"nvalue":31.19,"svalue1":"31.19","t3":31,"t4":19}
Client mosqsub|11803-orange received PUBLISH (d0, q0, r0, m0, 'cellar/in', ... (55 bytes))
{"idx":7,"nvalue":29.3,"svalue1":"29.3","t1":29,"t2":3}
"
I configured device in ESP. What mistakes have I made? I tried different options in Generic setup - MQTT Import, but I did not receive the data.
9DUOWOTvHB.png
9DUOWOTvHB.png (25.52 KiB) Viewed 10295 times
Maybe MQTT is not working correctly in my firmware version? But, I can not use another version because of the PZEM-004 device.
jrA1SWDKvh.png
jrA1SWDKvh.png (26.48 KiB) Viewed 10295 times
Andy.

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

Re: "Generic - MQTT Import" problem

#2 Post by TD-er » 13 Jun 2020, 11:26

The strings you receive don't look like numerical values, but more like JSON formatted data.
MQTT import currently only supports simple strings which can be read as either an int or a float value.

User avatar
Andrew Mamohin
Normal user
Posts: 95
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

Re: "Generic - MQTT Import" problem

#3 Post by Andrew Mamohin » 13 Jun 2020, 14:47

Can you write me an example of such an MQTT message so I can make it in NodeRed?
Andy.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: "Generic - MQTT Import" problem

#4 Post by grovkillen » 13 Jun 2020, 15:06

The message should be a simple numerical value.

Code: Select all

123.456
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
Andrew Mamohin
Normal user
Posts: 95
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

Re: "Generic - MQTT Import" problem

#5 Post by Andrew Mamohin » 13 Jun 2020, 21:08

Wow! Thank! I did the conversion in NodeRed and everything started working correctly.
[attachment=0]FwlFnNf8Mf.png[/attachment]
[attachment=1]ceshLXdFhh.png[/attachment]
Attachments
FwlFnNf8Mf.png
FwlFnNf8Mf.png (12.78 KiB) Viewed 10235 times
ceshLXdFhh.png
ceshLXdFhh.png (12.18 KiB) Viewed 10235 times
Andy.

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests