I found a nice description of publishing temperature and humidity to Domoticz using MQTT on The Free Physicist and later on an even nicer one from Paulus Schoutsen on Github to set up MQTT temp/hum readings.
In the script I added this line for testing purposes.
Code: Select all
client.publish( "domoticz/in", "{'idx' : 56, 'nvalue' : 0, 'svalue' : '22;66;3' }");Code: Select all
MQTT: Topic: domoticz/in, Message: {'idx' : 56, 'nvalue' : 0, 'svalue' : '22;66;3' }
Error: MQTT: Invalid data received! Code: Select all
client.publish( 'domoticz/in', '{"idx" : 57, "nvalue" : 0, "svalue" : "22;66;2" }');The problem is that Arduino doesn't accept single quotation marks and Domoticz doesn't accept single quotation marks.
Mixing single and double quotation marks in one line offers a solution for most compilers, but not in this case.
Can you give me an alternative on how to publish to Domoticz in a way that is accepted by both parties?