(How has to become this complicated?)
I have a python script running and I added this line:
client.publish("alarm_clock/oops",text)
I then have an MQTT IN
node and set it so:
[{"id":"20f5e9bf.b0c9f6","type":"mqtt in","z":"eff5d6e6.236338","name":"","topic":"alarm_clock/received","qos":"2","datatype":"auto","broker":"9e83409.d55cfc","nl":false,"rap":false,"x":2200,"y":1520,"wires":[["dd14cb9.4e59838"]]},{"id":"9e83409.d55cfc","type":"mqtt-broker","name":"Local Host","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]
I see the messages clearly in a debug
node (eg):
13:20:14@6,1
So in that spirit I add another line:
client.publish("alarm_clock/next","OK")
I then create another MQTT IN
node and set it as so:
[{"id":"7af3c479.02f0ac","type":"mqtt in","z":"eff5d6e6.236338","d":true,"name":"","topic":"alarm_clock/next","qos":"2","datatype":"utf8","broker":"9e83409.d55cfc","nl":false,"rap":false,"x":960,"y":1310,"wires":[["931ebc46.313478","6e6d67af.fec578"]]},{"id":"9e83409.d55cfc","type":"mqtt-broker","name":"Local Host","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]
Excuse the fact it is disabled
I stick a debug
node onto it and wait.
{"topic":"ERROR_REPORT/Alarm_Clock/LCD message handling flow/alarm_clock/next","payload":"OK","qos":0,"retain":false,"_topic":"alarm_clock/next","_msgid":"b190ae41.af86f","error":{"message":"Unexpected token O in JSON at position 0","source":{"id":"6e6d67af.fec578","type":"json","count":1}}}
Where's the elephant?
I can't understand what is wrong with this.
It happily accepts the stuff I am sending back with text
- which isn't a JSON structure as far as I know.
Yet, when I want to send back a simple OK
.... It spits the dummy.