Page 1 of 1

JSON not recognized

Posted: Monday 14 December 2020 8:54
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?

Re: JSON not recognized

Posted: Monday 14 December 2020 9:21
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.

Re: JSON not recognized

Posted: Monday 14 December 2020 9:47
by willem9136
Here python script and a tail of the log file.

Re: JSON not recognized

Posted: Monday 14 December 2020 10:12
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

Re: JSON not recognized

Posted: Monday 14 December 2020 10:19
by willem9136
Stupid me......

Re: JSON not recognized

Posted: Monday 14 December 2020 10:21
by willem9136
Works!
Thanks a lot Waaren.