JSON not recognized Topic is solved

Moderator: leecollings

Post Reply
willem9136
Posts: 53
Joined: Friday 11 December 2020 15:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands Paesens
Contact:

JSON not recognized

Post by willem9136 »

By using NodeRed I can send an MQTT message to topic domoticz/in to update the Temperature meter.

I wrote a Python script which transmits exactly the same message with a dummy value (444) in order to recognize it.
The problem is that this message does not update the meter.

For preventing a timing conflict I delayed the transmission of the test message by 5 seconds.
So first the message from Nodered comes in and after 5 seconds the test message comes in.

With a MQTT tool I logged the MQTT trafic.
See the attachement for the catch of the 2 MQTT messages.
They look exactly equal.
For some reason the value of 444 is never displayed on the meter.

Who can tell me why?
Attachments
2Temps.png
2Temps.png (16.92 KiB) Viewed 489 times
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: JSON not recognized

Post by waaren »

willem9136 wrote: Monday 14 December 2020 8:54 For some reason the value of 444 is never displayed on the meter.
Can you share the Python script and the domoticz log? When I test with

Code: Select all

mosquitto_pub -h 192.168.192.115 -m '{ "idx" : 51, "svalue" : "444"}' -t domoticz/in
it just updates the sensor.
If the host and/or the topic look OK in your Python script, it might be a non alphanumeric char playing tricks somewhere in the MQTT message.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
willem9136
Posts: 53
Joined: Friday 11 December 2020 15:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands Paesens
Contact:

Re: JSON not recognized

Post by willem9136 »

Here python script and a tail of the log file.
Attachments
pyred.py.txt
(1.07 KiB) Downloaded 24 times
logfile.txt
(2.39 KiB) Downloaded 20 times
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: JSON not recognized

Post by waaren »

willem9136 wrote: Monday 14 December 2020 9:47 Here python script and a tail of the log file.
You use topic domoticz.in and domoticz listens to domoticz/in
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
willem9136
Posts: 53
Joined: Friday 11 December 2020 15:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands Paesens
Contact:

Re: JSON not recognized

Post by willem9136 »

Stupid me......
willem9136
Posts: 53
Joined: Friday 11 December 2020 15:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands Paesens
Contact:

Re: JSON not recognized

Post by willem9136 »

Works!
Thanks a lot Waaren.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest